/* Studio Signature — layout & surfaces */
:root {
    --surface-tint: rgba(51, 65, 85, 0.35);
    --border-strong: rgba(100, 116, 139, 0.55);
    --text-on-dark: #ffffff;
    --text-muted: #ffffff;
    --focus-editor: rgba(148, 163, 184, 0.45);
}

html {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

@supports (height: 100dvh) {

    html,
    body {
        height: 100dvh;
        max-height: 100dvh;
    }
}

.studio-shell {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background-color: #0f172a;
    background-image:
        radial-gradient(ellipse 115% 75% at 50% -35%,
            rgba(71, 85, 105, 0.28),
            transparent),
        radial-gradient(ellipse 50% 40% at 100% 20%,
            rgba(30, 41, 59, 0.45),
            transparent),
        radial-gradient(ellipse 45% 35% at 0% 100%,
            rgba(51, 65, 85, 0.2),
            transparent);
    overflow: hidden;
}

@supports (height: 100dvh) {
    .studio-shell {
        height: 100dvh;
        max-height: 100dvh;
    }
}

/* Zone de travail : en largeur ≥900px tout tient dans la fenêtre ; en étroit, défilement vertical ici */
.studio-workspace {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
}

@media (min-width: 900px) {
    .studio-workspace {
        padding: 0.55rem 0.85rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
        gap: 0.5rem;
    }
}

/* 70% éditeur + 30% aperçu (≥900px), empilé sinon */
.studio-split {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    overflow: hidden;
}

@media (min-width: 900px) {
    .studio-split.studio-split-stack {
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
    }

    .studio-col-editor {
        flex: 7 1 0%;
        min-width: 0;
        min-height: 0;
    }

    .studio-col-preview {
        flex: 3 1 0%;
        min-width: 220px;
        min-height: 0;
        max-width: none;
    }
}

.studio-col-editor {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

@media (max-width: 899px) {
    /* Fenêtre étroite : tout le workspace défile pour garder l’éditeur WYSIWYG accessible */
    .studio-workspace {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .studio-split.studio-split-stack {
        flex: 0 0 auto;
        flex-grow: 0;
        flex-shrink: 0;
        min-height: auto;
        overflow: visible;
    }

    .studio-col-editor {
        flex: 0 0 auto;
        min-height: min(70vh, 28rem);
    }

    .studio-col-preview {
        flex: 0 0 auto;
        min-height: 0;
        max-height: none;
    }

    .studio-preview-mount {
        flex: 0 0 auto;
    }
}

.studio-preview-aside {
    overflow: hidden;
}

.studio-preview-aside .studio-preview-aside__head {
    flex-shrink: 0;
}

.studio-preview-mount {
    min-height: 0;
}

/* Promo sous l’aperçu mobile */
.studio-preview-footer {
    width: 100%;
    max-width: 100%;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    flex-shrink: 0;
}

#mobile-preview-frame.mobile-frame {
    box-sizing: border-box;
    flex-shrink: 0;
    width: min(13rem, 90vw);
    max-width: 100%;
    height: auto;
    max-height: min(23rem, 100%);
    aspect-ratio: 196 / 348;
    margin: 0 auto;
    background: #ffffff;
    background-image: none;
}

.studio-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    border: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.studio-panel__head {
    flex-shrink: 0;
    padding: 0.65rem 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    border-bottom: 1px solid rgba(51, 65, 85, 0.65);
    background: rgba(30, 41, 59, 0.5);
}

.studio-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

.studio-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.studio-section {
    margin-bottom: 1.25rem;
}

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

/* Colonne éditeur = héros (contraste texte ≠ bleu sur fond bleu) */
.studio-panel--editor {
    border-color: var(--border-strong);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.5),
        0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Panneau barre d’outils — même famille que les autres panneaux */
.toolbar-panel.studio-panel {
    flex-shrink: 0;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    border-radius: 0;
}

.toolbar-panel .studio-panel__head {
    padding: 0.16rem 0.45rem;
    font-size: 0.48rem;
    letter-spacing: 0.09em;
}

.toolbar-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

/* Colonnes latérales : import/export (gauche) · menu (centre) · logo (droite) */
.toolbar-rail {
    flex: 0 0 auto;
    box-sizing: border-box;
    max-width: 100%;
    background: linear-gradient(165deg,
            rgba(30, 41, 59, 0.92) 0%,
            rgba(15, 23, 42, 0.97) 100%);
    border-bottom: 1px solid rgba(71, 85, 105, 0.75);
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    padding: 0.28rem 0.38rem;
}

/* Fenêtre étroite (moins de 1100px) : empiler les trois bandes — pas de scroll horizontal ni chevauchement */
@media (max-width: 1099px) {
    .toolbar-panel-body {
        flex-direction: column;
    }

    .toolbar-rail--left,
    .toolbar-rail--right {
        width: 100%;
        min-width: 0;
        border-left: none;
        border-right: none;
    }

    .toolbar-rail--right {
        border-bottom: none;
    }

    .toolbar-main-surface {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .toolbar-strip--embedded {
        overflow: visible;
        max-height: none;
    }

    .toolbar-main-surface .toolbar-group-row {
        flex-wrap: wrap;
    }
}

/* Grande largeur : trois colonnes sur une ligne */
@media (min-width: 1100px) {
    .toolbar-panel-body {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        max-height: min(32vh, 320px);
    }

    .toolbar-rail--left {
        /* Assez large pour Retour + Revenir + Aide sur une seule ligne */
        width: clamp(7.35rem, 15vw, 10rem);
        min-width: 7.35rem;
        max-width: 11rem;
        border-bottom: none;
        border-right: 1px solid rgba(71, 85, 105, 0.75);
        overflow-x: hidden;
        overflow-y: auto;
    }

    .toolbar-rail--right {
        width: clamp(7rem, 18vw, 14rem);
        min-width: 0;
        max-width: 15rem;
        border-bottom: none;
        border-left: 1px solid rgba(71, 85, 105, 0.75);
        overflow-x: hidden;
        overflow-y: auto;
    }

    .toolbar-main-surface {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
    }

    .toolbar-strip--embedded {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
}

/* Fenêtres basses (ex. 1080p avec menus + favoris) : plus de place pour l’éditeur */
@media (min-width: 1100px) and (max-height: 900px) {
    .toolbar-panel-body {
        max-height: min(30vh, 300px);
    }

    .editor-stage {
        padding: 0.4rem 0.45rem;
    }

    .studio-workspace {
        padding: 0.4rem 0.55rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
        gap: 0.38rem;
    }
}

/* Largeur + bordure image : toujours l’un sous l’autre */
.toolbar-rail--right .toolbar-aside-sliders {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
}

.toolbar-rail--right .toolbar-slider-compact--aside {
    width: 100%;
    flex: none;
}

/* Retour / Revenir / Aide : une seule ligne (boutons compacts + rail min-width) */
.toolbar-rail-undoredo {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    gap: 0.18rem;
    margin-top: 0.28rem;
    padding: 0.26rem 0.2rem 0.3rem;
    border-top: 1px solid rgba(71, 85, 105, 0.55);
    background: rgba(15, 23, 42, 0.25);
}

.toolbar-rail--left .toolbar-rail-undoredo {
    margin-top: auto;
}

.toolbar-rail-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 2.1rem;
    height: 2.1rem;
    margin: 0;
    padding: 0;
    border: 1.5px solid rgba(186, 230, 253, 0.5);
    border-radius: 0.42rem;
    background: linear-gradient(180deg,
            rgba(71, 85, 105, 0.75) 0%,
            rgba(30, 41, 59, 0.95) 100%);
    color: #f8fafc;
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s,
        transform 0.08s;
}

.toolbar-rail-icon-btn:hover:not(:disabled) {
    background: linear-gradient(180deg,
            rgba(100, 116, 139, 0.9) 0%,
            rgba(51, 65, 85, 1) 100%);
    border-color: rgba(196, 210, 254, 0.85);
    color: #ffffff;
}

.toolbar-rail-icon-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 0.95),
        0 0 0 4px rgba(165, 180, 252, 0.9);
}

.toolbar-rail-icon-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.toolbar-rail-icon-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    filter: saturate(0.6);
}

