/* ===========================
   MAINTENANCE GENIUS - Admin CSS
   Design moderne avec onglets et personnalisation
   Couleur de marque : orange #F97316
   =========================== */

/* ========================================
   VARIABLES CSS
   Brand : 1001Web™
   ======================================== */
.mg-wrapper {
    --mg-primary:          #C2410C;  /* Orange Racine vif */
    --mg-primary-dark:     #C2410C;  /* Hover/active */
    --mg-primary-light:    #FED7AA;  /* Backgrounds subtils */
    --mg-primary-gradient: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);

    --mg-text:             #1f2937;
    --mg-text-muted:       #6b7280;
    --mg-border:           #e5e7eb;
}

/* ========================================
   RESET & BOX-SIZING GLOBAL
   Correction du débordement des accordéons
   ======================================== */
.mg-wrapper,
.mg-wrapper *,
.mg-wrapper *::before,
.mg-wrapper *::after {
    box-sizing: border-box;
}

/* ========================================
   CACHER LE FOOTER WORDPRESS ADMIN
   Le texte "Merci de faire de WordPress..." était intrusif
   ======================================== */
.toplevel_page_mgenius-settings #wpfooter {
    display: none !important;
}

/* Étendre le contenu pour occuper tout l'espace */
.toplevel_page_mgenius-settings #wpcontent {
    padding-bottom: 20px !important;
}

/* ========================================
   TOOLTIPS PERSONNALISÉS
   Utilise JS pour éviter les problèmes de coupure
   ======================================== */

/* Tooltip container (généré par JS) */
.mg-tooltip-box {
    position: fixed;
    z-index: 999999;
    padding: 10px 14px;
    background: linear-gradient(135deg, #2d3436 0%, #1e272e 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 280px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mg-tooltip-box.visible {
    opacity: 1;
}

.mg-tooltip-box::after {
    content: '';
    position: absolute;
    border: 8px solid transparent;
}

.mg-tooltip-box.arrow-bottom::after {
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #1e272e;
}

.mg-tooltip-box.arrow-top::after {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #1e272e;
}

/* Icône info pour les tooltips */
.mg-field-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1.7;
    color: #fff;
    background: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);
    border-radius: 999px;
    vertical-align: middle;
}
.mg-field-tag--soft {
    background: #e2e8f0;
    color: #475569;
}

.mg-info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    cursor: help;
    vertical-align: middle;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mg-info-tooltip:hover {
    background: linear-gradient(135deg, #a366bd 0%, #8855b5 100%);
    transform: scale(1.1);
}

/* Reset et base */
.mg-wrapper {
    margin: 20px 20px 0 0;
}

/* Upload zone pour image de fond */
.mg-upload-zone {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.mg-upload-zone:hover {
    border-color: #C2410C;
    background: #faf8fc;
}

.mg-upload-preview {
    width: 100%;
    max-width: 400px;
    height: 200px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-upload-placeholder {
    color: #4B5563;
    font-size: 14px;
}

.mg-upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

/* Header avec gradient */
.mg-header {
    background: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);
    padding: 35px 40px;
    box-shadow: 0 4px 20px rgba(147, 83, 172, 0.3);
    margin-bottom: 0;
}

.mg-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mg-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-header-left h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.mg-version {
    background: rgba(0, 0, 0, 0.22);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.mg-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-toggle-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Toggle moderne */
.mg-switch-modern {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.mg-switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mg-slider-modern {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: .4s;
    border-radius: 32px;
}

.mg-slider-modern:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .mg-slider-modern {
    background-color: #4CAF50;
}

input:checked + .mg-slider-modern:before {
    transform: translateX(28px);
}

/* Badge status */
.mg-status-badge {
    background: rgba(0, 0, 0, 0.22);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.mg-status-badge.active {
    background: linear-gradient(135deg, #15803D 0%, #166534 100%);
    box-shadow: 0 0 20px rgba(0, 210, 106, 0.6), 
                0 0 40px rgba(0, 210, 106, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: mg-pulse-glow 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mg-status-badge.inactive {
    background: rgba(0, 0, 0, 0.28);
    box-shadow: none;
}

@keyframes mg-pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 210, 106, 0.6), 
                    0 0 40px rgba(0, 210, 106, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 210, 106, 0.8), 
                    0 0 60px rgba(0, 210, 106, 0.5),
                    inset 0 1px 0 rgba(255, 255, 255, 0.4);
        transform: scale(1.05);
    }
}

/* Onglets */
.mg-tabs-wrapper {
    background: #ffffff;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mg-tabs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 5px;
}

.mg-tab {
    background: transparent;
    border: none;
    padding: 18px 30px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.mg-tab:hover {
    color: #C2410C;
    background: rgba(147, 83, 172, 0.05);
}

.mg-tab.active {
    color: #C2410C;
    border-bottom-color: #C2410C;
    background: rgba(147, 83, 172, 0.08);
}

/* Contenu principal */
.mg-content {
    max-width: 1400px;
    margin: 30px auto 40px;
    padding: 0 40px; /* Aligné avec header et tabs (était 20px) */
    width: 100%;
}

/* Tab content */
.mg-tab-content {
    display: none;
    width: 100%;
}

.mg-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.mg-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: visible; /* Permettre le contenu visible */
}

.mg-card-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mg-card-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #C2410C;
}

.mg-card-body {
    padding: 30px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.mg-card-body .mg-accordion {
    width: 100%;
    max-width: 100%;
}

/* Section title */
.mg-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #C2410C;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Form groups */
.mg-form-group {
    margin-bottom: 25px;
}

.mg-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.mg-form-group input[type="text"],
.mg-form-group input[type="password"],
.mg-form-group textarea,
.mg-form-group select {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 48px;
}

#mg-visitor-duration { max-width: 500px; }
.mg-vad-custom { max-width: 500px; }

.mg-form-group input:focus,
.mg-form-group textarea:focus,
.mg-form-group select:focus {
    outline: none;
    border-color: #C2410C;
}

.mg-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.mg-form-group select {
    cursor: pointer;
}

.mg-field-description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Form row (2 colonnes) */
.mg-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.mg-form-row .mg-form-group {
    margin-bottom: 0;
}

.mg-form-group.mg-half {
    flex: 1;
}

/* Color picker WordPress */
.mg-color-picker {
    max-width: 200px !important;
}

.wp-picker-container {
    max-width: 200px;
}

.wp-picker-container .wp-color-result {
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
}

.wp-picker-container .wp-color-result:hover {
    border-color: #C2410C;
}

/* Range slider */
.mg-range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-range-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.mg-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #C2410C;
    cursor: pointer;
    transition: all 0.3s;
}

.mg-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(147, 83, 172, 0.1);
}

.mg-range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #C2410C;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.mg-range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(147, 83, 172, 0.1);
}

.mg-range-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #C2410C;
    font-size: 15px;
}

/* Range input dans le container */
.mg-range-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.mg-range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #C2410C;
    cursor: pointer;
    transition: all 0.3s;
}

