/* ================================================================
   Theme Mobile Modern — MasterPaint
   Design : épuré, inspiré iOS 26, sans liquid glass
   Actif uniquement quand body.illu-mobile-shell-active est présent
   Compatible iOS Safari / Android Chrome
   ================================================================ */

/* ——————————————————————————————————————————————
   KEYFRAMES
   —————————————————————————————————————————————— */

@keyframes mob-sheet-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes mob-dock-btn-enter {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

@keyframes mob-fade-up {
    from { transform: translateY(6px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}


/* ================================================================
   HIÉRARCHIE DES RAYONS (système cohérent)

   --mob-r-xs  : 4px   → inputs, selects, petits contrôles
   --mob-r-sm  : 8px   → cards compactes, badges
   --mob-r-md  : 12px  → cards standards, list items
   --mob-r-lg  : 16px  → sheets, modales, drawer
   --mob-r-pill: 100px → pilule active du dock, bouton Fermer, swaps
   ================================================================ */


/* ================================================================
   VARIABLES — MODE CLAIR
   ================================================================ */

body.illu-mobile-shell-active {
    /* Kill les bordures 3D Win98 */
    --mp-raised-top: transparent;
    --mp-raised-bot: transparent;
    --mp-inset-top:  transparent;
    --mp-inset-bot:  transparent;
    /* Surfaces */
    --mp-surface:      #f2f2f7;
    --mp-surface-deep: #e5e5ea;
    --mp-dock-bg:      rgba(242, 242, 247, 0.88);
    --mp-dock-border:  rgba(0, 0, 0, 0.10);
    --mp-text:         #1a1a1a;
    --mp-radius:       8px;

    /* Rayons hiérarchiques */
    --mob-r-xs:   4px;
    --mob-r-sm:   8px;
    --mob-r-md:   12px;
    --mob-r-lg:   16px;
    --mob-r-pill: 100px;

    /* Typographie système */
    --mob-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
                Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Timing */
    --mob-spring:   cubic-bezier(0.34, 1.20, 0.64, 1);
    --mob-ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --mob-dur-xs:   100ms;
    --mob-dur-sm:   180ms;
    --mob-dur-md:   260ms;

    /* Ombres (légères, hiérarchisées) */
    --mob-shadow-card:  0 1px 3px rgba(0,0,0,0.09), 0 1px 2px rgba(0,0,0,0.05);
    --mob-shadow-sheet: 0 -2px 12px rgba(0,0,0,0.12), 0 -1px 4px rgba(0,0,0,0.06);
    --mob-shadow-dock:  0 -1px 0 rgba(0,0,0,0.09), 0 -4px 16px rgba(0,0,0,0.08);

    /* Couleurs sémantiques */
    --mob-accent-tint:    rgba(13, 122, 122, 0.12);
    --mob-accent-tint2:   rgba(13, 122, 122, 0.20);
    --mob-accent-pill:    rgba(13, 122, 122, 0.14);  /* pilule dock active */
    --mob-divider:        rgba(0, 0, 0, 0.08);
    --mob-pressed:        rgba(0, 0, 0, 0.06);
    --mob-card-bg:        rgba(255, 255, 255, 0.80);
    --mob-card-bg-active: rgba(255, 255, 255, 0.95);

    /* Blur modéré (pas liquid glass) */
    --mob-blur-dock:  blur(20px) saturate(160%);
    --mob-blur-sheet: blur(24px) saturate(150%);
    --mob-blur-bar:   blur(18px) saturate(150%);

    /* Hauteur de la top bar (utilisée pour positionner la options-row fixe) */
    --mob-topbar-h: 48px;

    /* Recalibrer le dock-h pour le dock flottant (+4px en bas + 4px gap dessus) */
    --illu-mobile-dock-h: 41px;

    /* Accent foncé dérivé de la couleur d'accent utilisateur (top bar, sheets) */
    --mob-accent-dark: color-mix(in srgb, var(--mp-accent, #0d7a7a) 62%, black 38%);

    font-family: var(--mob-font);
}

/* ================================================================
   VARIABLES — MODE SOMBRE
   ================================================================ */

body.illu-mobile-shell-active.theme-dark {
    --mp-surface:      #1c1c1e;
    --mp-surface-deep: #2c2c2e;
    --mp-dock-bg:      rgba(28, 28, 30, 0.90);
    --mp-dock-border:  rgba(255, 255, 255, 0.08);
    --mp-text:         #f2f2f7;

    --mob-accent-tint:    rgba(13, 122, 122, 0.18);
    --mob-accent-tint2:   rgba(13, 122, 122, 0.28);
    --mob-accent-pill:    rgba(13, 122, 122, 0.22);
    --mob-divider:        rgba(255, 255, 255, 0.09);
    --mob-pressed:        rgba(255, 255, 255, 0.06);
    --mob-card-bg:        rgba(44, 44, 46, 0.85);
    --mob-card-bg-active: rgba(58, 58, 60, 0.95);

    --mob-shadow-card:  0 1px 4px rgba(0,0,0,0.30), 0 1px 2px rgba(0,0,0,0.20);
    --mob-shadow-sheet: 0 -2px 12px rgba(0,0,0,0.40), 0 -1px 4px rgba(0,0,0,0.25);
    --mob-shadow-dock:  0 -1px 0 rgba(255,255,255,0.05), 0 -4px 16px rgba(0,0,0,0.35);
}


/* ================================================================
   BARRE DU HAUT — burger | titre+résolution | branding
   ================================================================ */

body.illu-mobile-shell-active #illu-mobile-top-bar {
    background: var(--mob-accent-dark, #054b4b) !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.20) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0 8px 0 0 !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    min-height: 48px;
}

/* Burger gauche */
.illu-mobile-top-bar__burger {
    flex: 0 0 auto;
    min-width: 48px;
    height: 48px;
    padding: 0 10px;
    gap: 6px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 18px;
    -webkit-tap-highlight-color: transparent !important;
    transition: background var(--mob-dur-xs) var(--mob-ease-out),
                transform  var(--mob-dur-xs) var(--mob-ease-out) !important;
    cursor: pointer;
}

.illu-mobile-top-bar__burger i {
    color: rgba(255, 255, 255, 0.92) !important;
}

.illu-mobile-top-bar__burger-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.illu-mobile-top-bar__burger:active {
    background: rgba(255, 255, 255, 0.14) !important;
    transform: scale(0.90) !important;
}

/* Zone titre + résolution (centre, flex) */
.illu-mobile-top-bar__title-area {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    text-align: center !important;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    padding: 6px 8px !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    transition: background var(--mob-dur-xs) var(--mob-ease-out) !important;
    border-radius: var(--mob-r-xs) !important;
}

.illu-mobile-top-bar__title-area:active {
    background: rgba(255, 255, 255, 0.10) !important;
}

.illu-mobile-top-bar__title-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    color: #fff !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.illu-mobile-top-bar__title-res {
    font-size: 10px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.60) !important;
    letter-spacing: 0.01em !important;
    display: block;
    line-height: 1.2;
}

/* Branding droite */
.illu-mobile-top-bar__brand {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    padding: 4px 0;
    user-select: none;
}

.illu-mobile-top-bar__brand-name {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-transform: uppercase;
}

.illu-mobile-top-bar__brand-by {
    font-size: 9px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.50);
    letter-spacing: 0.01em;
    line-height: 1.2;
}


/* ================================================================
   RANGÉE OPTIONS : capsule undo/redo + tool-options-container
   ================================================================ */

/* Mode desktop : wrapper neutre — disparaît du layout pour ne pas perturber le bureau */
.illu-mob-options-row {
    display: contents;
}

/* Capsule cachée hors mobile */
.illu-mob-undo-redo {
    display: none;
}

/* En mode mobile shell : barre flottante au-dessus du workspace */
body.illu-mobile-shell-active .illu-mob-options-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    /* Flottante */
    position: fixed !important;
    top: calc(var(--mob-topbar-h, 48px) + env(safe-area-inset-top, 0px) + 4px) !important;
    left: 4px !important;
    right: 4px !important;
    z-index: 3500 !important;
    gap: 6px !important;
}

/* La capsule undo/redo */
body.illu-mobile-shell-active .illu-mob-undo-redo {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    background: color-mix(in srgb, var(--mp-accent, #806020) 6%, #ffffff) !important;
    gap: 0 !important;
    padding: 3px 4px 3px 3px !important;
    border-radius: 10px !important;
    -webkit-backdrop-filter: var(--mob-blur-bar);
    backdrop-filter: var(--mob-blur-bar);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06) !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mob-undo-redo {
    background: color-mix(in srgb, var(--mp-accent, #806020) 8%, #1c1c1e) !important;
}

.illu-mob-undo-redo__btn {
    flex: 1 1 auto;
    width: 100%;
    border: none !important;
    background: transparent !important;
    color: var(--mp-accent, #0d7a7a) !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    transition: background var(--mob-dur-xs) var(--mob-ease-out),
                transform  var(--mob-dur-xs) var(--mob-spring) !important;
    border-radius: var(--mob-r-xs) !important;
    margin: 2px !important;
}

.illu-mob-undo-redo__btn:active {
    background: var(--mob-accent-tint2) !important;
    transform: scale(0.86) !important;
}

.illu-mob-undo-redo__btn:disabled,
.illu-mob-undo-redo__btn[disabled] {
    color: rgba(0, 0, 0, 0.22) !important;
    cursor: default !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mob-undo-redo__btn:disabled,
body.illu-mobile-shell-active.theme-dark .illu-mob-undo-redo__btn[disabled] {
    color: rgba(255, 255, 255, 0.22) !important;
}

/* Séparateur entre undo et redo */
.illu-mob-undo-redo__sep {
    flex: 0 0 1px;
    width: calc(100% - 10px);
    height: 1px;
    background: var(--mob-divider);
    display: block;
    margin: 0 5px;
}

/* tool-options-container : flex enfant qui prend le reste */
body.illu-mobile-shell-active #tool-options-container {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    /* Pas de wrapping : le ribbon overflow gère la compression */
    flex-wrap: nowrap !important;
    align-items: center !important;
    border-radius: 10px !important;
    background: rgba(242, 242, 247, 0.84) !important;
    -webkit-backdrop-filter: var(--mob-blur-bar);
    backdrop-filter: var(--mob-blur-bar);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06) !important;
}

body.illu-mobile-shell-active.theme-dark #tool-options-container {
    background: rgba(28, 28, 30, 0.88) !important;
    box-shadow: 0 2px 14px rgba(0,0,0,0.40), 0 1px 4px rgba(0,0,0,0.20) !important;
}

/* ================================================================
   SÉLECTEUR D'OUTIL MOBILE — pastille rétractable
   Masque le groupe ruban « Outil » + le bouton dock « Outils » et les
   remplace par une pastille glissable dans la rangée d'options.
   ================================================================ */

/* Masque le groupe « Outil » du ruban en mode téléphone */
body.illu-mobile-shell-active #tool-options-container
    > .illu-ribbon-group[data-illu-ribbon-group="tool"] {
    display: none !important;
}

/* Masque le bouton dock « Outils » (remplacé par la pastille) */
body.illu-mobile-shell-active .illu-mobile-dock-btn[data-illu-mobile-dock="tools"] {
    display: none !important;
}

/* Conteneur de la pastille : ancré sous la rangée d'options, à gauche,
   avec le même style visuel que .illu-mobile-dock-top-group--right */
.illu-mob-tool-switch {
    display: none;
}

body.illu-mobile-shell-active .illu-mob-tool-switch:not([hidden]) {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--illu-mobile-dock-bg, var(--mp-dock-bg, #c0c0c0));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    z-index: 6;
}

/* Bouton-pastille : icône outil courant + chevron (style bouton dock) */
.illu-mob-tool-switch__toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 28px;
    padding: 0 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--mp-accent, #0d7a7a);
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
    transition: transform var(--mob-dur-xs) var(--mob-spring),
                background var(--mob-dur-xs) var(--mob-ease-out);
}

.illu-mob-tool-switch__toggle:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.08);
}

.illu-mob-tool-switch__cur {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 15px;
    color: var(--mp-accent, #0d7a7a);
}

.illu-mob-tool-switch__cur i,
.illu-mob-tool-switch__cur svg {
    width: 16px;
    height: 16px;
    font-size: 15px;
}

.illu-mob-tool-switch__chevron {
    font-size: 10px;
    opacity: 0.7;
    transition: transform var(--mob-dur-sm, 0.2s) var(--mob-ease-out, ease);
}

/* Chevron « > » → « < » lorsqu'on est déployé */
.illu-mob-tool-switch[data-expanded="true"] .illu-mob-tool-switch__chevron {
    transform: rotate(180deg);
    opacity: 0.95;
}

/* Liste glissable : ancrée à droite de la pastille, se déploie vers la droite */
.illu-mob-tool-switch__list {
    position: absolute;
    left: 100%;
    top: 0;
    bottom: 0;
    margin-left: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    max-width: 0;
    opacity: 0;
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: none;
    border-radius: 10px;
    background: var(--illu-mobile-dock-bg, var(--mp-dock-bg, #c0c0c0));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    scrollbar-width: none;
    transition: max-width var(--mob-dur-md, 0.28s) var(--mob-spring, cubic-bezier(.2,.8,.2,1)),
                opacity var(--mob-dur-sm, 0.2s) var(--mob-ease-out, ease),
                padding var(--mob-dur-md, 0.28s) var(--mob-spring, cubic-bezier(.2,.8,.2,1));
}

.illu-mob-tool-switch__list::-webkit-scrollbar {
    display: none;
}

.illu-mob-tool-switch[data-expanded="true"] .illu-mob-tool-switch__list {
    /* Largeur dispo : tout l'écran sauf la pastille et les marges */
    max-width: calc(100vw - 80px);
    opacity: 1;
    pointer-events: auto;
}

/* Items d'outil dans la liste */
.illu-mob-tool-switch__item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--mp-accent, #0d7a7a);
    font-size: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--mob-dur-xs) var(--mob-ease-out),
                transform var(--mob-dur-xs) var(--mob-spring);
}

.illu-mob-tool-switch__item i,
.illu-mob-tool-switch__item svg {
    width: 18px;
    height: 18px;
    font-size: 15px;
}

.illu-mob-tool-switch__item:active {
    transform: scale(0.86);
    background: var(--mob-accent-tint2, rgba(0,0,0,0.06));
}

.illu-mob-tool-switch__item.is-active {
    background: var(--mp-accent, #806020);
    color: #fff;
}

/* Les barres internes : no-wrap aussi */
body.illu-mobile-shell-active #tool-options-bar-row1 {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
}

body.illu-mobile-shell-active #tool-options-bar-2 {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
}


/* ================================================================
   PALETTE DOCK GAUCHE — masqué en mode téléphone (inutile)
   ================================================================ */

body.illu-mobile-shell-active #palette-dock-left {
    display: none !important;
    visibility: hidden !important;
}

/* Palette Dock Droite — masquée en mode téléphone également */
body.illu-mobile-shell-active #palette-dock-right {
    display: none !important;
    visibility: hidden !important;
}