.toolbar-rail-icon-btn__svg {
    display: block;
    flex-shrink: 0;
}

/* Aide : icône ? rouge, ouvre aide.html dans un nouvel onglet */
.toolbar-rail-help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 2.1rem;
    height: 2.1rem;
    margin: 0;
    padding: 0;
    border: 1.5px solid #b91c1c;
    border-radius: 50%;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.08s,
        box-shadow 0.15s;
    flex-shrink: 0;
    text-decoration: none;
    line-height: 0;
}

.toolbar-rail-help-link:hover {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
    border-color: #fecaca;
    transform: translateY(-1px);
    box-shadow:
        0 2px 8px rgba(220, 38, 38, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.toolbar-rail-help-link:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 0.95),
        0 0 0 4px rgba(252, 165, 165, 0.95);
}

.toolbar-rail-help-link:active {
    transform: translateY(1px);
}

.toolbar-rail-help-link__svg {
    display: block;
    flex-shrink: 0;
}

/* Petite zone sous l’aperçu mobile : logo PayPal | QR (zoom au survol) | favicon site */
.studio-preview-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.studio-preview-promo {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    margin-left: 0;
    margin-right: 0;
    padding: 0.25rem 0 0;
    box-sizing: border-box;
}

.studio-preview-promo__inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    font-size: 0.5625rem;
    line-height: 1.2;
}