.mg-range-container input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mg-range-container input[type="range"]:disabled::-webkit-slider-thumb {
    background: #999;
    cursor: not-allowed;
}

/* Checkbox custom */
.mg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.mg-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Logo upload */
.mg-logo-upload {
    max-width: 100%;
}

.mg-logo-preview,
.mg-bg-image-preview {
    margin-bottom: 15px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.mg-logo-placeholder {
    margin-bottom: 15px;
    padding: 30px 20px;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.mg-logo-placeholder p {
    margin: 10px 0 0;
    color: #999;
    font-size: 13px;
}

.mg-logo-preview img {
    max-width: 200px;
    max-height: 100px;
    height: auto;
}

.mg-bg-image-preview img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    border-radius: 4px;
}

.mg-logo-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Separateur */
.mg-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 30px 0;
}

/* Boutons */
.mg-btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.mg-btn-primary {
    background: linear-gradient(135deg, #FB923C 0%, #EA580C 100%);
    color: #ffffff;
}

.mg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.mg-btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.mg-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.mg-btn-danger {
    background: #dc3545;
    color: #ffffff;
}

.mg-btn-danger:hover {
    background: #c82333;
}

.mg-btn-warning {
    background: #ff9800;
    color: #ffffff;
}

.mg-btn-warning:hover {
    background: #e68900;
    transform: translateY(-2px);
}

/* IMPORTANT: Bouton reset ROUGE */
button#mg-reset-design.mg-btn.mg-btn-secondary {
    background: #dc3545 !important;
    color: #ffffff !important;
}

button#mg-reset-design.mg-btn.mg-btn-secondary:hover {
    background: #c82333 !important;
    transform: translateY(-2px) !important;
}

/* Form actions */
.mg-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

/* Contrôles d'opacité */
.mg-opacity-control {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.mg-opacity-control label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

/* Section actions */
.mg-section-actions {
    margin: 25px 0;
    text-align: right;
}

.mg-section-actions .mg-btn {
    min-width: 200px;
}

/* Footer */
/* Footer → see the block below */

/* Responsive */
@media (max-width: 782px) {
    .mg-wrapper {
        margin: 10px 10px 0 0;
    }

    .mg-header {
        padding: 25px 20px;
    }

    .mg-header-content {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .mg-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .mg-tabs {
        padding: 0 20px;
        overflow-x: auto;
    }

    .mg-tab {
        padding: 15px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .mg-content {
        padding: 0 20px;
    }

    .mg-card-body {
        padding: 20px;
    }

    .mg-form-row {
        flex-direction: column;
        gap: 0;
    }

    .mg-form-row .mg-form-group {
        margin-bottom: 25px;
    }

    .mg-form-actions {
        flex-direction: column;
    }

    .mg-btn {
        width: 100%;
        text-align: center;
    }

    .mg-logo-buttons {
        flex-direction: column;
    }
}

/* ========================================
   PRESETS DESIGN
   ======================================== */
.mg-presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .mg-presets-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .mg-presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .mg-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mg-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mg-preset-btn:hover {
    border-color: #C2410C;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(147, 83, 172, 0.25);
}

.mg-preset-btn.active {
    border-color: #C2410C;
    background: linear-gradient(135deg, #f8f4fa 0%, #f0e8f5 100%);
    box-shadow: 0 4px 12px rgba(147, 83, 172, 0.2);
}

.mg-preset-preview {
    width: 100%;
    height: 50px;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Simuler un mini container dans le preview */
.mg-preset-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.mg-preset-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ========================================
   CHECKBOX GRID (Accès)
   ======================================== */
.mg-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.mg-checkbox-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.mg-checkbox-grid .mg-checkbox-label {
    margin: 0;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.mg-checkbox-grid .mg-checkbox-label:hover {
    border-color: #C2410C;
}

.mg-checkbox-grid .mg-checkbox-label small {
    display: block;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* ========================================
   LOGS TABLE
   ======================================== */
.mg-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mg-logs-table th,
.mg-logs-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mg-logs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.mg-logs-table tr:hover {
    background: #f8f9fa;
}

.mg-logs-table td:first-child {
    white-space: nowrap;
    font-size: 12px;
    color: #666;
}

.mg-logs-table td:nth-child(2) {
    font-family: monospace;
    font-size: 12px;
}

.mg-logs-table td:nth-child(3) {
    color: #e94560;
    font-weight: 500;
}

.mg-logs-table td:nth-child(4) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #888;
}

/* ========================================
   TEXTAREA ACCESS
   ======================================== */
#tab-access textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.3s;
}

#tab-access textarea:focus {
    outline: none;
    border-color: #C2410C;
}

#tab-access textarea::placeholder {
    color: #aaa;
}

/* ========================================
   PASSWORD FIELD - Toggle & Copy
   ======================================== */

/* Wrapper */
.mg-password-field-wrapper {
    position: relative;
    max-width: 500px;
}

/* Input group */
.mg-password-input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    min-height: 48px;
    background: #fff;
}

.mg-password-input-group:focus-within {
    border-color: #C2410C;
    box-shadow: 0 0 0 3px rgba(147, 83, 172, 0.1);
}

/* Input - Override default styles */
.mg-form-group .mg-password-input {
    flex: 1;
    border: none !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 0;
    border-radius: 0 !important;
}

.mg-form-group .mg-password-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Actions container */
.mg-password-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
}

/* Buttons base */
.mg-password-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mg-password-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.mg-password-btn:focus {
    outline: 2px solid #F97316;
    outline-offset: -2px;
}

.mg-copy-password:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mg-copy-password:disabled:hover {
    background: transparent;
    color: #666;
}

/* Toggle active state */
.mg-toggle-password.active {
    color: #C2410C;
    background: rgba(147, 83, 172, 0.1);
}

/* Copy success state */
.mg-copy-password.copied {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* Generate button */
.mg-generate-password:hover {
    color: #C2410C;
    background: rgba(147, 83, 172, 0.1);
}

.mg-generate-password.generating {
    animation: mg-spin 0.5s ease;
}

@keyframes mg-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Status message */
.mg-password-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.mg-password-status .mg-status-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.mg-password-status.mg-status-success {
    color: #4CAF50;
}

.mg-password-status.mg-status-success strong {
    color: #4CAF50;
}

/* Toast notification */
.mg-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
}

.mg-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
    .mg-password-field-wrapper {
        max-width: 100%;
    }
    
    .mg-password-actions {
        padding: 4px;
    }
    
    .mg-password-toggle,
    .mg-password-copy,
    .mg-password-generate {
        width: 32px;
        height: 32px;
    }
    
    .mg-password-toggle svg,
    .mg-password-copy svg,
    .mg-password-generate svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   ACCÈS PERSONNALISÉS
   ======================================== */

/* Stats cards */
.mg-access-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.mg-stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.mg-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #C2410C;
    line-height: 1;
}

