/* assets/css/mapirando-modals.css - V200.10 (FIX VISIBILITÉ BOUTONS) */

.fb-modal { 
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(15, 23, 42, 0.85); 
    z-index: 999999999 !important; 
    align-items: center; justify-content: center; 
}
.fb-modal.show { display: flex !important; }

/* CROIX DE FERMETURE */
.close-modal-btn { 
    position: absolute; 
    top: 20px !important; 
    right: 20px !important;
    left: auto !important;
    background: transparent !important; 
    width: 44px; height: 44px; border: none; color: white; 
    font-size: 34px; font-weight: 300; cursor: pointer; 
    z-index: 1000000000 !important; 
    display: flex; align-items: center; justify-content: center; transition: 0.2s;
}

/* ✕ dans les modales settings (Réseau, Notifications, Réglages) */
.settings-modal-content .close-modal-btn {
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
    color: #64748b !important;
    background: #e2e8f0 !important;
    border-radius: 50% !important;
    z-index: 10 !important;
}
.settings-modal-content .close-modal-btn:hover {
    background: #cbd5e1 !important;
    color: #0f172a !important;
    transform: none !important;
}
.close-modal-btn:hover { transform: scale(1.1); }

/* ======================================================== */
/* 1. LIGHTBOX (VUE PUBLICATION PLEIN CADRE)                */
/* ======================================================== */
.post-lightbox-content { 
    width: 90%; max-width: 1100px; height: 80vh; max-height: 720px; 
    background: #ffffff; display: flex; border-radius: 16px; 
    overflow: hidden; border: none; box-shadow: 0 20px 50px rgba(0,0,0,0.15); 
    margin-top: -16px;
    transition: opacity 0.25s ease;
}
.lb-media { flex: 1; background: #ffffff; display: flex; align-items: center; justify-content: center; position: relative; min-width: 0; border-right: 1px solid #e2e8f0; overflow: hidden; }

#lb-main-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lb-sidebar { width: 350px; min-width: 350px; background: #ffffff; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.lb-header { padding: 20px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.lb-header-left { display: flex; align-items: center; gap: 12px; }
.lb-author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.lb-author-name { color: #0f172a; font-weight: 700; font-size: 0.95rem; text-decoration: none; }
.lb-location-display { font-size: 0.75rem; color: #64748b; display: flex; align-items: center; gap: 4px; margin-top: 2px; font-weight: 600;}
.lb-options-btn { background: #f1f5f9; border-radius: 50%; border: none; color: #475569; cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; transition: 0.2s;}
.lb-options-btn:hover { background: #e2e8f0; color: #0f172a; }
.lb-caption-read-only { padding: 20px; color: #334155; font-size: 0.95rem; line-height: 1.6; flex: 1; overflow-y: auto; font-weight: 400; }
.lb-action-bar { margin-top: auto !important; }

/* ======================================================== */
/* OPTIONS OVERLAY & SHARE OVERLAY                          */
/* ======================================================== */
/* OPTIONS POPOVER (Uniforme avec le Share Popover) */
.lb-options-popover { position: absolute; top: 120%; right: 0; background: #ffffff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 190px; opacity: 0; visibility: hidden; transition: all 0.2s ease; z-index: 100; border: 1px solid #e2e8f0; transform: translateY(-8px); }
.lb-options-popover.active { opacity: 1; visibility: visible; transform: translateY(0); }
.lb-options-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #334155; text-decoration: none; font-weight: 600; font-size: 0.92rem; border-radius: 8px; cursor: pointer; transition: background 0.15s; background: none; border: none; width: 100%; text-align: left; font-family: 'Nunito', sans-serif; }
.lb-options-item:hover { background: #f1f5f9; color: #0f172a; }
.lb-options-item .material-symbols-rounded { font-size: 20px !important; color: #64748b; }
.lb-options-item.danger { color: #ef4444; }
.lb-options-item.danger .material-symbols-rounded { color: #ef4444; }

/* SHARE POPOVER */
.lb-share-wrapper { position: relative; }
.lb-share-popover { position: absolute; bottom: 120%; right: 0; background: #ffffff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 190px; opacity: 0; visibility: hidden; transition: all 0.2s ease; z-index: 100; border: 1px solid #e2e8f0; transform: translateY(8px); }
.lb-share-popover.active { opacity: 1; visibility: visible; transform: translateY(0); }
.lb-share-popover::before { content: ''; position: absolute; top: 100%; right: 16px; border-width: 7px; border-style: solid; border-color: #ffffff transparent transparent transparent; }
.lb-share-popover::after { content: ''; position: absolute; top: 100%; right: 15px; border-width: 8px; border-style: solid; border-color: #e2e8f0 transparent transparent transparent; z-index: -1; }
.lb-share-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #334155; text-decoration: none; font-weight: 600; font-size: 0.92rem; border-radius: 8px; cursor: pointer; transition: background 0.15s; background: none; border: none; width: 100%; text-align: left; font-family: 'Nunito', sans-serif; }
.lb-share-item:hover { background: #f1f5f9; color: #0f172a; }
.lb-share-item .material-symbols-rounded { font-size: 20px !important; color: #64748b; }

.lb-nav-prev, .lb-nav-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: transparent !important; color: #ffffff !important;
    border: none; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    box-shadow: none; transition: all 0.2s ease;
    font-size: 0 !important;
}
.lb-nav-prev::after { content: 'chevron_left'; font-family: 'Material Symbols Rounded'; font-size: 28px; color: #ffffff; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.lb-nav-next::after { content: 'chevron_right'; font-family: 'Material Symbols Rounded'; font-size: 28px; color: #ffffff; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.lb-nav-prev:hover, .lb-nav-next:hover { background: rgba(255,255,255,0.1) !important; transform: translateY(-50%) scale(1.08); box-shadow: none; }
.lb-nav-prev { left: 16px; } .lb-nav-next { right: 16px; }

/* ======================================================== */
/* 2. MODALE CRÉATION (DESIGN INSTAGRAM DESKTOP)            */
/* ======================================================== */
.create-post-modal { 
    background: #ffffff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; 
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    border: none; box-shadow: 0 20px 50px rgba(0,0,0,0.15); 
    max-width: 95vw; max-height: 90vh; 
}

.create-post-modal.step-select-mode { width: 480px !important; height: 480px !important; }
.create-post-modal.step-preview-mode { width: 550px !important; height: 602px !important; } 
.create-post-modal.step-details-mode { width: 880px !important; height: 602px !important; } 

.fb-modal-header { height: 52px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; color: #0f172a; background: #ffffff; flex-shrink: 0; }
.fb-modal-header h2 { font-size: 1rem; margin: 0; font-weight: 800; letter-spacing: 0.1px; font-family: 'Nunito', sans-serif; }

/* FIX DES BOUTONS DE L'EN-TÊTE */
.header-btn { background: transparent; border: none; color: #3b82f6; font-weight: 800; cursor: pointer; font-size: 0.95rem; padding: 6px 12px; border-radius: 8px; transition: background 0.15s, color 0.15s; font-family: 'Nunito', sans-serif; letter-spacing: 0.2px; margin: 0; box-shadow: none; }
.header-btn:hover { background: #eff6ff; color: #2563eb; }
.header-btn.cancel { color: #64748b; font-size: 32px; font-weight: 300; padding: 0; background: transparent !important; }
.header-btn.cancel:hover { background: transparent !important; color: #0f172a; }

.create-body { flex: 1; position: relative; display: flex; overflow: hidden; background: #ffffff; }

/* ETAPE 1 */
.step-select { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }

/* ETAPE 2 */
.step-preview { width: 100%; height: 100%; display: flex; }
.preview-container { display: flex; width: 100%; height: 100%; position: relative; }
.main-preview-area { width: 100%; height: 100%; background: #ffffff; border: none; position: relative; display: block; }
#main-preview-img { width: 100%; height: 100%; object-fit: cover !important; display: block; } 

.preview-nav-prev, .preview-nav-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: transparent; border: none;
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    z-index: 10; box-shadow: none;
    font-size: 0 !important;
}
.preview-nav-prev { left: 12px; } .preview-nav-next { right: 12px; }
.preview-nav-prev::after, .preview-nav-next::after {
    font-family: "Material Symbols Rounded" !important;
    font-size: 24px; color: #ffffff; line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.preview-nav-prev::after { content: "chevron_left"; }
.preview-nav-next::after { content: "chevron_right"; }
.preview-nav-prev.visible, .preview-nav-next.visible { display: flex !important; }

/* La barre des miniatures */
.thumbnails-sidebar {
    position: absolute; bottom: 20px; right: 20px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px; padding: 10px; display: none; flex-direction: row; align-items: center; gap: 8px;
    max-width: calc(100% - 40px); overflow-x: auto; border: 1px solid rgba(255,255,255,0.15); height: auto; z-index: 50;
}
.create-post-modal.step-preview-mode .thumbnails-sidebar { display: flex !important; }

.preview-thumb { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; }
.preview-thumb.active { border-color: #ffffff; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.add-more-photos { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1px dashed rgba(255,255,255,0.5); color: #ffffff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: 0.2s; cursor: pointer; margin:0; padding:0;}
.add-more-photos:hover { background: rgba(255,255,255,0.25); }

/* La croix pour supprimer une miniature */
.preview-thumb .remove-thumb { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,0.7); color: #fff; border: none; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; z-index: 10; padding:0; }
.preview-thumb .remove-thumb:hover { background: #ef4444; }
.photo-number-circle { position: absolute; bottom: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.65rem; font-weight: 800; display: flex; align-items: center; justify-content: center; z-index: 5; pointer-events: none; }

/* ETAPE 3 */
.step-details { width: 100%; height: 100%; display: flex; flex-direction: row; }
.details-media { width: 550px; height: 100%; flex-shrink: 0; background: #ffffff; position: relative; border-right: 1px solid #e2e8f0; }
#details-current-img { width: 100%; height: 100%; object-fit: cover !important; display: block; }

.details-sidebar { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; background: #ffffff; height: 100%; }
.details-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.details-header .user-mini-av { width: 30px !important; height: 30px !important; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.details-header .user-mini-name { font-weight: 700; font-size: 0.95rem; color: #0f172a; }

.details-caption-area { flex: 1; display: flex; flex-direction: column; border-bottom: 1px solid #f1f5f9; }
.details-caption-area textarea { width: 100%; height: 100%; min-height: 150px; background: transparent; border: none; padding: 16px; font-size: 0.95rem; resize: none; outline: none; color:#0f172a; font-family: 'Nunito', sans-serif;}
.details-caption-area textarea::placeholder { color: #94a3b8; }

.details-footer { flex-shrink: 0; }
.location-input-group { display: flex; align-items: center; justify-content:space-between; gap: 8px; padding: 16px; border-bottom: 1px solid #f1f5f9; }
.meta-input-clean { background: transparent !important; border: none !important; box-shadow: none !important; color: #0f172a; flex: 1; outline: none; font-size: 0.95rem; font-weight: 500; padding:0; margin:0; }
.meta-input-clean::placeholder { color: #64748b; font-weight: 400; }
#location-autocomplete { background: #ffffff; border-bottom: 1px solid #e2e8f0; max-height: 150px; overflow-y: auto; position: relative; z-index: 9999 !important; }
.location-autocomplete-item { padding: 12px 15px; color: #334155; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; font-weight: 500;}
.location-autocomplete-item:hover { background: #f8fafc; color: #0f172a;}

/* Navigation carousel dans details */
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.92) !important; color: #0f172a !important; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,0.15); font-size: 0 !important; transition: all 0.2s; }
.carousel-nav::after { font-family: "Material Symbols Rounded" !important; font-size: 20px; color: #0f172a; line-height: 1; }
.carousel-prev::after { content: "chevron_left"; } .carousel-next::after { content: "chevron_right"; }
.carousel-prev { left: 12px; } .carousel-next { right: 12px; }
.carousel-nav:hover { background: #ffffff !important; transform: translateY(-50%) scale(1.08); }

/* ======================================================== */
/* 3. MODALE ABONNÉS (STYLES INTÉRIEURS)                    */
/* ======================================================== */
#subscribers-modal .sub-tab { 
    display: flex; flex: 1; align-items: center; justify-content: center; 
    padding: 15px 5px; color: #64748b; font-weight: 600; cursor: pointer; 
    border-bottom: 3px solid transparent; transition: 0.2s;
}
#subscribers-modal .sub-tab.active { color: #0f172a; border-bottom-color: #79d4ad; font-weight: 700; }

.sub-item { 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 12px 20px; border-bottom: 1px solid #f1f5f9; gap: 15px; 
}
.sub-info { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 0; }

/* BLINDAGE DE L'AVATAR GÉANT */
.sub-info img, .sub-item img, .sub-av { 
    width: 44px !important; height: 44px !important; 
    min-width: 44px !important; max-width: 44px !important; 
    border-radius: 50% !important; object-fit: cover !important; 
    flex-shrink: 0 !important; border: 1px solid #e2e8f0 !important; display: block !important; 
}

.sub-name { color: #0f172a; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.btn-mini { padding: 8px 15px; border-radius: 8px; border: none; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition:0.2s; }
.btn-confirm { background: #79d4ad; color: white; }
.btn-confirm:hover { background: #65b894; }
.btn-remove, .btn-requested { background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569; }
.btn-remove:hover { background: #e2e8f0; color: #0f172a; }

.search-users-global { 
    width: 100%; background: #f8fafc !important; border: 1px solid #e2e8f0 !important; 
    border-radius: 8px; padding: 12px 15px !important; color: #0f172a !important; 
    font-size: 0.95rem; outline: none; font-weight: 400; box-shadow: none !important;
}
.search-users-global:focus { border-color: #79d4ad !important; background: #ffffff !important; }

/* ======================================================== */
/* 4. MODALE RÉGLAGES                                       */
/* ======================================================== */
.settings-modal-content { 
    width: 100%; max-width: 900px; height: 650px; 
    background: #ffffff !important; border: none;
    border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.1); 
}

.settings-body { display: flex; flex: 1; overflow: hidden; }
.settings-sidebar { width: 250px !important; min-width: 250px !important; border-right: 1px solid #e2e8f0; padding: 20px 0; background: #f8fafc; display: flex; flex-direction: column; }
.settings-tab { padding: 15px 30px; color: #64748b; cursor: pointer; border-left: 3px solid transparent; font-weight: 600; transition: 0.2s;}
.settings-tab:hover { background: #f1f5f9; color: #1e293b; }
.settings-tab.active { background: #ffffff; color: #0f172a; border-left-color: #79d4ad; font-weight: 700; box-shadow: -2px 0 5px rgba(0,0,0,0.02);}

.settings-content { flex: 1; padding: 40px 50px; overflow-y: auto; background: #ffffff; }
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: fadeIn 0.3s ease; }

.settings-row { border-bottom: 1px solid #f1f5f9; padding-bottom: 25px; margin-bottom: 25px; }

.settings-label { color: #64748b; font-weight: 500; font-size: 0.85rem; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.settings-label span { color: #64748b; }
h4 { color: #475569 !important; font-weight: 600 !important; font-size: 0.85rem !important; letter-spacing: 0.5px; margin-bottom: 15px; text-transform: uppercase; }

.settings-display-group { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 15px; }
.settings-value { color: #0f172a; font-size: 1rem; font-weight: 600; } 
.settings-edit-btn { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: 0.2s;}
.settings-edit-btn:hover { background: #e2e8f0; color: #0f172a; }

.settings-edit-group { display: none; width: 100%; margin-top:10px; }

.settings-input { 
    width: 100%; background: #f8fafc !important; border: 1px solid #e2e8f0 !important; 
    color: #0f172a !important; padding: 12px 15px; border-radius: 8px; 
    margin-bottom: 10px; font-weight: 400 !important; font-size: 0.95rem;
    transition: border-color 0.2s; box-shadow: none !important;
    height: auto !important; min-height: 45px; 
}
.settings-input:focus { border-color: #79d4ad !important; outline: none; background: #ffffff !important; }

.settings-actions { display: flex; gap: 15px; margin-top: 10px; }
.save-btn { background: #79d4ad; color: white !important; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 0.9rem;}
.save-btn:hover { background: #65b894; transform: translateY(-2px); }
.cancel-btn { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 0.9rem;}
.cancel-btn:hover { background: #e2e8f0; color: #0f172a; }

.options-menu, .share-menu { background: #ffffff; width: 300px; max-width: 90%; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.option-item { background: transparent; border: none; border-bottom: 1px solid #f1f5f9; color: #1e293b; padding: 18px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.option-item:hover { background: #f8fafc; }

.danger-zone { margin-top: 40px; padding-top: 30px; border-top: 1px solid #fee2e2; }
.danger-zone-title { color: #ef4444; font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.danger-btn { background: #fff5f5; color: #ef4444; border: 1px solid #fecaca; padding: 12px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.2s; width: 100%; text-align: center; }
.danger-btn:hover { background: #ef4444; color: white; }

/* Popup de Succes */
.success-popup { animation: popupFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform-origin: center; }
@keyframes popupFadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ======================================================== */
/* RESPONSIVE MOBILE MODALES                                */
/* ======================================================== */
@media (max-width: 768px) {
    /* MODALES GLOBALES (Abonnés, Réglages...) */
    .close-modal-btn { top: max(20px, calc(env(safe-area-inset-top) + 10px)) !important; background: transparent !important; color: white; right: 20px !important; left: auto !important; }
    
    .create-post-modal, .settings-modal-content { width: 100% !important; height: 100% !important; max-height: 100vh !important; border-radius: 0; }
    
    .settings-body { flex-direction: column; overflow-y: auto; }
    .settings-sidebar { width: 100% !important; min-width: 100% !important; flex-direction: row; border-right: none; border-bottom: 1px solid #e2e8f0; padding: 0; overflow-x: auto; flex-shrink: 0; background: #ffffff; }
    .settings-tab { padding: 15px 20px; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .settings-tab.active { border-bottom-color: #79d4ad; border-left: none; }
    .settings-content { padding: 20px; overflow-y: visible; flex: 1; }

    /* ================================================= */
    /* DESIGN MOBILE NATIVE + FEED                       */
    /* ================================================= */
    
    /* 1. Éradication absolue des flèches sur mobile */
    .preview-nav-prev, .preview-nav-next, .carousel-prev, .carousel-next, .lb-nav-prev, .lb-nav-next { display: none !important; }

    /* 2. Header "App Native" (plus fin, marges réduites) */
    .fb-modal-header { 
        padding-top: env(safe-area-inset-top) !important; 
        min-height: calc(48px + env(safe-area-inset-top)) !important; 
        height: auto !important;
        border-bottom: 1px solid #f1f5f9 !important;
        padding-bottom: 0 !important;
    }
    .fb-modal-header h2 { font-size: 0.92rem !important; white-space: nowrap !important; }
    .cancel { font-size: 24px !important; }
    .header-btn { font-size: 0.85rem !important; padding: 4px 10px !important; white-space: nowrap !important; }

    /* 3. La Modale de Création */
    .create-post-modal { height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
    .create-body { display: block !important; overflow-y: auto !important; height: calc(100dvh - 48px - env(safe-area-inset-top)) !important; }
    
    .step-preview { display: block !important; height: auto !important; }
    .step-preview.d-none { display: none !important; }
    .step-details.d-none { display: none !important; }
    .preview-container { display: block !important; height: auto !important; }
    .main-preview-area { width: 100% !important; height: auto !important; max-height: none !important; display: block !important; border-bottom: none !important; background: #ffffff !important; overflow: hidden !important; }
    #main-preview-img { width: 100% !important; height: auto !important; max-height: 60vh !important; object-fit: contain !important; display: block !important; }
    .thumbnails-sidebar { position: static !important; width: 100% !important; height: auto !important; background: #ffffff !important; padding: 15px !important; display: flex !important; align-items: center; border-radius: 0 !important; border-top: 1px solid #f1f5f9 !important; }
    .thumbnails-sidebar .add-more-photos { background: #f1f5f9 !important; border: 1px dashed #cbd5e1 !important; color: #64748b !important; width: 44px; height: 44px; }
    .thumbnails-sidebar .add-more-photos:hover { background: #e2e8f0 !important; }
    
    .step-details { display: block !important; height: auto !important; flex-direction: column !important; }
    .details-media { width: 100% !important; height: auto !important; max-height: none !important; display: block !important; border-right: none !important; border-bottom: 1px solid #f1f5f9 !important; background: #ffffff !important; overflow: hidden !important; }
    #details-current-img { width: 100% !important; height: auto !important; max-height: 50vh !important; object-fit: contain !important; display: block !important; }
    .details-sidebar { width: 100% !important; height: auto !important; display: block !important; }
    .details-caption-area textarea { min-height: 120px !important; }

    /* 4. La Visionneuse Lightbox (Restructurée) */
    #view-post-modal { position: fixed !important; inset: 0 !important; align-items: flex-start !important; padding: 0 !important; }
    
    /* LE BOUCLIER ANTI-CHAINING POUR SAFARI iOS */
    #view-post-modal .post-lightbox-content { 
        display: flex !important; flex-direction: column !important; 
        width: 100% !important; height: 100dvh !important; 
        max-height: none !important; border-radius: 0 !important; 
        background: #ffffff !important; overflow-y: auto !important; 
        overflow-x: hidden !important; padding: 0 !important; justify-content: flex-start !important;
        overscroll-behavior: none !important; margin: 0 !important; box-shadow: none !important;
    }
    
    #view-post-modal .lb-sidebar { display: contents !important; } 

    /* A. Navigation Mobile (Top Nav) */
    #view-post-modal .lb-mobile-top-nav {
        order: 0; display: flex !important; align-items: center; justify-content: center;
        width: 100%; height: 44px; min-height: 44px;
        padding-top: env(safe-area-inset-top); padding-bottom: 0;
        box-sizing: content-box; border-bottom: 1px solid #f1f5f9;
        background: #ffffff; position: relative; flex-shrink: 0;
    }
    #view-post-modal .lb-back-btn {
        position: absolute; left: 10px; bottom: 0; height: 44px; width: 44px;
        background: transparent; border: none; display: flex; align-items: center; justify-content: center;
        color: #0f172a; padding: 0; cursor: pointer; font-size: 24px;
    }
    #view-post-modal .lb-top-title {
        font-size: 1rem; font-weight: 700; color: #0f172a; margin: 0;
    }
    
    /* B. Le Header (Blanc, Compact) */
    #view-post-modal .lb-header { 
        order: 1; position: relative !important; top: 0 !important; border-bottom: none !important; 
        padding: 10px 15px !important; flex-shrink: 0; background: #ffffff !important; 
    }
    
    /* C. L'Image : Format portrait Instagram 4/5 */
    #view-post-modal .lb-media { 
        order: 2; width: 100% !important; height: auto !important;
        aspect-ratio: 4/5 !important;
        flex: none !important;
        max-height: none !important;
        display: block !important; border: none !important; background: #ffffff !important; flex-shrink: 0; 
        overflow: hidden !important; border-right: none !important; margin: 0 !important; padding: 0 !important;
    }
    #view-post-modal #lb-main-img { 
        width: 100% !important; height: 100% !important; max-height: none !important;
        object-fit: cover !important; display: block !important; margin: 0 !important; padding: 0 !important;
    }
    
    /* D. LA BARRE D'ACTION : Collée SOUS l'image */
    #view-post-modal .lb-action-bar { 
        order: 3; position: static !important; width: 100% !important; 
        background: #ffffff !important; box-shadow: none !important; 
        padding: 8px 12px !important; border-bottom: none !important; flex-shrink: 0; margin: 0 !important; 
        border-top: none !important;
    }
    
    /* E. La Légende prend la suite */
    #view-post-modal .lb-caption-read-only { 
        order: 4; flex-shrink: 0; overflow: visible !important; 
        background: #ffffff !important; padding: 0 15px 40px 15px !important;
        font-size: 0.95rem !important;
    }
    
    #view-post-modal .carousel-dots { bottom: 15px !important; z-index: 10 !important; }
}

/* =========================================================
   CLASSES COMMUNES — DESIGN SYSTEM MAPIRANDO (MAPI-BOX & MAPI-PANEL)
   ========================================================= */

.mapi-modal-box { 
    background: #ffffff; border-radius: 24px; padding: 36px 32px; 
    max-width: 420px; width: 90%; text-align: center; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.15); position: relative; margin: auto; 
}

.mapi-modal-panel { 
    background: #ffffff; border-radius: 24px; width: 90%; max-width: 500px; 
    display: flex; flex-direction: column; overflow: hidden; max-height: 85vh; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.15); margin: auto; 
}

/* FIX SPÉCIFIQUE NOTIFICATIONS : Forcer une hauteur pour activer le scroll */
#notifications-modal .mapi-modal-panel {
    height: 65vh;
    min-height: 400px;
}

.mapi-modal-panel-header { 
    padding: 18px 20px; border-bottom: 1px solid #e2e8f0; display: flex; 
    align-items: center; justify-content: center; position: relative; flex-shrink: 0; background: #fff; 
}
.mapi-modal-panel-header h2 { 
    font-size: 1.15rem; font-weight: 800; color: #0f172a; margin: 0; font-family: 'Nunito', sans-serif; 
}
.mapi-modal-panel-header .close-modal-btn { 
    position: absolute; top: 50% !important; right: 16px !important; transform: translateY(-50%) !important; 
    color: #0f172a !important; font-size: 28px !important; width: 32px !important; height: 32px !important; 
    background: transparent !important; 
}

.mapi-modal-panel-body { flex: 1; overflow-y: auto; background: #f8fafc; }

.mapi-modal-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.mapi-modal-icon.danger  { color: #ef4444; }
.mapi-modal-icon.success { color: #10b981; }
.mapi-modal-icon.info    { color: #3b82f6; }
.mapi-modal-icon.warning { color: #f59e0b; }

.mapi-modal-title { font-size: 1.3rem; font-weight: 800; color: #0f172a; margin: 0 0 10px 0; font-family: 'Nunito', sans-serif; }
.mapi-modal-text  { color: #475569; font-size: 0.95rem; line-height: 1.5; margin: 0 0 24px 0; font-family: 'Nunito', sans-serif; }

.mapi-modal-btn-row { display: flex; flex-direction: column; gap: 10px; }

/* GARANTIE D'AFFICHAGE FLOTTANT ET CENTRÉ SUR MOBILE */
@media (max-width: 768px) {
    .mapi-modal-box { 
        width: 92% !important; 
        padding: 30px 20px; 
        border-radius: 24px !important; 
    }
    .mapi-modal-panel { 
        width: 92% !important; 
        max-height: 85vh !important; 
        border-radius: 24px !important; 
    }
    .mapi-modal-panel-header { 
        padding: 15px 20px; 
    }
}

/* =========================================================
   HARMONISATION TOTALE DES BOUTONS DES MODALES (STYLE BLOG ABSOLU)
   ========================================================= */
.btn-mapi-dark, .btn-mapi-light,
.mapi-modal-btn-row button,
.settings-edit-group button,
#support-form-wrapper button {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 14px 28px !important;
    border-radius: 50px !important; /* LA FORME PILULE DU BLOG */
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    display: inline-flex; /* SUPPRESSION DU !IMPORTANT POUR AUTORISER LE MASQUAGE JS */
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    border: 1px solid transparent !important;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    font-family: 'Nunito', sans-serif !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-sizing: border-box;
}

/* LE SURVOL QUI REMPLIT EN NOIR PROFOND */
.btn-mapi-dark:hover, .btn-mapi-light:hover,
.mapi-modal-btn-row button:hover,
.settings-edit-group button:hover,
#support-form-wrapper button:hover {
    background: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 15px 35px rgba(15,23,42,0.2) !important;
    border-color: #0f172a !important;
    transform: none !important;
}

/* LA MORT DU DRAPEAU ROUGE FANTÔME (Écrasement du ::before / ::after du thème) */
.btn-mapi-dark::before, .btn-mapi-dark::after,
.btn-mapi-light::before, .btn-mapi-light::after,
.mapi-modal-btn-row button::before, .mapi-modal-btn-row button::after,
.settings-edit-group button::before, .settings-edit-group button::after,
#support-form-wrapper button::before, #support-form-wrapper button::after {
    display: none !important;
    content: none !important;
}

/* Ajustement spécifique pour les champs très étroits (mobile) */
@media (max-width: 768px) {
    .btn-mapi-dark, .btn-mapi-light,
    .mapi-modal-btn-row button,
    .settings-edit-group button,
    #support-form-wrapper button {
        padding: 12px 20px !important;
        font-size: 0.85rem !important;
    }
}