@keyframes efaSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes efaFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

#efa-accessibility-panel {
    position: fixed; top: 0; left: 0; width: 100%; background: #f8f9fa;
    border-bottom: 3px solid #dee2e6; z-index: 999999; padding: 12px 20px;
    display: flex; justify-content: center; align-items: center; gap: 25px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    animation: efaSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.efa-panel-group { display: flex; align-items: center; gap: 8px; border-right: 1px solid #dee2e6; padding-right: 20px; }
.efa-panel-group:last-of-type { border-right: none; }
.efa-panel-label { font-size: 13px !important; font-weight: 600; color: #495057; text-transform: uppercase; letter-spacing: 0.5px; }

#efa-accessibility-panel button {
    padding: 8px 16px !important; border: 1px solid #adb5bd !important; background: #ffffff !important;
    color: #212529 !important; cursor: pointer; font-weight: bold !important; font-size: 14px !important;
    border-radius: 6px !important; letter-spacing: normal !important; transition: all 0.25s ease;
}
#efa-accessibility-panel button:hover { background: #e9ecef !important; border-color: #6c757d !important; }
#efa-accessibility-panel button.active { background: #212529 !important; color: #ffffff !important; border-color: #212529 !important; }

#efa-btn-scheme-default.active { background: #e9ecef !important; color: #212529 !important; border: 2px dashed #212529 !important; }
#efa-btn-scheme-bw { background: #ffffff !important; color: #000000 !important; border: 1px solid #000000 !important; }
#efa-btn-scheme-bw.active { background: #000000 !important; color: #ffffff !important; }
#efa-btn-scheme-wb { background: #1a1a1a !important; color: #ffffff !important; border: 1px solid #ffffff !important; }
#efa-btn-scheme-wb.active { background: #ffffff !important; color: #000000 !important; border: 1px solid #000000 !important; }
#efa-btn-scheme-by { background: #002b5c !important; color: #ffcc00 !important; border: 1px solid #ffcc00 !important; }
#efa-btn-scheme-by.active { background: #ffcc00 !important; color: #002b5c !important; border: 1px solid #002b5c !important; }

#efa-accessibility-panel button.efa-btn-close { background: #dc3545 !important; color: #ffffff !important; border-color: #dc3545 !important; margin-left: auto; }
#efa-accessibility-panel button.efa-btn-close:hover { background: #bd2130 !important; }

/* ИСПРАВЛЕНО: Кнопка запуска теперь использует благородный шрифт Montserrat */
#efa-panel-launcher {
    position: fixed; top: 20px; right: 20px; z-index: 999999; background: #0056b3; color: #ffffff;
    border: none; padding: 14px 24px; font-weight: 500; font-size: 14px; border-radius: 30px;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,86,179,0.3); display: none; 
    font-family: 'Montserrat', sans-serif !important; /* Установка шрифта */
    letter-spacing: 0.5px;
    animation: efaFadeIn 0.3s ease-in-out forwards;
}
#efa-panel-launcher:hover { background: #004085; }

body:not(.efa-panel-hidden) { padding-top: 65px !important; }
body.efa-panel-hidden { padding-top: 0 !important; }

/* ==========================================================================
   ОПТИМИЗИРОВАННАЯ МОБИЛЬНАЯ ВЕРСИЯ (Меньше 768px)
   ========================================================================== */
@media (max-width: 767px) {
    #efa-accessibility-panel { 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: space-between; 
        gap: 6px; 
        padding: 8px 10px; 
        box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
    }
    
    .efa-panel-group { 
        border-right: none; 
        padding-right: 0; 
        gap: 4px; 
    }
    
    .efa-panel-label { 
        display: none !important; 
    }
    
    #efa-accessibility-panel button { 
        padding: 6px 10px !important; 
        font-size: 12px !important; 
        border-radius: 4px !important; 
        text-align: center;
    }

    #efa-btn-scheme-default { 
        font-size: 0 !important; 
    }
    #efa-btn-scheme-default::after { 
        content: "Сброс"; 
        font-size: 12px !important; 
    }

    #efa-btn-spacing {
        font-size: 11px !important; 
        padding: 6px 8px !important;
        min-width: 65px;
    }

    /* Кнопка закрытия [✕] */
    #efa-accessibility-panel button.efa-btn-close { 
        margin-left: 0; 
        background: #dc3545 !important; 
        color: transparent !important; 
        position: relative; 
        width: 34px; 
        height: 30px; 
        padding: 0 !important; 
    }
    #efa-accessibility-panel button.efa-btn-close::after { 
        content: "✕"; 
        position: absolute; 
        left: 50%; 
        top: 50%; 
        transform: translate(-50%, -50%); 
        color: #fff !important; 
        font-size: 13px; 
        font-weight: bold; 
    }

    /* Кнопка запуска на мобильных также унаследует Montserrat автоматически */
    #efa-panel-launcher { 
        top: auto; 
        bottom: 15px; 
        right: 15px; 
        left: 15px; 
        padding: 12px; 
        font-size: 14px; 
        border-radius: 20px; 
    }
    
    body:not(.efa-panel-hidden) { 
        padding-top: 85px !important; 
    }
}