.studio-preview-promo__logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0.2rem;
    border-radius: 0.35rem;
    text-decoration: none;
    color: #e2e8f0;
    transition:
        background 0.15s ease,
        transform 0.12s ease;
}

.studio-preview-promo__logo-link:hover {
    background: rgba(30, 41, 59, 0.65);
    transform: translateY(-1px);
}

.studio-preview-promo__paypal-ico {
    display: block;
    flex-shrink: 0;
}

.studio-preview-promo__logo-link--site .studio-preview-promo__site-favicon {
    display: block;
    width: 1.85rem;
    height: 1.85rem;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
}

.studio-preview-promo__logo-link--site .studio-preview-promo__site-fallback {
    display: none;
    color: #a5d8ff;
}

.studio-preview-promo__logo-link--site:has(.studio-preview-promo__site-favicon--err) .studio-preview-promo__site-favicon {
    display: none;
}

.studio-preview-promo__logo-link--site:has(.studio-preview-promo__site-favicon--err) .studio-preview-promo__site-fallback {
    display: block;
}

.studio-preview-promo__qr-wrap {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    z-index: 2;
}

.studio-preview-promo__qr-thumb {
    padding: 3px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    cursor: zoom-in;
    line-height: 0;
}

.studio-preview-promo__qr-thumb:focus-visible {
    outline: 2px solid #a5d8ff;
    outline-offset: 2px;
}

.studio-preview-promo__qr-thumb-img {
    display: block;
    width: 1.375rem;
    height: 1.375rem;
    object-fit: contain;
}

.studio-preview-promo__qr-enlarge {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 200;
    width: min(16rem, 88vmin);
    height: min(16rem, 88vmin);
    max-width: 90vw;
    max-height: 90vh;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.45);
    transform-origin: center center;
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.24s ease,
        visibility 0.22s ease;
}

.studio-preview-promo__qr-enlarge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.studio-preview-promo__qr-wrap:hover .studio-preview-promo__qr-enlarge,
.studio-preview-promo__qr-wrap:focus-within .studio-preview-promo__qr-enlarge {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

@media (max-width: 767px) {
    .toolbar-rail--left {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .toolbar-rail--left .toolbar-export-btn--rail {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 2.35rem;
    }
}

.toolbar-export-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.42rem 0.5rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(16, 185, 129, 0.55);
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #f0fdf4;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    line-height: 1.2;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.1s;
}

.toolbar-export-btn:hover {
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
    border-color: rgba(52, 211, 153, 0.8);
}

.toolbar-export-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 0.95),
        0 0 0 4px rgba(52, 211, 153, 0.5);
}

.toolbar-export-btn:active {
    transform: translateY(1px);
}

.toolbar-rail--left .toolbar-export-btn {
    padding: 0.28rem 0.38rem;
    font-size: 0.56rem;
    line-height: 1.15;
}

/* Export seul : rouge, texte blanc (Importer reste vert) */
#btn-export.toolbar-export-btn {
    border-color: rgba(185, 28, 28, 0.85);
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.28);
}