.mg-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Config bar */
.mg-access-config {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mg-access-limit {
    font-size: 13px;
    color: #666;
}

.mg-access-limit strong {
    color: #C2410C;
}

.mg-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.mg-btn-icon:hover {
    background: #e0e0e0;
    color: #333;
}

/* Tokens table */
.mg-tokens-table-wrapper {
    overflow-x: auto;
}

.mg-tokens-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mg-tokens-table th,
.mg-tokens-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mg-tokens-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mg-tokens-table tr:hover {
    background: #fafafa;
}

.mg-tokens-table .mg-token-name {
    font-weight: 600;
    color: #333;
}

.mg-tokens-table .mg-token-email {
    font-size: 11px;
    color: #888;
    display: block;
}

.mg-tokens-table .mg-token-expired {
    opacity: 0.5;
}

.mg-tokens-table .mg-token-expired td {
    color: #999;
}

.mg-token-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.mg-token-status.active {
    background: #4CAF50;
}

.mg-token-status.expired {
    background: #dc3545;
}

.mg-token-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mg-token-link-btn:hover {
    background: #e0e0e0;
}

.mg-token-link-btn.copied {
    background: #4CAF50;
    color: #fff;
}

.mg-token-actions {
    display: flex;
    gap: 5px;
}

.mg-token-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.mg-token-action-btn:hover {
    background: #f0f0f0;
}

.mg-token-action-btn.delete:hover {
    background: #ffebee;
    color: #dc3545;
}

.mg-token-action-btn.email:hover {
    background: #e3f2fd;
    color: #2196f3;
}

/* Modal */
.mg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.mg-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: mgModalIn 0.3s ease;
}

.mg-modal-small {
    max-width: 400px;
}

@keyframes mgModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.mg-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.mg-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.mg-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.mg-modal-body {
    padding: 25px;
}

.mg-modal-body .mg-form-group {
    margin-bottom: 20px;
}

.mg-modal-body .mg-form-group:last-child {
    margin-bottom: 0;
}

.mg-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Token URL display */
.mg-token-url-display {
    display: flex;
    gap: 10px;
}

.mg-token-url-display input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    background: #f8f9fa;
}