/* ================================================================
   DOCK BAS — BARRE DE NAVIGATION iOS 26
   Structure : barre semi-transparente + pilule sur l'item actif
   ================================================================ */

/* Status bar desktop — inutile en mobile */
body.illu-mobile-shell-active #app-status-bar {
    display: none !important;
}



/* Zone de scroll : ne force pas l'expansion */
body.illu-mobile-shell-active .illu-mobile-dock-scroll {
background: rgba(242, 242, 247, 0.84) !important;
    flex: 0 0 auto !important;
    gap: 2px !important;
    padding: 5px 6px !important;
    align-items: center !important;
    max-width: calc(100vw - 8px) !important;
    overflow-x: auto !important;
    border-radius: 10px;
        -webkit-backdrop-filter: var(--mob-blur-bar);
    backdrop-filter: var(--mob-blur-bar);
margin: 0 8px 10px 8px;
    height: 55px;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease,
                margin 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* ——— BOUTONS DOCK ——— */

.illu-mobile-dock-btn {
    flex: 0 0 58px !important;
    min-width: 35px !important;
min-height: 35px !important;

    border: none !important;
    border-radius: var(--mob-r-md) !important;
    background: transparent !important;
    color: var(--mp-text) !important;
    gap: 3px !important;
    padding: 6px 3px !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background  var(--mob-dur-xs) var(--mob-ease-out),
        transform   var(--mob-dur-xs) var(--mob-spring) !important;
    position: relative !important;
}

/* Icônes en noir (clair) / blanc (sombre) — plus de gris */
.illu-mobile-dock-btn i {
    font-size: 20px !important;
    color: rgba(0, 0, 0, 0.82) !important;
    transition: color var(--mob-dur-xs) var(--mob-ease-out) !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-dock-btn i {
    color: rgba(255, 255, 255, 0.88) !important;
}

.illu-mobile-dock-btn span,
.illu-mobile-dock-btn > *:not(i) {
    font-size: 10px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.01em !important;
    color: rgba(0, 0, 0, 0.65) !important;
    transition: color var(--mob-dur-xs) var(--mob-ease-out) !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-dock-btn span,
body.illu-mobile-shell-active.theme-dark .illu-mobile-dock-btn > *:not(i) {
    color: rgba(255, 255, 255, 0.70) !important;
}

/* Pilule active — l'item actif reçoit un fond teinté + icon/label colorés */
.illu-mobile-dock-btn[aria-pressed="true"] {
    background: var(--mob-accent-pill) !important;
}

.illu-mobile-dock-btn[aria-pressed="true"] i {
    color: var(--mp-accent, #0d7a7a) !important;
}

.illu-mobile-dock-btn[aria-pressed="true"] span,
.illu-mobile-dock-btn[aria-pressed="true"] > *:not(i) {
    color: var(--mp-accent, #0d7a7a) !important;
    font-weight: 600 !important;
}

/* Pression tactile */
.illu-mobile-dock-btn:active {
    transform: scale(0.87) !important;
    background: var(--mob-pressed) !important;
}

/* Animation d'entrée en cascade */
.illu-mobile-dock-btn:nth-child(1) { animation: mob-dock-btn-enter 180ms var(--mob-ease-out)  0ms  both; }
.illu-mobile-dock-btn:nth-child(2) { animation: mob-dock-btn-enter 180ms var(--mob-ease-out) 25ms  both; }
.illu-mobile-dock-btn:nth-child(3) { animation: mob-dock-btn-enter 180ms var(--mob-ease-out) 50ms  both; }
.illu-mobile-dock-btn:nth-child(4) { animation: mob-dock-btn-enter 180ms var(--mob-ease-out) 75ms  both; }
.illu-mobile-dock-btn:nth-child(5) { animation: mob-dock-btn-enter 180ms var(--mob-ease-out) 100ms both; }
.illu-mobile-dock-btn:nth-child(n+6) { animation: mob-dock-btn-enter 180ms var(--mob-ease-out) 125ms both; }


/* ================================================================
   BOTTOM SHEETS
   ================================================================ */

.illu-mobile-sheet-backdrop {
    background: rgba(0, 0, 0, 0) !important;
    transition: opacity var(--mob-dur-md) var(--mob-ease-out) !important;
}

.illu-mobile-sheet {
    background: var(--mp-surface, #f2f2f7) !important;
    border: none !important;
    border-radius: var(--mob-r-lg)  !important;
    box-shadow: var(--mob-shadow-sheet) !important;
    transition: transform var(--mob-dur-md) var(--mob-spring) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.illu-mobile-shell-active .title-bar {
    display: none !important;
}
/* Poignée (handle) */
body.illu-mobile-shell-active .illu-mobile-sheet::before, body.illu-mobile-shell-active .floating-window:not(.palette-panel)::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.14);
    margin: 4px auto 5px;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-sheet::before {
    background: rgba(255, 255, 255, 0.18);
}

.illu-mobile-top-bar__burger i.fa-solid {
    padding-left: 5px !important;
    padding-right: 5px !important;
}

body.illu-mobile-shell-active .window,
body.illu-mobile-shell-active .welcome-dialog-window,
body.illu-mobile-shell-active .floating-window,
body.illu-mobile-shell-active .illu-instant-effect-busy__box {
    border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;

}

body.illu-mobile-shell-active .window-body, 
body.illu-mobile-shell-active .status-bar, 
body.illu-mobile-shell-active .illu-cr-foot {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius);
    border-top-left-radius: var(--radius);
}

/* Header des sheets masqué — handle + footer Fermer suffisent */
body.illu-mobile-shell-active .illu-mobile-sheet__head {
    display: none !important;
}

/* Corps de la sheet */
.illu-mobile-sheet__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    background: transparent !important;
}


/* ================================================================
   FOOTER FERMER — bouton en bas des sheets
   ================================================================ */

.illu-mobile-sheet__foot {
    flex-shrink: 0;
    padding: 8px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--mob-divider);
    background: var(--mp-surface, #f2f2f7);
    display: flex;
    justify-content: center;
}

.illu-mobile-sheet__foot-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    min-height: 46px;
    border: none !important;
    border-radius: var(--mob-r-pill) !important;
    background: var(--mob-accent-tint2) !important;
    color: var(--mp-accent, #0d7a7a) !important;
    font-family: var(--mob-font) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-sheet__foot {
    background: var(--mp-surface, #1c1c1e);
    border-top-color: var(--mob-divider);
}

.illu-mobile-sheet__foot-close:active {
    transform: scale(0.96) !important;
    background: var(--mob-accent-tint) !important;
}


/* ================================================================
   GRILLE D'OUTILS dans la sheet tools
   ================================================================ */

body.illu-mobile-shell-active #illu-mobile-sheet-tools-body .tool-btn {
    border: none !important;
    border-radius: var(--mob-r-sm) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: var(--mob-shadow-card) !important;
    color: var(--mp-text) !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-tools-body .tool-btn[aria-pressed="true"],
body.illu-mobile-shell-active #illu-mobile-sheet-tools-body .tool-btn.is-active,
body.illu-mobile-shell-active #illu-mobile-sheet-tools-body .tool-btn.tool-btn--active {
    background: var(--mob-accent-tint2) !important;
    box-shadow: none !important;
    color: var(--mp-accent, #0d7a7a) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-tools-body .tool-btn:active {
    transform: scale(0.89) !important;
    background: var(--mob-pressed) !important;
    box-shadow: none !important;
}

/* Label outil actif */
body.illu-mobile-shell-active #illu-mobile-active-tool-lbl:not([hidden]) {
    background: var(--mob-accent-tint) !important;
    border: 1px solid var(--mob-divider) !important;
    border-radius: var(--mob-r-sm) !important;
    color: var(--mp-accent, #0d7a7a) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    margin-bottom: 10px !important;
}


/* ================================================================
   LISTE D'EFFETS & AJUSTEMENTS
   ================================================================ */

.illu-mobile-effect-list__item {
    border: none !important;
    border-radius: var(--mob-r-md) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: var(--mob-shadow-card) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

.illu-mobile-effect-list__item i {
    color: var(--mp-accent, #0d7a7a) !important;
    font-size: 18px !important;
}

.illu-mobile-effect-list__item:active {
    transform: scale(0.97) !important;
    background: var(--mob-accent-tint) !important;
    box-shadow: none !important;
}

/* Séparateurs de section */
.illu-mobile-effect-section__title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: rgba(60, 60, 67, 0.55) !important;
    padding: 2px 4px !important;
    margin-top: 4px !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-effect-section__title {
    color: rgba(235, 235, 245, 0.55) !important;
}


/* ================================================================
   RACCOURCIS COULEURS (chips)
   ================================================================ */

.illu-mobile-color-quick__btn {
    border: 1px solid var(--mob-divider) !important;
    border-radius: var(--mob-r-sm) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: none !important;
    min-width: 60px !important;
    padding: 7px 8px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

.illu-mobile-color-quick__btn i {
    color: var(--mp-accent, #0d7a7a) !important;
    font-size: 18px !important;
}

.illu-mobile-color-quick__btn:active {
    transform: scale(0.91) !important;
    background: var(--mob-accent-tint) !important;
}

.illu-mobile-color-quick {
    border-bottom: 1px solid var(--mob-divider) !important;
    margin-bottom: 8px !important;
}


/* ================================================================
   DRAWER — PANNEAU LATÉRAL
   ================================================================ */

.illu-mobile-drawer__tab-row {
    border: none !important;
    border-radius: var(--mob-r-md) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--mob-divider) !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

/* Premier item : coins en haut */
.illu-mobile-drawer__tabs > *:first-child .illu-mobile-drawer__tab-row {
    border-radius: var(--mob-r-md) var(--mob-r-md) 0 0 !important;
}

/* Dernier item : coins en bas */
.illu-mobile-drawer__tabs > *:last-child .illu-mobile-drawer__tab-row {
    border-radius: 0 0 var(--mob-r-md) var(--mob-r-md) !important;
    border-bottom: none !important;
}

.illu-mobile-drawer__tabs {
    gap: 0 !important;
    border: 1px solid var(--mob-divider) !important;
    border-radius: var(--mob-r-md) !important;
    overflow: hidden !important;
    background: var(--mob-card-bg) !important;
    box-shadow: var(--mob-shadow-card) !important;
}

.illu-mobile-drawer__tab-row--active {
    background: var(--mob-accent-tint) !important;
    font-weight: 600 !important;
    color: var(--mp-accent, #0d7a7a) !important;
}

.illu-mobile-drawer__tab-row:active {
    transform: none !important;
    background: var(--mob-pressed) !important;
}

.illu-mobile-drawer__tab-thumb {
    border: 1px solid var(--mob-divider) !important;
    border-radius: 4px !important;
}

.illu-mobile-drawer__tab-close {
    border-radius: var(--mob-r-sm) !important;
    color: rgba(60, 60, 67, 0.40) !important;
    transition: color var(--mob-dur-xs) var(--mob-ease-out) !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-drawer__tab-close {
    color: rgba(235, 235, 245, 0.35) !important;
}

.illu-mobile-drawer__tab-close:active {
    color: #e53935 !important;
}

.illu-mobile-drawer__history-btn {
    border: none !important;
    border-radius: var(--mob-r-md) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: var(--mob-shadow-card) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

.illu-mobile-drawer__history-btn i {
    color: var(--mp-accent, #0d7a7a) !important;
}

.illu-mobile-drawer__history-btn:active {
    transform: scale(0.98) !important;
    background: var(--mob-accent-tint) !important;
}


/* ================================================================
   CALQUES / HISTORIQUE dans sheets
   ================================================================ */

body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body .list-item {
    box-sizing: border-box !important;
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--mp-text) !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--mob-divider) !important;
    margin-bottom: 0 !important;
    transition: background var(--mob-dur-xs) var(--mob-ease-out) !important;
}

/* Hauteur de frappe confortable + lignes pleine largeur */
body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row {
    min-height: 48px !important;
    padding: 6px 10px !important;
    gap: 10px !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-history-body .list-item {
    display: block !important;
    min-height: 44px !important;
    padding: 13px 12px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Miniature de calque plus lisible au doigt */
body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row .layer-thumb {
    width: 34px !important;
    height: 34px !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row .layer-name {
    font-size: 15px !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row:active,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body .list-item:active {
    background: var(--mob-pressed) !important;
}

/* État ACTIF — bien visible : on doit savoir quel calque / quelle étape est sélectionné */
body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row.active,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body .list-item.active {
    background: var(--mob-accent-tint2) !important;
    color: var(--mp-accent, #0d7a7a) !important;
    box-shadow: inset 3px 0 0 0 var(--mp-accent, #0d7a7a) !important;
    font-weight: 600 !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .layer-row.active .layer-name {
    color: var(--mp-accent, #0d7a7a) !important;
    font-weight: 600 !important;
}

/* Le panneau et la liste occupent toute la largeur de la sheet, hauteur libre */
body.illu-mobile-shell-active #illu-mobile-sheet-layers-body #win-layers,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body #win-history,
body.illu-mobile-shell-active #illu-mobile-sheet-layers-body .window-body,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body .window-body {
    width: 100% !important;
    /* #win-history reçoit min/max-width: 200px en inline (app.js) → on les neutralise */
    min-width: 0 !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-layers-body #layers-list,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body #history-list {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border: none !important;
    background: transparent !important;
}

/* Boutons d'action (add layer, delete, etc.) */
body.illu-mobile-shell-active #illu-mobile-sheet-layers-body button:not(.illu-mobile-sheet__foot-close),
body.illu-mobile-shell-active #illu-mobile-sheet-history-body button:not(.illu-mobile-sheet__foot-close) {
    border: none !important;
    border-radius: var(--mob-r-sm) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: var(--mob-shadow-card) !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-layers-body button:not(.illu-mobile-sheet__foot-close):active,
body.illu-mobile-shell-active #illu-mobile-sheet-history-body button:not(.illu-mobile-sheet__foot-close):active {
    transform: scale(0.93) !important;
    background: var(--mob-pressed) !important;
}


/* ================================================================
   BARRE D'OPTIONS OUTILS
   ================================================================ */

body.illu-mobile-shell-active:not(.illu-toolbar-ribbon) #tool-options-container {
    background: var(--mp-surface, #f2f2f7) !important;
    border-bottom: 1px solid var(--mob-divider) !important;
}

body.illu-mobile-shell-active .illu-mobile-opt-strip {
    background: var(--mp-surface, #f2f2f7) !important;
    border-bottom: 1px solid var(--mob-divider) !important;
}

/* Boutons dans la barre d'options */
body.illu-mobile-shell-active .illu-mobile-opt-strip button,
body.illu-mobile-shell-active #tool-options-bar-row1 button {
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background var(--mob-dur-xs) var(--mob-ease-out),
        transform  var(--mob-dur-xs) var(--mob-spring) !important;
}

body.illu-mobile-shell-active .illu-mobile-opt-strip button:active,
body.illu-mobile-shell-active #tool-options-bar-row1 button:active {
    transform: scale(0.91) !important;
    background: var(--mob-pressed) !important;
}

body.illu-mobile-shell-active .illu-mobile-opt-strip button[aria-pressed="true"],
body.illu-mobile-shell-active #tool-options-bar-row1 button[aria-pressed="true"],
body.illu-mobile-shell-active .illu-mobile-opt-strip .illu-icon-toggle.is-active,
body.illu-mobile-shell-active #tool-options-bar-row1 .illu-icon-toggle.is-active {
    background: var(--mob-accent-tint2) !important;
    border-color: var(--mob-accent-tint2) !important;
    color: var(--mp-accent, #0d7a7a) !important;
}

/* Selects */
body.illu-mobile-shell-active .illu-mobile-opt-strip select,
body.illu-mobile-shell-active #tool-options-bar-row1 select {
    box-shadow: none !important;
    font-size: 13px !important;
}

body.illu-mobile-shell-active.theme-dark .illu-mobile-opt-strip select,
body.illu-mobile-shell-active.theme-dark #tool-options-bar-row1 select {
    color: #f2f2f7 !important;
}

/* Range slider — TOUS les range dans le shell mobile (input global) */
body.illu-mobile-shell-active input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px !important;
    min-height: 0 !important;
    border-radius: 3px !important;
    background: rgba(13, 122, 122, 0.40) !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Track WebKit/Blink (Chrome, Safari, Edge) */
body.illu-mobile-shell-active input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    height: 5px;
    border-radius: 3px;
    background: rgba(13, 122, 122, 0.40);
    border: none;
}

/* Track Firefox */
body.illu-mobile-shell-active input[type="range"]::-moz-range-track {
    height: 5px;
    border-radius: 3px;
    background: rgba(13, 122, 122, 0.40);
    border: none;
}

/* Thumb WebKit */
body.illu-mobile-shell-active input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--mp-accent, #0d7a7a);
    box-shadow: 0 1px 5px rgba(0,0,0,0.22);
    cursor: pointer;
}

/* Thumb Firefox */
body.illu-mobile-shell-active input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--mp-accent, #0d7a7a);
    box-shadow: 0 1px 5px rgba(0,0,0,0.22);
    cursor: pointer;
}


/* ================================================================
   PANNEAU COULEURS dans la sheet
   ================================================================ */

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body #win-colors {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Primaire / secondaire empilés verticalement (pas de chevauchement) :
   plus faciles à viser au doigt et moins larges. */
body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .color-swatch-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 46px !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .color-swatch-box .col-primary,
body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .color-swatch-box .col-secondary {
    position: static !important;
    width: 44px !important;
    height: 38px !important;
    border: 1px solid var(--mob-divider) !important;
    border-radius: var(--mob-r-sm) !important;
    box-shadow: var(--mob-shadow-card) !important;
}

/* Primaire en haut, bouton d'échange au milieu, secondaire en bas */
body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .color-swatch-box .col-primary {
    order: 1 !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .color-swatch-box #ui-col-swap {
    order: 2 !important;
    position: static !important;
    width: 26px !important;
    height: 22px !important;
    font-size: 11px !important;
    border-radius: var(--mob-r-pill) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .color-swatch-box .col-secondary {
    order: 3 !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .col-primary,
body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .col-secondary {
    border-radius: var(--mob-r-sm) !important;
    box-shadow: var(--mob-shadow-card) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body #ui-col-swap {
    border: none !important;
    border-radius: var(--mob-r-sm) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: var(--mob-shadow-card) !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: transform var(--mob-dur-xs) var(--mob-spring) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body #ui-col-swap:active {
    transform: rotate(180deg) scale(0.90) !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body #color-target-sel {
    border: 1px solid var(--mob-divider) !important;
    border-radius: var(--mob-r-xs) !important;
    background: var(--mob-card-bg) !important;
    box-shadow: none !important;
}

body.illu-mobile-shell-active.theme-dark #illu-mobile-sheet-colors-body #color-target-sel {
    color: #f2f2f7 !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body .palette-swatch {
    border-radius: 3px !important;
}

/* Grille étendue alignée par teinte (générée à la taille de la sheet) :
   largeur naturelle centrée + pastilles qui remplissent leur cellule de 18px,
   pour que les 4 variantes restent bien alignées en colonnes. */
body.illu-mobile-shell-active #illu-mobile-sheet-colors-body #palette-grid:not(.palette-grid--flow) {
    width: max-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.illu-mobile-shell-active #illu-mobile-sheet-colors-body #palette-grid:not(.palette-grid--flow) .palette-swatch {
    width: 18px !important;
    height: 18px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
}


/* ================================================================
   BARRES DE DÉFILEMENT — fines et discrètes
   ================================================================ */

html:has(body.illu-mobile-shell-active) ::-webkit-scrollbar {
    width: 3px !important;
    height: 3px !important;
}

html:has(body.illu-mobile-shell-active) ::-webkit-scrollbar-track {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    margin: 0 !important;
}

html:has(body.illu-mobile-shell-active) ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 2px !important;
    box-shadow: none !important;
}

html:has(body.illu-mobile-shell-active.theme-dark) ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.20) !important;
}

html:has(body.illu-mobile-shell-active) ::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

html:has(body.illu-mobile-shell-active) ::-webkit-scrollbar-corner {
    background: transparent !important;
}


/* ================================================================
   SÉPARATEURS
   ================================================================ */

body.illu-mobile-shell-active .opt-sep,
body.illu-mobile-shell-active .illu-menubar-toolbar__sep {
    background: var(--mob-divider) !important;
    width: 1px !important;
    border: none !important;
    margin: 0 3px !important;
}


/* ================================================================
   CHECKBOXES — style tactile mobile (survole le thème Win98/10)
   ================================================================ */

body.illu-mobile-shell-active input[type="checkbox"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1.5px solid rgba(0, 0, 0, 0.20) !important;
    border-radius: 5px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer !important;
    flex-shrink: 0;
    position: relative;
    transition: background var(--mob-dur-xs) var(--mob-ease-out),
                border-color var(--mob-dur-xs) var(--mob-ease-out) !important;
}

body.illu-mobile-shell-active.theme-dark input[type="checkbox"] {
    background: rgba(60, 60, 62, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
}

body.illu-mobile-shell-active input[type="checkbox"]:active {
    transform: scale(0.90) !important;
}

body.illu-mobile-shell-active input[type="checkbox"]:checked {
    background: var(--mp-accent, #0d7a7a) !important;
    border-color: var(--mp-accent, #0d7a7a) !important;
}

body.illu-mobile-shell-active input[type="checkbox"]:checked::after {
    content: "" !important;
    position: absolute !important;
    top: 3px !important;
    left: 6px !important;
    width: 5px !important;
    height: 9px !important;
    border: solid #ffffff !important;
    border-width: 0 2.5px 2.5px 0 !important;
    transform: rotate(45deg) !important;
}


/* ================================================================
   iOS / ANDROID — corrections universelles
   ================================================================ */

body.illu-mobile-shell-active button,
body.illu-mobile-shell-active [role="button"],
body.illu-mobile-shell-active a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Empêche le zoom sur double-tap iOS lors du focus sur un input */
body.illu-mobile-shell-active input,
body.illu-mobile-shell-active select,
body.illu-mobile-shell-active textarea {
    font-size: max(16px, 1em);
}


/* ================================================================
   ACCESSIBILITÉ — réduction des mouvements
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    body.illu-mobile-shell-active *,
    body.illu-mobile-shell-active *::before,
    body.illu-mobile-shell-active *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.illu-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 2700000;
    pointer-events: none;
    visibility: hidden;
}

.illu-mobile-drawer--open {
    pointer-events: auto;
    visibility: visible;
}

body.illu-mobile-drawer-open #app-window {
    overflow: hidden;
}

.illu-mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.illu-mobile-drawer--open .illu-mobile-drawer__backdrop {
    opacity: 1;
}

.illu-mobile-drawer__panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 360px);
    max-width: 100%;
    box-sizing: border-box;
    background: var(--mp-surface);
    border-right: 1px solid var(--mp-raised-top);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    outline: none;
    color: var(--mp-text);
    padding-left: 0;
}

.illu-mobile-drawer__panel::before {
    display: none;
}

.illu-mobile-drawer--open .illu-mobile-drawer__panel {
    transform: translateX(0);
}

.illu-mobile-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--mp-surface);
    border-bottom: 1px solid var(--mp-inset-top);
    flex-shrink: 0;
}

.illu-mobile-drawer__title {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
    color: var(--mp-text);
    padding-left: 0;
}

.illu-mobile-drawer__close {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.1s;
}

.illu-mobile-drawer__close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.illu-mobile-drawer__close:active {
    background: rgba(0, 0, 0, 0.1);
}

.illu-mobile-drawer__close::before,
.illu-mobile-drawer__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 1px;
    background: var(--mp-text);
    transform: translate(-50%, -50%) rotate(45deg);
}

.illu-mobile-drawer__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.illu-mobile-drawer__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 24px;
    font-size: 14px;
}

.illu-mobile-drawer__section-label {
    margin: 10px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--mp-accent);
    padding: 4px 0;
    background: transparent;
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.illu-mobile-drawer__section-label--menus {
    margin-top: 24px;
}

.illu-mobile-drawer__palette-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.illu-mobile-drawer__palette-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 1px solid var(--mp-inset-top);
    background: var(--mp-surface);
    color: var(--mp-text);
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    border-radius: var(--mp-radius);
    transition: background 0.1s;
}

.illu-mobile-drawer__palette-tile i {
    font-size: 20px;
    color: var(--mp-accent);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.illu-mobile-drawer__palette-tile .fa-circle-xmark {
    position: relative;
    color: transparent !important;
}

.illu-mobile-drawer__palette-tile .fa-circle-xmark::before,
.illu-mobile-drawer__palette-tile .fa-circle-xmark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 1px;
    background: var(--mp-text);
    transform: translate(-50%, -50%) rotate(45deg);
}

.illu-mobile-drawer__palette-tile .fa-circle-xmark::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.illu-mobile-drawer__palette-tile:active {
    background: var(--mp-surface-deep);
    border-color: var(--mp-inset-top);
    padding: 8px 12px;
}

.illu-mobile-drawer__details {
    margin-bottom: 4px;
    border: none;
}

.illu-mobile-drawer__summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 10px;
    display: flex;
    align-items: center;
    font-weight: normal;
    font-size: 14px;
    color: var(--mp-text);
    background: transparent;
    border: none;
    margin-bottom: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
    border-radius: var(--mp-radius);
}

.illu-mobile-drawer__summary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.illu-mobile-drawer__summary::before {
    content: "";
    width: 3px;
    height: 16px;
    background: var(--mp-accent);
    margin-right: 12px;
    opacity: 1;
    border-radius: 2px;
}

.illu-mobile-drawer__summary::-webkit-details-marker {
    display: none;
}

.illu-mobile-drawer__summary::after {
    content: "▶";
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.1s;
}

.illu-mobile-drawer__details[open] .illu-mobile-drawer__summary::after {
    transform: rotate(90deg);
}

.illu-mobile-drawer__sub-list {
    padding: 4px 0 8px 16px;
    border-left: 2px solid var(--mp-surface-deep);
    margin-left: 14px;
}

.illu-mobile-drawer__menu-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--mp-text);
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    text-align: left;
    margin: 2px 0;
    border-radius: var(--mp-radius);
    transition: background 0.1s;
}

.illu-mobile-drawer__menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.illu-mobile-drawer__menu-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.illu-mobile-drawer__divider {
    height: 1px;
    background: var(--mp-inset-top);
    margin: 8px 10px;
}

.illu-mobile-drawer__menu-btn--contact {
    width: 100%;
    margin: 16px 0 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    background: var(--mp-accent) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: normal;
    text-shadow: none;
    border: none;
    border-radius: var(--mp-radius);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.illu-mobile-drawer__menu-btn--contact i {
    color: #fff !important;
    font-size: 16px;
    margin-right: 0 !important;
}

.illu-mobile-drawer__menu-btn--contact:hover {
    background: var(--mp-teal-dark) !important;
}

.illu-mobile-drawer__menu-btn--contact:active {
    padding: 12px 14px;
}

.illu-mobile-drawer__footer {
    flex-shrink: 0;
    padding: 12px 16px;
    background: var(--mp-surface);
    border-top: 1px solid var(--mp-inset-top);
    text-align: center;
}

.illu-mobile-drawer__credit {
    margin: 0;
    font-size: 12px;
    color: var(--mp-text);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.illu-mobile-drawer__credit-link {
    color: var(--mp-accent);
    text-decoration: none;
    font-weight: normal;
}

.illu-mobile-drawer__credit-link:hover {
    text-decoration: underline;
}

body.theme-modern .illu-mobile-drawer__panel {
    background: var(--mp-surface);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding-left: 0;
}

body.theme-modern .illu-mobile-drawer__panel::before {
    display: none;
}

body.theme-modern .illu-mobile-drawer__summary {
    background: transparent;
    border: none;
    border-radius: var(--mp-radius);
    padding: 12px 10px;
    margin: 0;
    box-shadow: none;
}

body.theme-modern .illu-mobile-drawer__palette-tile {
    border: 1px solid var(--mp-inset-top);
    background: var(--mp-surface);
    border-radius: var(--mp-radius);
    box-shadow: none;
}

body.theme-modern .illu-mobile-drawer__close {
    border: none;
    background: transparent;
    border-radius: 50%;
}

body.theme-dark .illu-mobile-drawer__panel {
    background: var(--mp-surface);
    border-color: #444;
}

body.theme-dark .illu-mobile-drawer__panel::before {
    display: none;
}

body.theme-dark .illu-mobile-drawer__section-label {
    background: transparent;
    color: var(--mp-accent);
}

body.theme-dark .illu-mobile-drawer__palette-tile {
    background: var(--mp-surface);
    border-color: #444;
}

body.theme-dark .illu-mobile-drawer__palette-tile i {
    color: var(--mp-accent);
}

body.theme-dark .illu-mobile-drawer__footer {
    background: var(--mp-surface);
    border-top-color: #444;
}

body.theme-dark .illu-mobile-drawer__credit-link {
    color: var(--mp-accent);
}

body.theme-dark .illu-mobile-drawer__menu-btn,
body.theme-dark .illu-mobile-drawer__sub-list .illu-mobile-drawer__menu-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--mp-text) !important;
}

body.theme-dark .illu-mobile-drawer__menu-btn:hover,
body.theme-dark .illu-mobile-drawer__menu-btn:active,
body.theme-dark .illu-mobile-drawer__menu-btn:focus-visible,
body.theme-dark .illu-mobile-drawer__sub-list .illu-mobile-drawer__menu-btn:hover,
body.theme-dark .illu-mobile-drawer__sub-list .illu-mobile-drawer__menu-btn:active,
body.theme-dark .illu-mobile-drawer__sub-list .illu-mobile-drawer__menu-btn:focus-visible {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--mp-text) !important;
    border: none !important;
}

body.theme-dark .illu-mobile-drawer__summary:hover,
body.theme-dark .illu-mobile-drawer__summary:active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--mp-text) !important;
}

body.theme-dark .illu-mobile-drawer__sub-list {
    border-left-color: #444;
}

.illu-mobile-drawer__cloned-menu {
    display: none !important;
}

body.theme-dark .title-bar-controls button.title-bar-close-btn::before,
body.theme-dark .title-bar-controls button.title-bar-close-btn::after,
body.theme-dark .title-bar-controls button[aria-label="Close"]::before,
body.theme-dark .title-bar-controls button[aria-label="Close"]::after,
body.theme-dark .illu-mobile-drawer__close::before,
body.theme-dark .illu-mobile-drawer__close::after {
    background: #ffffff !important;
}

body.theme-dark .illu-mobile-drawer__palette-tile .fa-circle-xmark::before,
body.theme-dark .illu-mobile-drawer__palette-tile .fa-circle-xmark::after {
    background: #ffffff !important;
}