#btn-export.toolbar-export-btn:hover {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    border-color: rgba(254, 202, 202, 0.95);
    color: #ffffff;
}

#btn-export.toolbar-export-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 0.95),
        0 0 0 4px rgba(252, 165, 165, 0.7);
}

.toolbar-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.45rem 0.5rem 0.55rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(165deg,
            rgba(51, 65, 85, 0.45) 0%,
            rgba(30, 41, 59, 0.88) 100%);
    color: #f1f5f9;
    cursor: pointer;
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        transform 0.12s;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.toolbar-tile:hover {
    border-color: rgba(129, 140, 248, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.toolbar-tile:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 0.9),
        0 0 0 4px rgba(129, 140, 248, 0.55);
}

.toolbar-tile:active {
    transform: translateY(0);
}

.toolbar-tile__art {
    display: block;
    width: min(100%, 5.75rem);
    flex-shrink: 0;
}

.toolbar-tile-svg {
    display: block;
    width: 100%;
    height: auto;
}

.toolbar-tile__label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    color: #e2e8f0;
}

button.toolbar-tile {
    font: inherit;
    font-family: inherit;
    appearance: none;
    text-align: center;
}

.toolbar-tile.toolbar-tile--rail {
    padding: 0.18rem 0.32rem 0.24rem;
    gap: 0.16rem;
    border-radius: 0.55rem;
    overflow: hidden;
}

.toolbar-tile.toolbar-tile--rail .toolbar-tile__art {
    max-height: 1.42rem;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.toolbar-tile.toolbar-tile--rail .toolbar-tile-svg {
    display: block;
    height: 1.38rem;
    width: auto;
    max-width: 100%;
    flex-shrink: 1;
}

.toolbar-tile.toolbar-tile--rail .toolbar-tile__label {
    font-size: 0.56rem;
    line-height: 1.15;
}

.toolbar-rail--right .toolbar-tile__art {
    width: min(100%, 3.85rem);
    max-width: 3.85rem;
}

.toolbar-rail--right .toolbar-tile.toolbar-tile--rail .toolbar-tile__art {
    width: 100%;
    max-width: 100%;
    max-height: 1.42rem;
}

.toolbar-aside-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.toolbar-rail .toolbar-slider-compact {
    width: 100%;
}

.toolbar-slider-meta--light span:first-child {
    color: #94a3b8;
}

.toolbar-slider-meta--light span:last-child {
    color: #f8fafc;
}

.toolbar-range-input--light {
    accent-color: #818cf8;
}

.toolbar-rail--right .toolbar-range-input--light {
    height: 0.22rem;
}

.toolbar-rail--right .toolbar-slider-meta--light span:first-child {
    font-size: 0.46rem;
}

.toolbar-rail--right .toolbar-slider-meta--light span:last-child {
    font-size: 0.58rem;
}

.toolbar-rail--right .toolbar-slider-compact--aside .toolbar-slider-meta {
    margin-bottom: 0.03rem;
}

.toolbar-rail--right .toolbar-num-input {
    min-height: 1.15rem;
    padding: 0.04rem 0.22rem;
    font-size: 0.58rem;
}

.toolbar-rail--right .toolbar-img-intrinsic {
    margin: 0 0 0.04rem;
    min-height: 1.35em;
    font-size: 0.46rem;
    line-height: 1.2;
}

.toolbar-slider-meta--row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.toolbar-num-input {
    box-sizing: border-box;
    width: 3.85rem;
    max-width: 48%;
    flex-shrink: 0;
    min-height: 1.42rem;
    padding: 0.08rem 0.32rem;
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 0.32rem;
    text-align: right;
    -moz-appearance: textfield;
}

.toolbar-num-input::-webkit-outer-spin-button,
.toolbar-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.toolbar-num-input:focus {
    outline: none;
    border-color: #a5b4fc;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.3);
}

/* Champ fichier : aucun libellé navigateur visible, clic sur la tuile Logo / images */
.toolbar-file-input-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

label.toolbar-tile--image {
    position: relative;
}

.toolbar-inline-hint {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    align-self: center;
}

.toolbar-sep.toolbar-sep--narrow {
    height: 1.25rem;
    margin-left: 0.1rem;
    margin-right: 0.15rem;
}

.toolbar-cell-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.22rem;
    max-width: 100%;
}