/* Responsive for stats */
@media (max-width: 600px) {
    .mg-access-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mg-stat-value {
        font-size: 24px;
    }
    
    .mg-tokens-table {
        font-size: 12px;
    }
    
    .mg-tokens-table th,
    .mg-tokens-table td {
        padding: 8px 6px;
    }
    
    .mg-modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* ========================================
   BOUTONS FLOTTANTS
   ======================================== */
.mg-floating-buttons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mg-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.mg-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.mg-float-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-float-icon svg {
    width: 22px;
    height: 22px;
}

.mg-float-label {
    position: absolute;
    right: 60px;
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.mg-float-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #333;
}

.mg-float-btn:hover .mg-float-label {
    opacity: 1;
    visibility: visible;
    right: 65px;
}

/* Toggle ON/OFF */
.mg-float-toggle {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
}

.mg-float-toggle.is-on {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.mg-float-toggle.is-off {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Preview */
.mg-float-preview {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
}

/* Save */
.mg-float-save {
    background: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);
    color: #fff;
}

.mg-float-save.saving {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    animation: mg-pulse 0.8s infinite;
}

.mg-float-save.saved {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

@keyframes mg-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Responsive floating buttons */
@media (max-width: 782px) {
    .mg-floating-buttons {
        right: 10px;
        bottom: 80px;
        top: auto;
        transform: none;
    }
    
    .mg-float-btn {
        width: 44px;
        height: 44px;
    }
    
    .mg-float-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .mg-float-label {
        display: none;
    }
}

/* ========================================
   ONGLET AIDE & SYSTÈME
   ======================================== */

.mg-system-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.mg-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.mg-info-row:last-child {
    border-bottom: none;
}

.mg-info-label {
    color: #666;
    font-size: 14px;
}

.mg-info-value {
    font-size: 14px;
    color: #333;
}

.mg-help-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mg-help-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* v2.9.181 — bouton « Rouvrir l'assistant » au même aspect que les liens */
button.mg-help-link {
    border: 0;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.mg-help-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.mg-help-icon {
    font-size: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   Collapsible Sections (Accordion) - 1001Web Style
   Correction du layout et alignement
   ═══════════════════════════════════════════════════════════════ */
.mg-accordion {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
}

.mg-accordion:last-child {
    margin-bottom: 0;
}

.mg-accordion:hover,
.mg-accordion.is-open {
    border-color: #C2410C;
    box-shadow: 0 4px 15px rgba(147, 83, 172, 0.15);
}
.mg-accordion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f3f0ff 0%, #ebe4ff 100%);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.mg-accordion.is-open .mg-accordion-header {
    background: linear-gradient(135deg, #e8e0ff 0%, #ddd4ff 100%);
}
.mg-accordion-header:hover {
    background: linear-gradient(135deg, #e0d6ff 0%, #d4c8ff 100%);
}
.mg-accordion-arrow {
    font-size: 12px;
    margin-right: 12px;
    color: #C2410C;
    transition: transform 0.3s ease;
    font-weight: bold;
}
.mg-accordion.is-open .mg-accordion-arrow {
    transform: rotate(90deg);
}
.mg-accordion-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.mg-accordion-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #C2410C;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 11px;
    margin-left: 8px;
    cursor: help;
    font-weight: bold;
}
.mg-accordion-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}
.mg-accordion-badge.mg-badge-ok {
    background: #d4edda;
    color: #155724;
}
.mg-accordion-badge.mg-badge-default {
    background: #e9ecef;
    color: #4B5563;
}
.mg-accordion-body {
    padding: 20px;
    border-top: 2px solid #e8e0ff;
    display: none;
    background: #fff;
}
.mg-accordion.is-open .mg-accordion-body {
    display: block;
    animation: mg-slideDown 0.3s ease;
}
@keyframes mg-slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mg-preset-video .mg-preset-preview {
    position: relative;
}
.mg-video-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}
.mg-preset-video:hover {
    border-color: #e74c3c;
}

/* ═══════════════════════════════════════════════════════════════
   Footer du plugin
   ═══════════════════════════════════════════════════════════════ */
.mg-footer {
    text-align: center;
    padding: 25px 20px;
    margin: 30px 20px 20px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.mg-footer p {
    margin: 0;
    color: #4B5563;
    font-size: 13px;
}

.mg-footer a {
    color: #C2410C;
    text-decoration: none;
    font-weight: 600;
}

.mg-footer a:hover {
    color: #C2410C;
    text-decoration: underline;
}

/* ========================================
   EXPAND/COLLAPSE ALL BUTTONS
   ======================================== */
.mg-accordion-controls {
    display: flex;
    gap: 8px;
}

.mg-btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

.mg-btn-expand-all,
.mg-btn-collapse-all {
    background: #f0f0f1 !important;
    color: #50575e !important;
    border: 1px solid #c3c4c7 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mg-btn-expand-all:hover,
.mg-btn-collapse-all:hover {
    background: #C2410C !important;
    color: #fff !important;
    border-color: #C2410C !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Auto-save : états du bouton intelligent
   États : idle (normal) / pending / saving / saved / error
   ═══════════════════════════════════════════════════════════════════ */
.mg-section-save.is-pending,
#mg-save-design.is-pending,
#mg-save-animations.is-pending,
#mg-float-save.is-pending {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border: 1px solid #fed7aa !important;
}
.mg-section-save.is-saving,
#mg-save-design.is-saving,
#mg-save-animations.is-saving,
#mg-float-save.is-saving {
    background: #C2410C !important;
    color: #fff !important;
    cursor: wait;
    opacity: 0.85;
}
.mg-section-save.is-saved,
#mg-save-design.is-saved,
#mg-save-animations.is-saved,
#mg-float-save.is-saved {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.3s ease;
}
.mg-section-save.is-error,
#mg-save-design.is-error,
#mg-save-animations.is-error,
#mg-float-save.is-error {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    animation: mgShake 0.4s;
}
@keyframes mgShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

#mg-float-save.is-pending { animation: mgPulseFab 1.4s infinite; }
#mg-float-save.is-saving { opacity: 0.9; }
#mg-float-save.is-saving .mg-float-icon { display: inline-flex; animation: mgSpinFab 1s linear infinite; }
#mg-float-save.is-saved { background: #16a34a !important; color: #fff !important; transition: background 0.3s; }
#mg-float-save.is-error { background: #dc2626 !important; color: #fff !important; animation: mgShake 0.4s; }

@keyframes mgPulseFab {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}
@keyframes mgSpinFab {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================================
 * Barre de recherche réglages + Arrière-plan unifié
 * ========================================================= */

/* ---- Barre de recherche réglages ---- */
.mg-settings-search {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 40px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.mg-settings-search .mg-search-icon {
    color: var(--mg-text-muted, #6b7280);
    flex-shrink: 0;
}
.mg-settings-search-input {
    flex: 1;
    max-width: 420px;
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--mg-text, #1f2937);
    background: #fff;
    border: 1.5px solid var(--mg-border, #e5e7eb);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.mg-settings-search-input:focus {
    border-color: var(--mg-primary, #C2410C);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .15);
}
.mg-settings-search-clear {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--mg-border, #e5e7eb);
    color: var(--mg-text, #1f2937);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.mg-settings-search-clear:hover { background: #d1d5db; }
.mg-search-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--mg-primary-dark, #C2410C);
}
/* En mode recherche, on masque la barre d'onglets (résultats transversaux) */
body.mg-searching .mg-tabs { opacity: .4; pointer-events: none; }
.mg-search-hit { animation: mg-search-pop .18s ease; }
@keyframes mg-search-pop {
    from { background: rgba(249, 115, 22, .10); }
    to   { background: transparent; }
}

/* ---- Arrière-plan unifié ---- */
.mg-bg-unified {
    border: 1.5px solid var(--mg-primary-light, #FED7AA);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(249,115,22,.04) 0%, rgba(249,115,22,0) 60%);
    padding: 16px;
    margin: 0 0 18px;
}
.mg-bg-unified-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.mg-bg-unified-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--mg-text, #1f2937);
}
.mg-bg-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
}
.mg-bg-seg {
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mg-text-muted, #6b7280);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.mg-bg-seg:hover { color: var(--mg-primary-dark, #C2410C); }
.mg-bg-seg.is-active {
    background: var(--mg-primary, #C2410C);
    color: #fff;
    box-shadow: 0 2px 6px rgba(249, 115, 22, .35);
}
.mg-bg-host .mg-bg-panel { margin-bottom: 10px; }
.mg-bg-host .mg-bg-panel:last-child { margin-bottom: 0; }

/* =========================================================
 * Bouton "Save background" + feedback FAB lisible
 *           (s'appuie sur l'autosave natif is-pending/is-saving/is-saved)
 * ========================================================= */

/* Bouton "Enregistrer l'arrière-plan" dans la barre du sélecteur */
.mg-bg-unified-head { justify-content: space-between; }
.mg-bg-save { margin-left: auto; white-space: nowrap; align-self: center; }

/* Étiquette d'état claire à gauche du FAB, pilotée par les classes natives.
   Le bouton ne tournant plus (seule l'icône tourne), l'étiquette reste stable. */
.mg-float-save { position: relative; }
.mg-float-save::before {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    z-index: 5;
}
.mg-float-save.is-pending::before { content: attr(data-label-pending); background: #C2410C; opacity: 1; }
.mg-float-save.is-saving::before  { content: attr(data-label-saving);  background: #6b7280; opacity: 1; }
.mg-float-save.is-saved::before   { content: attr(data-label-saved);   background: #16A34A; opacity: 1; }
.mg-float-save.is-error::before   { content: attr(data-label-error);   background: #EF4444; opacity: 1; }

/* Pendant un état, on masque le tooltip "Enregistrer" natif pour éviter la double bulle */
.mg-float-save.is-pending .mg-float-label,
.mg-float-save.is-saving .mg-float-label,
.mg-float-save.is-saved .mg-float-label,
.mg-float-save.is-error .mg-float-label { display: none !important; }

/* =========================================================
 * Tooltip FAB unifié.
 * Position FIXE à gauche du bouton au repos ET au survol → ne peut
 * jamais glisser/déborder sur le bouton. Apparition via opacity seule.
 * ========================================================= */
.mg-float-btn .mg-float-label {
    position: absolute;
    right: calc(100% + 12px);
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    margin: 0;
    padding: 6px 12px;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
    z-index: 7;
}
.mg-float-btn:hover .mg-float-label,
.mg-float-btn:focus-visible .mg-float-label {
    right: calc(100% + 12px) !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: #1f2937 !important;
    color: #fff !important;
}
.mg-float-btn .mg-float-label {
    opacity: 0 !important;
    visibility: hidden !important;
    right: calc(100% + 12px) !important;
    left: auto !important;
}
.mg-float-btn:hover .mg-float-label,
.mg-float-btn:focus-visible .mg-float-label {
    opacity: 1 !important;
    visibility: visible !important;
}
.mg-float-btn .mg-float-label::after {
    content: '';
    position: absolute;
    right: -5px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #1f2937;
}

/* =========================================================
 * Titres de groupe (Identité / Mise en page / Effets)
 * Rythme visuel pour casser la monotonie des cartes empilées.
 * ========================================================= */
.mg-group-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #9ca3af;
}
.mg-group-heading span { white-space: nowrap; }
.mg-group-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #e5e7eb 0%, transparent 100%);
}

/* =========================================================
 * Aplatir les panneaux dans le host
 * Fin du « cadre-dans-cadre » : le panneau de fond actif devient
 * du contenu de la carte Arrière-plan, sans second encadrement.
 * ========================================================= */
#mg-bg-host .mg-bg-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    margin: 0;
}
#mg-bg-host .mg-bg-panel:hover,
#mg-bg-host .mg-bg-panel.is-open {
    border-color: transparent;
    box-shadow: none;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-header,
#mg-bg-host .mg-bg-panel.is-open > .mg-accordion-header,
#mg-bg-host .mg-bg-panel > .mg-accordion-header:hover {
    background: transparent;
    padding: 4px 2px 10px;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-body {
    border-top: none;
    background: transparent;
    padding: 4px 2px 2px;
}

/* =========================================================
 * Arrière-plan pliable comme les autres accordéons
 * ========================================================= */
.mg-bg-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.mg-bg-toggle .mg-accordion-arrow {
    transform: rotate(0deg);
}
.mg-bg-unified.is-open .mg-bg-toggle .mg-accordion-arrow {
    transform: rotate(90deg);
}
.mg-bg-unified:not(.is-open) #mg-bg-host {
    display: none;
}

/* =========================================================
 * Arrière-plan : même style que les autres accordéons
 * (bordure grise + bandeau violet) + chevron unique.
 * ========================================================= */
.mg-bg-unified {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
}
.mg-bg-unified:hover,
.mg-bg-unified.is-open {
    border-color: #C2410C;
    box-shadow: 0 4px 15px rgba(147, 83, 172, 0.15);
}
.mg-bg-unified-head {
    background: linear-gradient(135deg, #f3f0ff 0%, #ebe4ff 100%);
    padding: 16px 20px;
    margin-bottom: 0;
}
.mg-bg-unified.is-open .mg-bg-unified-head {
    background: linear-gradient(135deg, #e8e0ff 0%, #ddd4ff 100%);
}
#mg-bg-host {
    padding: 20px;
    border-top: 2px solid #e8e0ff;
    background: #fff;
}

/* Chevron unique : le bloc Arrière-plan gère le pliage ; le panneau interne
 * (Image/Dégradé/…) n'a plus de chevron ni de pliage propre. */
#mg-bg-host .mg-bg-panel > .mg-accordion-header .mg-accordion-arrow {
    display: none;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-header {
    cursor: default;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-body {
    display: block !important;
}

/* =========================================================
 * Mode Simple / Expert
 * ========================================================= */
.mg-tabs { flex-wrap: wrap; align-items: center; }
.mg-mode-switch {
    margin-left: auto;
    display: inline-flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 3px;
    align-self: center;
}
.mg-mode-seg {
    border: none;
    background: transparent;
    padding: 5px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.mg-mode-seg.is-active {
    background: #fff;
    color: #C2410C;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.mg-mode-hint {
    display: none;
    max-width: 1400px;
    margin: 16px auto 0;
    padding: 9px 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 13px;
    color: #9a3412;
}
.mg-mode-simple .mg-mode-hint { display: block; }
.mg-mode-hint-link {
    border: none;
    background: none;
    color: #C2410C;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 4px;
}
/* v2.9.174 : pendant une recherche, les réglages Expert qui correspondent
   s'affichent aussi en mode Simple (la recherche ne répond plus « No setting
   found » pour un réglage actif). Les onglets Expert restent cachés. */
body:not(.mg-searching) .mg-mode-simple [data-mg-level="advanced"],
body.mg-searching .mg-mode-simple [data-mg-level="advanced"]:not(.mg-search-hit),
.mg-mode-simple .mg-tab[data-mg-level="advanced"] { display: none !important; }

.mg-float-label { display: none !important; }

/* ============================================================
   DIAGNOSTIC
   ============================================================ */

/* Pastille onglet (pattern WP natif) */
.mg-diag-pill {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    vertical-align: middle;
}
.mg-diag-pill-fail { background: #d63638; }
.mg-diag-pill-warn { background: #f0a000; }

/* Badges contextuels de section */
.mg-diag-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
}
.mg-diag-badge-never {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.mg-diag-badge-never:hover, .mg-diag-badge-never:focus { background: #e2e8f0; color: #1e293b; }
.mg-diag-badge-fail { animation: mgDiagPulse 2s ease-in-out infinite; }
@keyframes mgDiagPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Bandeau critique */
.mg-diag-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 16px;
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-left-width: 4px;
    border-radius: 6px;
}
.mg-diag-banner-icon { font-size: 18px; }
.mg-diag-banner-text { flex: 1; font-weight: 600; color: #3c1618; }
.mg-diag-banner-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #d63638;
    padding: 2px 6px;
}
.mg-diag-banner-close:hover { color: #a02224; }

/* Onglet — intro + actions */
.mg-diag-intro { color: #555; max-width: 720px; }
.mg-diag-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0;
}
.mg-diag-last { font-size: 12px; color: #888; }

/* Items résultat */
.mg-diag-results { margin-top: 8px; }
.mg-diag-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-left-width: 4px;
    border-radius: 6px;
    transition: box-shadow 0.2s;
}
.mg-diag-item.mg-diag-highlight { box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.4); }
.mg-diag-ok   { border-left-color: #16A34A; }
.mg-diag-warn { border-left-color: #f0a000; }
.mg-diag-fail { border-left-color: #d63638; }
.mg-diag-skip { border-left-color: #c3c4c7; opacity: 0.75; }

.mg-diag-status { font-size: 16px; line-height: 1.4; }
.mg-diag-ok   .mg-diag-status::before { content: '✅'; }
.mg-diag-warn .mg-diag-status::before { content: '⚠️'; }
.mg-diag-fail .mg-diag-status::before { content: '❌'; }
.mg-diag-skip .mg-diag-status::before { content: '➖'; }

.mg-diag-body { flex: 1; }
.mg-diag-label { display: block; font-size: 14px; margin-bottom: 3px; }
.mg-diag-detail { margin: 0 0 4px; color: #555; font-size: 13px; }
.mg-diag-fix {
    margin: 6px 0 0;
    padding: 8px 10px;
    background: #fff8e5;
    border-radius: 4px;
    font-size: 13px;
    color: #6b4e00;
}

/* v2.9.181 — résultat enregistré dans une autre langue */
.mg-diag-lang-note {
    margin: 12px 0 0;
    padding: 8px 10px;
    background: #eef4ff;
    border-radius: 4px;
    font-size: 13px;
    color: #1d3a7a;
}

/* Test courriel */
.mg-diag-email-test {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e4e7;
}
.mg-diag-email-test h3 { margin: 0 0 10px; font-size: 14px; }
.mg-diag-email-row { display: flex; gap: 10px; max-width: 480px; }
.mg-diag-email-row input[type="email"] { flex: 1; }
.mg-diag-email-result { margin-top: 8px; font-size: 13px; }
.mg-diag-email-ok  { color: #16A34A; font-weight: 600; }
.mg-diag-email-err { color: #d63638; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   THÈMES COMPLETS
   ═══════════════════════════════════════════════════════════ */
.mg-themes-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e4e7;
}

.mg-themes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mg-themes-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
}

/* Bouton Annuler à droite */
.mg-themes-header #mg-revert-theme {
    margin-left: auto;
}

/* Grille 4 colonnes responsive */
.mg-themes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .mg-themes-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .mg-themes-grid { grid-template-columns: 1fr 1fr; }
}

/* Carte thème */
.mg-theme-card {
    all: unset;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .12s;
    text-align: left;
}

.mg-theme-card:hover {
    border-color: #c7c7c7;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.mg-theme-card:focus-visible {
    outline: 3px solid #F97316;
    outline-offset: 2px;
}

.mg-theme-card.is-active {
    border-color: #C2410C;
    box-shadow: 0 0 0 3px rgba(249,115,22,.18);
}

/* Mini aperçu gradient */
.mg-theme-preview {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    position: relative;
}

.mg-theme-aa {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.mg-theme-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    opacity: .9;
}

/* Infos sous le preview */
.mg-theme-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mg-theme-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e1e1e;
    line-height: 1.2;
}

.mg-theme-active-badge {
    display: inline-block;
    background: #C2410C;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 20px;
    letter-spacing: .4px;
    width: fit-content;
}

.mg-theme-desc {
    font-size: 11px;
    color: #767676;
    line-height: 1.35;
}

/* ═══════════════════════════════════════════════════════════════
   Mode Selector (Maintenance / Coming Soon)
   ════════════════════════════════════════════════════════════════ */
.mg-mode-selector {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
}
.mg-mode-selector-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.mg-mode-selector-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.mg-mode-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fff;
    position: relative;
}
.mg-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.mg-mode-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.mg-mode-option.is-active {
    border-color: #C2410C;
    background: #fff7ed;
}
.mg-mode-option.is-active .mg-mode-option-title {
    color: #ea580c;
}
.mg-mode-option-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
}
.mg-mode-option-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}
.mg-mode-option-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}
@media (max-width: 600px) {
    .mg-mode-selector-options { grid-template-columns: 1fr; }
}

.mg-status-badge.active.coming-soon {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
    box-shadow: 0 0 20px rgba(22, 163, 74, 0.6),
                0 0 40px rgba(22, 163, 74, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: mg-pulse-glow-cs 2s ease-in-out infinite;
}
@keyframes mg-pulse-glow-cs {
    0%, 100% { box-shadow: 0 0 20px rgba(22,163,74,.6), 0 0 40px rgba(22,163,74,.3), inset 0 1px 0 rgba(255,255,255,.3); }
    50%       { box-shadow: 0 0 30px rgba(22,163,74,.8), 0 0 60px rgba(22,163,74,.4), inset 0 1px 0 rgba(255,255,255,.3); }
}

.mg-header-left { position: relative; }

/* ═══ Assistance guidée ═══ */
.mg-support-block { margin-top: 24px; padding: 18px 20px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; }
.mg-support-block h3 { margin: 0 0 6px; font-size: 15px; color: #9a3412; }
.mg-support-intro { margin: 0 0 12px; font-size: 13px; color: #7c2d12; line-height: 1.6; }
.mg-support-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.mg-support-modal { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; padding: 28px 32px 26px; box-shadow: 0 25px 80px rgba(0,0,0,0.35); }
.mg-support-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 26px; line-height: 1; color: #9ca3af; cursor: pointer; }
.mg-support-close:hover { color: #374151; }
.mg-support-progress { height: 6px; background: #f1f5f9; border-radius: 6px; overflow: hidden; margin-bottom: 22px; }
.mg-support-progress-bar { height: 100%; background: linear-gradient(90deg, #F97316, #FB923C); border-radius: 6px; transition: width 0.35s ease; }
.mg-support-count { font-size: 12px; color: #94a3b8; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.mg-support-step h3 { margin: 0 0 16px; font-size: 19px; color: #1e293b; }
.mg-support-step label { display: block; font-size: 13px; font-weight: 600; color: #475569; margin: 14px 0 5px; }
.mg-support-step textarea, .mg-support-step input[type="email"], .mg-support-step input[type="url"], .mg-support-step select { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.mg-support-step textarea:focus, .mg-support-step input:focus, .mg-support-step select:focus { border-color: #C2410C; outline: 2px solid rgba(249,115,22,0.25); }
.mg-support-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mg-support-choice { text-align: left; padding: 14px 16px; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer; font-size: 13.5px; color: #334155; line-height: 1.4; transition: border-color 0.2s, background 0.2s; }
.mg-support-choice:hover, .mg-support-choice:focus-visible { border-color: #C2410C; background: #fff7ed; }
.mg-support-choice.is-selected { border-color: #C2410C; background: #fff7ed; font-weight: 600; }
.mg-support-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.mg-support-report-note { margin-top: 16px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #166534; line-height: 1.6; }
.mg-support-link { background: none; border: none; padding: 0; color: #C2410C; text-decoration: underline; cursor: pointer; font-size: 12.5px; }
#mg-support-report-preview { margin-top: 12px; max-height: 240px; overflow: auto; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; }
.mg-support-summary { background: #f8fafc; border-radius: 10px; padding: 14px 16px; font-size: 13px; color: #334155; line-height: 1.8; }
.mg-support-delay { margin: 12px 0 0; font-size: 12px; color: #94a3b8; text-align: center; }
.mg-support-result-ok { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 20px; text-align: center; color: #166534; font-size: 14px; line-height: 1.7; }
.mg-support-result-fail { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 18px; color: #92400e; font-size: 13px; line-height: 1.7; }
@media (max-width: 600px) { .mg-support-choices { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mg-support-progress-bar { transition: none; } }

.mg-support-consent { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; color: #475569; line-height: 1.6; font-weight: 400 !important; }
.mg-support-consent input { margin-top: 2px; flex-shrink: 0; }
.mg-support-consent a { color: #C2410C; }

.mg-support-refreshing { display: none; margin-left: 8px; font-size: 12px; color: #64748b; font-style: italic; }
.mg-support-report-note[data-refreshing] .mg-support-refreshing { display: inline; }

/* Vérification de sortie de maintenance — panneau de rapport */
.mg-health-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100050;
    max-width: 460px;
    display: none;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .28);
    background: #fff;
    overflow: hidden;
    border-left: 5px solid #F97316;
}
.mg-health-panel.is-fail { border-left-color: #DC2626; }
.mg-health-panel.is-warn { border-left-color: #F59E0B; }
/* Panneau « ce que reçoit un visiteur » */
.mg-health-panel.mg-health-panel-vc { border-left: 0; max-width: 420px; }
.mg-vc { font-size: 13px; color: #0F172A; }
.mg-vc-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; color: #fff; }
.mg-vc.is-ok .mg-vc-head { background: #15803D; }
.mg-vc.is-warn .mg-vc-head { background: #B45309; }
.mg-vc.is-fail .mg-vc-head { background: #B91C1C; }
.mg-vc-icon { flex: 0 0 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.mg-vc-heading { flex: 1; min-width: 0; }
.mg-vc-title { display: block; font-size: 15px; line-height: 1.3; margin-bottom: 3px; }
.mg-vc-sub { display: block; font-size: 12.5px; line-height: 1.45; opacity: .95; }
.mg-vc-x { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: .85; }
.mg-vc-x:hover, .mg-vc-x:focus-visible { opacity: 1; }
.mg-vc-list { list-style: none; margin: 0; padding: 10px 16px 4px; }
.mg-vc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #E2E8F0; }
.mg-vc-row:last-child { border-bottom: 0; }
.mg-vc-mark { flex: 0 0 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; }
.mg-vc-row.is-ok .mg-vc-mark { background: #15803D; }
.mg-vc-row.is-fail .mg-vc-mark { background: #B91C1C; }
.mg-vc-label { flex: 1; color: #0F172A; }
.mg-vc-foot { padding: 8px 16px 14px; text-align: right; }
.mg-vc-ok { background: #C2410C; color: #fff; border: 0; border-radius: 8px; padding: 8px 18px; font-weight: 600; font-size: 13px; cursor: pointer; }
.mg-vc-ok:hover, .mg-vc-ok:focus-visible { background: #9A3412; }
/* Compte à rebours : message permanent */
.mg-countdown-note { margin-top: 10px; }
.mg-countdown-note-line { margin: 6px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; color: #0F172A; }
.mg-countdown-note-line.is-warn { background: #FFFBEB; border-left: 4px solid #B45309; }
.mg-countdown-note-line.is-info { background: #EFF6FF; border-left: 4px solid #1D4ED8; }
.mg-countdown-note-line .mg-countdown-turn-on { margin-left: 6px; background: #C2410C; color: #fff; border: 0; border-radius: 6px; padding: 5px 12px; font-weight: 600; cursor: pointer; }
.mg-health-inner { padding: 18px 20px 16px; }
.mg-health-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.mg-health-icon { font-size: 20px; line-height: 1.1; }
.mg-health-panel.is-fail .mg-health-icon { color: #DC2626; }
.mg-health-panel.is-warn .mg-health-icon { color: #F59E0B; }
.mg-health-title { font-size: 14.5px; color: #0F172A; line-height: 1.4; }
.mg-health-list { margin: 0 0 14px; padding: 0; list-style: none; }
.mg-health-row {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: #F8FAFC;
    font-size: 12.5px;
    line-height: 1.45;
}
.mg-health-row.is-fail { background: #FEF2F2; }
.mg-health-row.is-warn { background: #FFFBEB; }
.mg-health-url {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    color: #475569;
    word-break: break-all;
    margin-bottom: 2px;
}
.mg-health-note { display: block; color: #0F172A; }
.mg-health-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
    .mg-health-panel { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mg-health-panel { transition: none; }
}

/* Base de connaissances (onglet Aide) */
.mg-kb{margin:0 0 24px;padding:18px 20px;background:#fff;border:1px solid #e5e7eb;border-radius:12px}
.mg-kb-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:6px}
.mg-kb-title{margin:0;font-size:17px;color:#1f2937}
.mg-kb-search{display:flex;align-items:center;gap:10px;flex:1 1 320px;max-width:520px}
.mg-kb-search input[type=search]{flex:1;padding:9px 12px;border:2px solid #e5e7eb;border-radius:8px;font-size:14px}
.mg-kb-search input[type=search]:focus{border-color:#C2410C;outline:none;box-shadow:0 0 0 3px rgba(249,115,22,.15)}
.mg-kb-count{font-size:12px;color:#6b7280;white-space:nowrap}
.mg-kb-cat{margin-top:14px}
.mg-kb-cat-title{margin:0 0 6px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#9a3412}
.mg-kb-item{border:1px solid #f1f5f9;border-radius:8px;margin:0 0 6px;background:#fafafa}
.mg-kb-item[open]{background:#fff;border-color:#fed7aa}
.mg-kb-q{cursor:pointer;padding:10px 14px;font-weight:600;font-size:14px;color:#1f2937;list-style-position:inside}
.mg-kb-q:focus-visible{outline:2px solid #F97316;outline-offset:2px;border-radius:6px}
.mg-kb-a{padding:0 16px 12px;font-size:13px;line-height:1.6;color:#374151}
.mg-kb-a p{margin:6px 0}
.mg-kb-a ol,.mg-kb-a ul{margin:6px 0 6px 20px}
.mg-kb-a code{background:#f3f4f6;padding:1px 5px;border-radius:4px;font-size:12px}
.mg-kb mark{background:#fde68a;color:inherit;padding:0 1px;border-radius:2px}
.mg-kb-empty{margin-top:14px;padding:14px;background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;text-align:center}
.mg-kb-empty p{margin:0 0 10px;color:#7c2d12}

/* Carte « Last update check » (onglet Général) */
.mg-health-card{margin:0 0 20px;padding:14px 18px;border:1px solid #e5e7eb;border-left:4px solid #94a3b8;border-radius:10px;background:#fff}
.mg-health-card.is-ok{border-left-color:#15803D}
.mg-health-card.is-warn,.mg-health-card.is-unverified,.mg-health-card.is-unavailable{border-left-color:#B45309}
.mg-health-card.is-fail{border-left-color:#B91C1C}
.mg-health-card.is-pending{border-left-color:#2563EB}
.mg-health-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.mg-health-card-title{margin:0;font-size:15px;color:#1f2937}
.mg-health-card-date{font-size:12px;color:#6b7280}
.mg-health-card-verdict{margin:8px 0 0;font-size:13px;line-height:1.5;color:#374151}
.mg-health-card-lang{margin:6px 0 0;font-size:12px;color:#1d3a7a}
.mg-health-card-list{margin:8px 0 0;padding:0;list-style:none}
.mg-health-card-list li{display:flex;gap:10px;flex-wrap:wrap;padding:4px 0;border-top:1px solid #f1f5f9;font-size:12px}
.mg-health-card-url{font-family:monospace;color:#1f2937;word-break:break-all}
.mg-health-card-note{color:#6b7280}
.mg-health-card-list li.is-fail .mg-health-card-note{color:#B91C1C;font-weight:600}
.mg-health-card-list li.is-warn .mg-health-card-note,.mg-health-card-list li.is-unknown .mg-health-card-note{color:#B45309;font-weight:600}
.mg-health-card-actions{margin-top:10px}
.mg-health-card-actions [hidden]{display:none}

/* Avis : fond image/vidéo actif */
.mg-bg-cover-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 14px;padding:10px 14px;background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;font-size:13px;color:#7c2d12}
.mg-bg-cover-notice[hidden]{display:none}

/* ==========================================================================
   v2.9.174 — corrections du test utilisateur à l'aveugle (2026-10-13)
   ========================================================================== */

/* Sauvegarde : une seule façon (automatique), état visible sous chaque onglet */
.mg-autosave-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: #4b5563;
}
.mg-autosave-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    flex: 0 0 8px;
}
.mg-autosave-note.is-pending .mg-autosave-dot { background: #d97706; }
.mg-autosave-note.is-saving .mg-autosave-dot { background: #2563eb; }
.mg-autosave-note.is-error { color: #b91c1c; font-weight: 600; }
.mg-autosave-note.is-error .mg-autosave-dot { background: #dc2626; }

/* Recherche : badge « Expert » sur un résultat caché en mode Simple */
.mg-expert-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}
.mg-mode-hint-active { display: block; margin-top: 6px; color: #7c2d12; }
.mg-mode-hint-active strong { font-weight: 700; }

/* Fenêtre de confirmation (remplace confirm() du navigateur) */
.mg-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
}
.mg-confirm-overlay[hidden] { display: none; }
.mg-confirm-box {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.mg-confirm-msg { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: #1f2937; }
.mg-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Messages en ligne (planification incomplète, compte à rebours suivi) */
.mg-inline-warning,
.mg-inline-info {
    margin: 8px 0 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.45;
}
.mg-inline-warning { background: #fff7ed; border-left: 3px solid #d97706; color: #7c2d12; }
.mg-inline-info { background: #eff6ff; border-left: 3px solid #2563eb; color: #1e3a8a; margin-bottom: 12px; }
.mg-inline-warning[hidden], .mg-inline-info[hidden] { display: none; }
input[readonly]#mg-countdown-date, input[readonly]#mg-countdown-time { background: #f3f4f6; cursor: not-allowed; }

/* Assistant : boutons toujours visibles (à 768 px de haut, Back/Next étaient
   coupés), aperçus de styles plus bas sur petit écran */
#mg-wizard .mg-wizard-step > div:last-child {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 16px !important;
    padding: 12px 0;
    background: #fff;
    box-shadow: 0 -8px 12px -8px rgba(15, 23, 42, 0.12);
}
@media (max-height: 820px) {
    #mg-wizard .mg-wizard-step { padding-top: 12px !important; }
    #mg-wizard .mg-wizard-step [style*="font-size:40px"] { display: none; }
    #mg-wizard .mg-wiz-preset > div:first-child { height: 64px !important; }
    #mg-wizard .mg-wiz-tip { margin-bottom: 10px; }
}
@media (max-width: 600px) {
    #mg-wizard .mg-wizard-step { padding-left: 18px !important; padding-right: 18px !important; }
    #mg-wizard .mg-wizard-step [style*="grid-template-columns:repeat(3"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Assistant : composer le message (2 questions + ton) */
.mg-wiz-compose {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
}
.mg-wiz-compose-row { margin-bottom: 10px; }
.mg-wiz-compose-row label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; color: #333; }
.mg-wiz-compose-row input { width: 100%; padding: 8px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; }
.mg-wiz-tones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.mg-wiz-tones-label { font-size: 13px; font-weight: 600; color: #333; margin-right: 2px; }
.mg-wiz-tone {
    padding: 6px 14px;
    border: 2px solid #c7d2fe;
    border-radius: 999px;
    background: #fff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.mg-wiz-tone:hover, .mg-wiz-tone:focus { border-color: #667eea; }
.mg-wiz-tone.is-active { background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; color: #fff; }
.mg-wiz-tone-note { margin: 8px 0 0; font-size: 12px; color: #6b7280; }
.mg-themes-sub { display: block; width: 100%; margin-top: 2px; font-size: 12px; font-weight: 400; color: #6b7280; }

/* Bouton d'aide flottant */
.mg-float-help {
    background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
    color: #fff;
}

/* Lien d'accès visible en clair */
.mg-token-url {
    display: block;
    width: 100%;
    max-width: 520px;
    margin-top: 6px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    color: #111827;
}
.mg-switch-modern { flex-shrink: 0; }

/* Avis de fin automatique */
.mg-auto-ended {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #16a34a;
    background: #f0fdf4;
    color: #14532d;
    font-size: 14px;
}

/* Téléphone : sauvegarde sur une colonne, aperçu du compte à rebours dans la carte */
@media (max-width: 600px) {
    .mg-backup-section { grid-template-columns: 1fr !important; }
    .mg-countdown-preview > div { flex-wrap: wrap; gap: 6px !important; }
    .mg-countdown-preview > div > div { min-width: 0 !important; padding: 10px 8px !important; flex: 1 1 0; }
    .mg-countdown-preview [data-mg-cd] { font-size: 22px !important; }
}

/* ===== v2.9.175 ===== */
.mg-title-mode-note {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-left: 3px solid #C2410C;
    background: #FFF7ED;
    color: #7C2D12;
    font-size: 13px;
    border-radius: 4px;
}
.mg-title-mode-note[hidden] { display: none; }
.mg-section-tip { vertical-align: middle; font-size: 12px; }

/* ===== v2.9.176 — Styles en tête d'Apparence ===== */
.mg-styles-section { margin-bottom: 28px; }
.mg-styles-section .mg-styles-title { margin: 0; font-size: inherit; }
.mg-style-preview { height: 72px; background-color: #e5e7eb; }
.mg-style-preview::after { display: none; }