.toolbar-cell-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-end;
    width: 100%;
}

.toolbar-cell-form__row--border {
    gap: 0.35rem 0.5rem;
    align-items: flex-end;
}

.toolbar-cell-border-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    flex-shrink: 0;
}

.toolbar-group-row--tableinsert {
    align-items: center;
}

/* Aération : bloc Tableau / espace / séparateurs pas collé au bord de la colonne */
.toolbar-group--table-sep {
    padding-left: 0.45rem;
    padding-right: 0.1rem;
    margin-top: 0.08rem;
}

.toolbar-group--table-sep>.toolbar-group-label {
    margin-bottom: 0.06rem;
}

.toolbar-group--table-sep .toolbar-group-row--tableinsert {
    gap: 0.55rem 0.85rem !important;
    padding-top: 0.06rem;
}

.toolbar-unified-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.4rem;
    align-items: center;
}

.toolbar-unified-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: #e2e8f0;
}

.toolbar-unified-radio input {
    margin: 0;
}

.toolbar-group--unified-borders {
    margin-top: 0.12rem;
}

.toolbar-group--table-sep .toolbar-sep-adv {
    margin-top: 0.38rem;
    padding-top: 0.38rem;
}

.toolbar-sep-adv {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    width: 100%;
    margin-top: 0.28rem;
    padding-top: 0.28rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.toolbar-sep-adv__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.3rem 0.45rem;
    width: 100%;
}

.toolbar-sep-adv__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    flex-shrink: 0;
}

.toolbar-sep-adv__kicker {
    flex: 1 1 100%;
    font-size: 0.52rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

@media (min-width: 720px) {
    .toolbar-sep-adv__kicker {
        flex: 0 0 auto;
        width: 5.5rem;
        align-self: flex-end;
        margin-bottom: 0.2rem;
        margin-right: 0.15rem;
    }
}

.toolbar-sep-adv__field {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    align-items: flex-start;
}

.toolbar-sep-adv__f {
    font-size: 0.52rem;
    font-weight: 600;
    color: #64748b;
}

.toolbar-num-input--sep {
    box-sizing: border-box;
    min-width: 2.35rem;
    width: 2.55rem;
    max-width: 100%;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
}

input[type="color"].toolbar-color--sep {
    width: 1.85rem;
    height: 1.85rem;
    padding: 2px;
    border: 1px solid #cbd5e1;
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.toolbar-table-insert-wrap {
    position: relative;
    display: inline-block;
}

.toolbar-btn-table-grid {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding-left: 0.42rem !important;
    padding-right: 0.48rem !important;
}

.toolbar-btn-table-grid__icon {
    display: flex;
    color: #e2e8f0;
    line-height: 0;
}

.toolbar-btn-table-grid__txt {
    font-size: 0.68rem;
    font-weight: 600;
}

.table-grid-popover {
    position: absolute;
    z-index: 80;
    left: 0;
    top: calc(100% + 4px);
    padding: 0.45rem 0.5rem;
    min-width: 12rem;
    background: linear-gradient(165deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.65);
    border-radius: 0.45rem;
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.28),
        0 0 0 1px rgba(15, 23, 42, 0.06);
}

.table-grid-popover__hint {
    margin: 0 0 0.35rem;
    font-size: 0.52rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.3;
}

.table-grid-popover__hint strong {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.table-grid-selector {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-grid-row {
    display: flex;
    flex-direction: row;
    gap: 2px;
}

.table-grid-cell {
    box-sizing: border-box;
    width: 15px;
    height: 15px;
    margin: 0;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

.table-grid-cell:hover,
.table-grid-cell:focus-visible {
    border-color: #94a3b8;
    outline: none;
}

.table-grid-cell--in {
    background: #6366f1;
    border-color: #4f46e5;
}

.toolbar-cell-form__row--cellw {
    width: 100%;
    flex-wrap: wrap;
}

.toolbar-cell-size-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    width: 100%;
    min-width: 0;
}

.toolbar-cell-size-controls {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
}

.toolbar-num-input--cellw {
    max-width: 100%;
    width: 100%;
}

.toolbar-range-input--cellw {
    width: 100%;
}

.toolbar-cell-hint {
    font-size: 0.52rem;
    font-weight: 600;
    line-height: 1.25;
    color: #64748b;
    max-width: 100%;
}

.toolbar-img-intrinsic {
    margin: 0 0 0.12rem;
    padding: 0 0.05rem;
    font-size: 0.52rem;
    font-weight: 600;
    line-height: 1.3;
    color: #94a3b8;
    min-height: 2.2em;
}

.toolbar-cell-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.toolbar-cell-label-text {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
}

.toolbar-cell-field--color {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
}

.toolbar-cell-field--color .toolbar-cell-label-text {
    white-space: nowrap;
}

.toolbar-cell-field--color .toolbar-color {
    flex-shrink: 0;
}

.toolbar-select--cell {
    min-width: 5.5rem;
    max-width: min(10rem, 32vw);
}

.toolbar-strip .toolbar-select.toolbar-select--cell {
    padding-right: 1.35rem !important;
    font-size: 0.65rem !important;
    min-height: 1.45rem;
}

.toolbar-main-surface {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
}

.toolbar-strip--embedded {
    flex: 1 1 auto;
    border-bottom: none;
    min-height: 0;
}

.toolbar-main-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.25rem 0.45rem;
    padding: 0.15rem clamp(0.3rem, 1vw, 0.5rem);
    padding-left: calc(clamp(0.3rem, 1vw, 0.5rem) + env(safe-area-inset-left, 0px));
    padding-right: calc(clamp(0.3rem, 1vw, 0.5rem) + env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}

.toolbar-main-grid__col {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    flex: 1 1 0;
    min-width: 0;
}

/* Au-dessus des libellés « Police & taille » et « Tableau & espacement » uniquement */
.toolbar-strip--embedded .toolbar-main-grid__col > .toolbar-group:first-child {
    padding-top: 0.5rem;
}

@media (max-width: 520px) {
    .toolbar-main-grid {
        flex-wrap: wrap;
    }

    .toolbar-main-grid__col {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
    min-width: 0;
}

.toolbar-main-grid__col .toolbar-group--grow {
    flex: 0 0 auto;
}

.toolbar-group--wide {
    width: 100%;
    flex: 0 0 auto;
}

.toolbar-group-label {
    font-size: 0.42rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.2;
}

.toolbar-group-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
}

.toolbar-group-row--wrap {
    flex-wrap: wrap;
}

.toolbar-group-row--align-end {
    align-items: flex-end;
}

.toolbar-select--wide {
    min-width: 0;
    flex: 1 1 auto;
    max-width: min(16rem, 100%);
}

.toolbar-select--lead {
    min-width: 6.5rem;
    max-width: min(11rem, 100%);
}

.toolbar-lead-compact {
    margin-top: 0.28rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toolbar-lead-kicker {
    font-size: 0.46rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.2;
}

.toolbar-lead-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    width: 100%;
}

.toolbar-btn-lh {
    min-width: 2rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.toolbar-lead-hint {
    font-size: 0.56rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
    flex: 1 1 auto;
    min-width: 0;
}

.toolbar-group-row--colors-style {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
}

.toolbar-sep--style {
    margin-left: 0.1rem;
    margin-right: 0.15rem;
}

/* Barre de formatage — cases claires + texte couleur fond app (#0f172a) */

.toolbar-slider-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.56rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.12rem;
}

.toolbar-slider-meta span:last-child {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.toolbar-range-input {
    width: 100%;
    height: 0.375rem;
    accent-color: #0f172a;
    cursor: pointer;
}

.toolbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    min-height: 1.45rem;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 0;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition:
        background 0.15s,
        border-color 0.15s;
}

.toolbar-icon-btn__svg {
    display: block;
    flex-shrink: 0;
}

.toolbar-icon-btn--check {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.toolbar-icon-btn--check:hover {
    background: #bbf7d0;
    border-color: #4ade80;
}

.toolbar-icon-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.toolbar-strip--embedded .toolbar-icon-btn,
.toolbar-strip--embedded input[type="color"].toolbar-color--cell-inline,
.toolbar-strip--embedded input[type="color"].toolbar-color--sep-inline {
    width: 1.45rem !important;
    height: 1.45rem !important;
    min-height: 1.45rem !important;
}

.toolbar-strip--embedded input[type="color"].toolbar-color--cell-inline,
.toolbar-strip--embedded input[type="color"].toolbar-color--sep-inline {
    padding: 1px !important;
}

.toolbar-icon-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px #0f172a;
}

button.toolbar-icon-btn {
    font-family: inherit;
}

/* Dialogue import HTML */
.import-dialog {
    padding: 0;
    border: none;
    border-radius: 0.85rem;
    max-width: min(560px, 94vw);
    background: transparent;
    box-shadow: none;
}

.import-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.import-dialog-panel {
    background: #f8fafc;
    padding: 1.1rem 1.25rem;
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

.import-dialog-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.import-dialog-hint {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.import-dialog-textarea {
    width: 100%;
    min-height: 12rem;
    box-sizing: border-box;
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #0f172a;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    resize: vertical;
}

.import-dialog-textarea:focus {
    outline: none;
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.import-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.import-dialog-btn {
    border-radius: 0.45rem;
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
}

.import-dialog-btn--ghost {
    background: #fff;
    border-color: #cbd5e1;
    color: #334155;
}

.import-dialog-btn--ghost:hover {
    background: #f1f5f9;
}

.import-dialog-btn--primary {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.import-dialog-btn--primary:hover {
    background: #4338ca;
}

.toolbar-strip {
    flex-shrink: 0;
    padding: 0;
    border-bottom: 1px solid #cbd5e1;
    background: linear-gradient(180deg, #f8fafc 0%, #e8edf3 100%);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    color: #0f172a;
}

.toolbar-strip--embedded .toolbar-btn,
.toolbar-strip--embedded .toolbar-select {
    min-height: 1.32rem !important;
    padding-top: 0.06rem !important;
    padding-bottom: 0.06rem !important;
    font-size: 0.62rem !important;
}

.toolbar-strip--embedded .toolbar-num-input {
    min-height: 1.45rem !important;
    padding-top: 0.08rem !important;
    padding-bottom: 0.08rem !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.toolbar-strip--embedded .toolbar-num-input.toolbar-num-input--cell-edge {
    width: 4.35rem !important;
    min-width: 4.35rem !important;
    max-width: none !important;
    flex-shrink: 0;
    padding-left: 0.3rem !important;
    padding-right: 0.3rem !important;
    box-sizing: border-box;
}

.toolbar-strip .toolbar-select,
.toolbar-strip .toolbar-btn {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    min-height: 2rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.toolbar-strip .toolbar-select {
    padding-right: 1.65rem;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%230f172a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E"),
        linear-gradient(#ffffff, #ffffff) !important;
    background-repeat: no-repeat !important;
    background-position:
        right 0.35rem center,
        0 0 !important;
    background-size:
        1rem 1rem,
        auto !important;
}

.toolbar-strip .toolbar-select:hover,
.toolbar-strip .toolbar-btn:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.toolbar-strip .toolbar-btn:active {
    background-color: #e2e8f0 !important;
}

.toolbar-strip .toolbar-btn.toolbar-btn--state-on,
.toolbar-strip--embedded .toolbar-btn.toolbar-btn--state-on {
    background-color: #e0e7ff !important;
    border-color: #6366f1 !important;
    color: #312e81 !important;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.toolbar-spacer-insert-wrap {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.toolbar-spacer-insert-label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.1rem;
    margin: 0;
    cursor: default;
}

.toolbar-spacer-insert-label__txt {
    font-size: 0.55rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.04em;
}

.toolbar-strip--embedded .toolbar-num-input.toolbar-num-input--spacer-px {
    width: 3.15rem !important;
    min-width: 3.15rem !important;
    max-width: 3.6rem !important;
}

.toolbar-strip .toolbar-num-input.toolbar-num-input--spacer-px {
    width: 3.25rem;
    min-width: 3.25rem;
    max-width: 3.75rem;
}

.toolbar-strip option {
    background-color: #ffffff;
    color: #0f172a;
}

.toolbar-strip input[type="color"].toolbar-color {
    width: 2.15rem;
    height: 2.15rem;
    padding: 2px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0;
    background-color: #ffffff !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.toolbar-strip .toolbar-sep {
    width: 1px;
    height: 1.5rem;
    background-color: #94a3b8;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

.toolbar-strip .toolbar-btn b,
.toolbar-strip .toolbar-btn i,
.toolbar-strip .toolbar-btn u,
.toolbar-strip .toolbar-btn span {
    color: inherit !important;
}

.toolbar-strip::-webkit-scrollbar {
    height: 8px;
}

.toolbar-strip::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.toolbar-strip::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.toolbar-row-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    margin-right: 0.15rem;
}

.toolbar-field-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: text;
}

.toolbar-inline-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.toolbar-strip .toolbar-field {
    appearance: none;
    box-sizing: border-box;
    min-height: 2rem;
    margin: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.25;
    color: #0f172a !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    min-width: 4.25rem;
    width: 6.5rem;
    max-width: 8rem;
}

.toolbar-strip .toolbar-field.toolbar-field-wide {
    width: auto;
    min-width: 9rem;
    max-width: min(14rem, 28vw);
}

.toolbar-strip .toolbar-field::placeholder {
    color: #64748b;
    opacity: 1;
    font-weight: 400;
}

.toolbar-strip .toolbar-field:hover {
    border-color: #94a3b8 !important;
}

.toolbar-strip .toolbar-field:focus {
    outline: none;
    border-color: #0f172a !important;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15);
}

.toolbar-strip .toolbar-btn-compact {
    padding-left: 0.42rem !important;
    padding-right: 0.42rem !important;
    font-size: 0.7rem !important;
}

.toolbar-strip .toolbar-btn.toolbar-btn-primary {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    font-weight: 600;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.toolbar-strip .toolbar-btn.toolbar-btn-primary:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}

.toolbar-strip .toolbar-btn.toolbar-btn-primary:active {
    background: #0f172a !important;
    color: #ffffff !important;
}

.editor-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0.5rem;
    background: linear-gradient(180deg,
            rgba(51, 65, 85, 0.22),
            rgba(15, 23, 42, 0.72));
}

@media (min-width: 900px) {
    .editor-stage {
        padding: 0.55rem 0.65rem;
    }
}

.editor-card {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    border-radius: 0;
    border: 2px solid rgba(148, 163, 184, 0.4);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.2);
    background: #ffffff;
    overflow: hidden;
}

.editor-card__ribbon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(90deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.02em;
}

.editor-card__ribbon span.meta {
    font-weight: 500;
    color: #64748b;
}

@media (max-width: 480px) {
    .editor-card__ribbon span.meta {
        display: none;
    }
}

#sig-editor {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Contenu édité : noir sur fond blanc (indépendant du text-white du body) */
#sig-editor.sig-editor-surface {
    color: #111827 !important;
    font-family: Arial, Helvetica, sans-serif;
}

.sig-editor-default-leading {
    line-height: 1.45;
}

#sig-editor.sig-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: #64748b;
    pointer-events: none;
}

#sig-editor:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--focus-editor);
}

#sig-editor table {
    border-collapse: collapse;
    table-layout: auto;
}

/* Tableaux insérés depuis la grille : largeur au plus juste selon le contenu */
#sig-editor table[data-sig-table="flow"] {
    table-layout: auto;
    width: auto;
    max-width: 100%;
}

#sig-editor img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Éditeur seulement : redimensionnement horizontal de cellule (non repris à l’identique dans tous les webmails) */
#sig-editor.sig-editor-surface table[role="presentation"] {
    max-width: 100%;
}

#sig-editor.sig-editor-surface table[role="presentation"] td,
#sig-editor.sig-editor-surface table[role="presentation"] th {
    box-sizing: border-box;
    min-width: 28px;
    overflow: auto;
    resize: horizontal;
    /* Repère visuel éditeur seulement (non présent dans le fichier HTML exporté) */
    outline: 1px solid rgba(203, 213, 225, 0.5);
    outline-offset: -1px;
}

/* Cellule cible « Bordures & dimensions » : contour gris un peu plus marqué (éditeur seulement) */
#sig-editor.sig-editor-surface table[role="presentation"] td.sig-cell-toolbar-active,
#sig-editor.sig-editor-surface table[role="presentation"] th.sig-cell-toolbar-active {
    outline: 1px solid rgb(148, 163, 184) !important;
    outline-offset: -1px !important;
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.28);
}

.panel-scroll {
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

.panel-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.panel-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}