/* Анимации для уведомлений */

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ГАРАНТИРУЕМ РАБОТУ СКРОЛЛА СТРАНИЦЫ */
html {
    overflow-y: scroll !important;
    overflow-x: hidden;
    height: auto !important;
}

body {
    background: #000;
    overflow-y: visible !important;
    overflow-x: hidden;
    height: auto !important;
    min-height: 100vh;
}

/* СКРЫВАЕМ NAVBAR И FOOTER НА СТРАНИЦЕ ГЛАВЫ */
.navbar, .footer {
    display: none !important;
}

.main-content {
    padding: 0 !important;
    margin: 0 !important;
}

.chapter-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: 
        radial-gradient(circle at 15% 50%, rgba(255, 212, 59, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 20%, rgba(255, 193, 7, 0.06) 0%, transparent 40%),
        linear-gradient(180deg, #0a0a0a 0%, #121212 100%);
}

/* 🌟 Анимированные частицы фона */
.chapter-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 212, 59, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 212, 59, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 212, 59, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 212, 59, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 212, 59, 0.3), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 212, 59, 0.3), transparent);
    background-size: 200% 200%;
    animation: sparkle 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes sparkle {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 80% 20%, 10% 90%, 33% 80%;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 25% 75%, 20% 80%, 90% 10%, 80% 33%;
    }
}

/* 💎 Hero - СУПЕР КОМПАКТНЫЙ */
.chapter-hero {
    background: 
        linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(13, 13, 13, 0.95) 100%);
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    border-bottom: 3px solid rgba(255, 212, 59, 0.6);
    box-shadow: 
        0 5px 30px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 212, 59, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.chapter-number-badge {
    width: 42px;
    height: 42px;
    line-height: 42px;
    background: linear-gradient(135deg, #FFD43B 0%, #FFC107 100%);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 900;
    color: #000;
    box-shadow: 
        0 0 25px rgba(255, 212, 59, 0.8),
        0 0 40px rgba(255, 212, 59, 0.4);
    flex-shrink: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 3s ease-in-out infinite;
}

    50% {
        box-shadow: 
            0 0 35px rgba(255, 212, 59, 1),
            0 0 60px rgba(255, 212, 59, 0.6);
        transform: scale(1.05);
    }
}

.chapter-title {
    font-size: 1.35rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD43B 0%, #FFC107 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.demo-badge {
    padding: 0.3rem 1rem;
    background: rgba(255, 212, 59, 0.2);
    border: 2px solid #FFD43B;
    border-radius: 20px;
    color: #FFD43B;
    font-weight: 700;
    font-size: 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 🔗 Мини навигация в хедере */
.chapter-hero a {
    transition: all 0.3s ease;
    font-size: 0.85rem !important;
}

.chapter-hero a:hover {
    transform: translateY(-2px);
    filter: brightness(1.3);
}

.chapter-hero a i {
    font-size: 0.9rem;
}

/* 🎯 3-КОЛОНОЧНЫЙ LAYOUT */

/* 2-КОЛОНОЧНЫЙ для не авторизованных */

/* Стилизация скроллбара для левой навигации */
/* ЛЕВОЕ МЕНЮ - ПРИЖАТО К КРАЮ */

/* ПЕРВАЯ СЕКЦИЯ КОНТЕНТА ВИДНА */

/* ОСНОВНОЙ КОНТЕЙНЕР С ОТСТУПОМ СЛЕВА */

@media (max-width: 1400px) {
    
}

@media (max-width: 1200px) {
    
    
    
}

.sections-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sections-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sections-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.sections-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* ==========================================
   ПРАВИЛЬНЫЙ LAYOUT
   ========================================== */

/* ОСНОВНОЙ КОНТЕЙНЕР - FLEX */

/* ЛЕВОЕ МЕНЮ - В ПОТОКЕ */

/* Скроллбар для левого меню */
.sections-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sections-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sections-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.sections-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* КОНТЕНТ - РАСТЯГИВАЕТСЯ */

/* ПЕРВАЯ СЕКЦИЯ ВИДНА */

/* ПРАВЫЙ БЛОК - FIXED ПО ЦЕНТРУ */

/* Скроллбар для правого блока */

/* АДАПТИВНОСТЬ */
@media (max-width: 1400px) {
    
    
    
}

@media (max-width: 1200px) {
    
    
    
    
    
    
    
}

/* ==========================================
   ПРАВИЛЬНЫЙ ФИНАЛЬНЫЙ LAYOUT
   ========================================== */

/* ОСНОВНОЙ WRAPPER - ОГРАНИЧЕННАЯ ШИРИНА ПО ЦЕНТРУ */

/* ЛЕВОЕ МЕНЮ - В ПОТОКЕ, STICKY */

/* КОНТЕНТ - FLEX, ЦЕНТРИРУЕТСЯ */

/* ПРАВЫЙ БЛОК - FIXED СПРАВА */

/* АДАПТИВНОСТЬ */
@media (max-width: 1600px) {
    
    
    
}

@media (max-width: 1400px) {
    
    
    
}

@media (max-width: 1200px) {
    
    
    
    
    
}

/* ==========================================
   СОДЕРЖАНИЕ ПРИЖАТО К КРАЮ И ВВЕРХУ
   ========================================== */

/* ОСНОВНОЙ WRAPPER - БЕЗ ОТСТУПА СЛЕВА */

/* ЛЕВОЕ МЕНЮ - ПРИЖАТО К КРАЮ И ВВЕРХУ */

/* КОНТЕНТ - РАСТЯГИВАЕТСЯ */

/* ПРАВЫЙ БЛОК - FIXED */

/* АДАПТИВНОСТЬ */
@media (max-width: 1600px) {
    
    
    
}

@media (max-width: 1400px) {
    
    
    
}

@media (max-width: 1200px) {
    
    
    
    
    
}

/* ==========================================
   КОНТЕНТ ПО ЦЕНТРУ
   ========================================== */

/* ОСНОВНОЙ WRAPPER */
.content-wrapper {
    display: flex;
    gap: 30px;
    max-width: 100%;
    margin: 0;
    padding: 0 300px 40px 0;
}

/* ЛЕВОЕ МЕНЮ - СЛЕВА ВВЕРХУ */
.sections-sidebar {
    flex-shrink: 0;
    width: 280px;
    position: sticky;
    top: 5px;
    align-self: flex-start;
    margin-left: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* КОНТЕНТ - ПО ЦЕНТРУ! */
.content-center {
    flex: 1;
    min-width: 0;
    max-width: 1000px;
    margin: 0 auto !important; /* ПО ЦЕНТРУ! */
    padding: 0 40px;
}

/* ПРАВЫЙ БЛОК - FIXED */
.sidebar-right {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
    
    
    z-index: 1000;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 1600px) {
    .content-wrapper {
        padding-right: 280px;
    }
    
    .sidebar-right {
        width: 240px;
    }
}

@media (max-width: 1400px) {
    .content-wrapper {
        padding-right: 260px;
    }
    
    .sidebar-right {
        width: 220px;
    }
}

@media (max-width: 1200px) {
    .content-wrapper {
        flex-direction: column;
        padding: 40px 20px;
    }
    
    .sections-sidebar {
        width: 100%;
        position: static;
        margin-left: 0;
    }
    
    .content-center {
        max-width: 100%;
        padding: 0;
    }
    
    .sidebar-right {
        display: none;
    }
}

.sections-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFD43B;
    margin: 0 1.2rem 1.2rem 1.2rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid rgba(255, 212, 59, 0.3);
}

.section-item {
    padding: 0.9rem 1.3rem;
    margin: 0.5rem 0.8rem;
    background: rgba(45, 45, 45, 0.6);
    border-left: 4px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    color: #d0d0d0;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

.section-item:hover {
    background: rgba(255, 212, 59, 0.15);
    border-left-color: #FFD43B;
    color: #FFD43B;
    transform: translateX(8px);
    box-shadow: 0 5px 20px rgba(255, 212, 59, 0.2);
}

.section-item.active {
    background: 
        linear-gradient(135deg, rgba(255, 212, 59, 0.3), rgba(255, 212, 59, 0.15));
    border-left-color: #FFD43B;
    color: #FFD43B;
    font-weight: 700;
    box-shadow: 
        0 8px 30px rgba(255, 212, 59, 0.4),
        inset 0 0 20px rgba(255, 212, 59, 0.1);
    transform: translateX(5px);
}

.section-item.active::after {
    content: '👉';
    position: absolute;
    right: 1.5rem;
    font-size: 1.2rem;
    animation: pulse-pointer 1.5s infinite;
}

    50% { 
        opacity: 0.6; 
        transform: translateX(5px);
    }
}

.section-item.level-1 {
    font-size: 1rem;
    font-weight: 700;
}

.section-item.level-2 {
    margin-left: 1.5rem;
    font-size: 0.9rem;
}

.section-item.level-3 {
    margin-left: 2.5rem;
    font-size: 0.85rem;
}

/* 📖 Центр - АКТИВНЫЙ БЛОК */

/* Контент блоки - скрыты по умолчанию */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

/* Стили для контента */
.content-section h1,
.content-section h2,
.content-section h3 {
    color: #FFD43B;
    font-weight: 800;
    margin: 2rem 0 1.2rem 0;
    padding-left: 1.5rem;
    position: relative;
    word-wrap: break-word;
}

.content-section h1::before,
.content-section h2::before,
.content-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: linear-gradient(180deg, #FFD43B, #FFC107);
    border-radius: 3px;
    box-shadow: 0 0 12px #FFD43B;
}

.content-section h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid rgba(255, 212, 59, 0.4);
    padding-bottom: 1.2rem;
    margin-top: 0;
}

.content-section h2 {
    font-size: 1.8rem;
}

.content-section h3 {
    font-size: 1.4rem;
}

.content-section p {
    color: #f0f0f0;
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.content-section ul,
.content-section ol {
    color: #f0f0f0;
    line-height: 1.8;
    padding-left: 2rem;
    margin-bottom: 1.7rem;
    word-wrap: break-word;
}

.content-section li {
    margin-bottom: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.95rem;
}

.content-section code {
    background: rgba(255, 212, 59, 0.15);
    color: #FFD43B;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.95em;
    border: 1px solid rgba(255, 212, 59, 0.3);
}

.content-section pre {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid rgba(255, 212, 59, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.9),
        0 0 30px rgba(255, 212, 59, 0.15),
        inset 0 0 20px rgba(255, 212, 59, 0.05);
    max-width: 100%;
    backdrop-filter: blur(5px);
}

.content-section pre code {
    background: none;
    color: #f5f5f5;
    padding: 0;
    border: none;
    font-size: 0.9rem;
    line-height: 1.7;
    font-family: 'Courier New', 'Monaco', monospace;
    white-space: pre;
    word-wrap: normal;
}

.content-section blockquote {
    background: rgba(255, 212, 59, 0.15);
    border-left: 5px solid #FFD43B;
    padding: 2rem;
    margin: 2.5rem 0;
    border-radius: 12px;
    font-style: italic;
    color: #f5f5f5;
    box-shadow: 0 5px 20px rgba(255, 212, 59, 0.2);
    word-wrap: break-word;
}

.content-section strong {
    color: #FFD43B;
    font-weight: 700;
}

.content-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.content-section table th,
.content-section table td {
    padding: 1rem;
    border: 1px solid rgba(255, 212, 59, 0.2);
}

.content-section table th {
    background: rgba(255, 212, 59, 0.2);
    color: #FFD43B;
    font-weight: 700;
}

/* 🎮 Правый Sidebar */

.sidebar-section {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 212, 59, 0.1);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFD43B;
    margin-bottom: 0.8rem;
}

.btn-understood { color: #4CAF50; }
.btn-understood:hover, .btn-understood.active { background: rgba(76, 175, 80, 0.2); }

.btn-partial { color: #FFD43B; }
.btn-partial:hover, .btn-partial.active { background: rgba(255, 212, 59, 0.2); }

.btn-not-understood { color: #FF5252; }
.btn-not-understood:hover, .btn-not-understood.active { background: rgba(255, 82, 82, 0.2); }

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 212, 59, 0.1);
    font-size: 0.9rem;
}

.stat-label {
    color: #999;
}

.stat-value {
    color: #FFD43B;
    font-weight: 700;
}

.navigation-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

/* КОНТЕНТ РАСТЯНУТ НА ВСЮ ШИРИНУ */

/* ОСНОВНОЙ КОНТЕНТ */

/* ПРАВЫЙ ЧАТ - ПРИЖАТ К КРАЮ */

/* КАРТОЧКА ВНУТРИ ЧАТА */

/* Красивый скроллбар */

/* ЗАГОЛОВОК */

/* ТЕКУЩАЯ ОЦЕНКА */

/* КНОПКИ ОЦЕНКИ */

/* НАВИГАЦИЯ - СТРЕЛКИ НЕКЛИКАБЕЛЬНЫЕ (ДЕКОР) */

/* АДАПТИВНОСТЬ */
@media (max-width: 1600px) {
    
    
    
}

@media (max-width: 1400px) {
    
    
    
    
    
}

@media (max-width: 1200px) {
    
    
    
}

/* АНИМАЦИЯ ОБНОВЛЕНИЯ ОЦЕНКИ */
@keyframes ratingUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: rgba(255, 215, 0, 0.2); }
    100% { transform: scale(1); }
}

/* ПЛАВНОЕ ПОЯВЛЕНИЕ ЧАТА */

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* КОМПАКТНАЯ КАРТОЧКА */

/* ЗАГОЛОВОК - КОМПАКТНЫЙ */
.understanding-title {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 4px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.understanding-description {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* ТЕКУЩАЯ ОЦЕНКА - УЛЬТРА КОМПАКТНАЯ */
.current-rating {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
    text-align: center;
}

.rating-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.rating-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rating-badge.rating-excellent {
    background: #11998e;
    color: white;
}

.rating-badge.rating-partial {
    background: #FFB75E;
    color: white;
}

.rating-badge.rating-not_understood {
    background: #FF6B6B;
    color: white;
}

/* КНОПКИ - МИНИ ВЕРСИЯ */
.understanding-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.understanding-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.understanding-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateX(2px);
}

.understanding-btn.active {
    border-width: 2px;
    transform: translateX(4px);
}

.understanding-btn.active[data-level="excellent"] {
    background: linear-gradient(90deg, rgba(17, 153, 142, 0.2) 0%, transparent 100%);
    border-color: #11998e;
}

.understanding-btn.active[data-level="partial"] {
    background: linear-gradient(90deg, rgba(255, 183, 94, 0.2) 0%, transparent 100%);
    border-color: #FFB75E;
}

.understanding-btn.active[data-level="not_understood"] {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.2) 0%, transparent 100%);
    border-color: #FF6B6B;
}

.understanding-btn .btn-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.understanding-btn .btn-text {
    color: white;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* НАВИГАЦИЯ - КОМПАКТНАЯ */
.chapter-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: all 0.25s ease;
}

.nav-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateX(2px);
}

.nav-btn.prev-btn:hover {
    transform: translateX(-2px);
}

.nav-btn .nav-icon {
    font-size: 16px;
    color: #FFD700;
}

.nav-btn .nav-text {
    color: white;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 1600px) {
    
    
    
    
    .understanding-btn {
        padding: 8px 10px;
    }
    
    .understanding-btn .btn-text {
        font-size: 12px;
    }
}

@media (max-width: 1400px) {
    
    
    .understanding-title {
        font-size: 14px;
    }
    
    .understanding-description {
        font-size: 10px;
    }
}

@media (max-width: 1200px) {
    
}

/* ПЛАВНОЕ ПОЯВЛЕНИЕ */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* ТОНКАЯ ПУЛЬСАЦИЯ ДЛЯ АКТИВНОЙ КНОПКИ */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
    }
}

.understanding-btn.active {
    animation: subtlePulse 2.5s ease-in-out infinite;
}

/* УЛУЧШЕННАЯ ПРОКРУТКА КОНТЕНТА */

@media (max-width: 1200px) {
    
}

/* СТРЕЛКИ НЕ БЛОКИРУЮТ КЛИКИ */
.section-arrow {
    pointer-events: none;
    user-select: none;
}











/* ============================================
   НАВИГАЦИОННЫЕ КНОПКИ СПРАВА СВЕРХУ - УЛУЧШЕННЫЙ ДИЗАЙН
   ============================================ */

.top-nav-buttons {
    position: absolute;
    top: 50%;
    right: 2.5rem;
    transform: translateY(-50%);
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 100;
}

.top-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem;
    background: linear-gradient(135deg, rgba(255, 212, 59, 0.15) 0%, rgba(255, 193, 7, 0.08) 100%);
    border: 2px solid rgba(255, 212, 59, 0.4);
    border-radius: 14px;
    color: #FFD43B;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 212, 59, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Анимированный градиент при наведении */
.top-nav-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 212, 59, 0.4) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
}

.top-nav-btn:hover::before {
    transform: scale(1);
}

/* Светящаяся рамка при наведении */
.top-nav-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, #FFD43B, #FFC107, #FFD43B);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.top-nav-btn:hover::after {
    opacity: 1;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { 
        filter: drop-shadow(0 0 5px rgba(255, 212, 59, 0.5));
    }
    50% { 
        filter: drop-shadow(0 0 15px rgba(255, 212, 59, 0.8));
    }
}

.top-nav-btn:hover {
    background: linear-gradient(135deg, rgba(255, 212, 59, 0.3) 0%, rgba(255, 193, 7, 0.2) 100%);
    border-color: #FFD43B;
    color: #FFF;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(255, 212, 59, 0.4),
        0 0 40px rgba(255, 212, 59, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.top-nav-btn:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 
        0 5px 20px rgba(255, 212, 59, 0.3),
        0 0 30px rgba(255, 212, 59, 0.2);
}

.top-nav-btn i {
    font-size: 1.15rem;
    z-index: 1;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.top-nav-btn:hover i {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 0 8px rgba(255, 212, 59, 0.8));
}

.top-nav-btn span {
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
}

/* Индивидуальные цвета для каждой кнопки при наведении */
.top-nav-btn.btn-dashboard:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25) 0%, rgba(56, 142, 60, 0.15) 100%);
    border-color: #4CAF50;
    box-shadow: 
        0 10px 30px rgba(76, 175, 80, 0.4),
        0 0 40px rgba(76, 175, 80, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.top-nav-btn.btn-dashboard:hover i {
    color: #4CAF50;
    filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.8));
}

.top-nav-btn.btn-map:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25) 0%, rgba(25, 118, 210, 0.15) 100%);
    border-color: #2196F3;
    box-shadow: 
        0 10px 30px rgba(33, 150, 243, 0.4),
        0 0 40px rgba(33, 150, 243, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.top-nav-btn.btn-map:hover i {
    color: #2196F3;
    filter: drop-shadow(0 0 10px rgba(33, 150, 243, 0.8));
}

.top-nav-btn.btn-progress:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.25) 0%, rgba(245, 124, 0, 0.15) 100%);
    border-color: #FF9800;
    box-shadow: 
        0 10px 30px rgba(255, 152, 0, 0.4),
        0 0 40px rgba(255, 152, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.top-nav-btn.btn-progress:hover i {
    color: #FF9800;
    filter: drop-shadow(0 0 10px rgba(255, 152, 0, 0.8));
}

/* Адаптивность */
@media (max-width: 1400px) {
    .top-nav-buttons {
        right: 2rem;
        gap: 0.8rem;
    }
    
    .top-nav-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    .top-nav-buttons {
        position: fixed;
        top: 15px;
        right: 15px;
        transform: none;
        gap: 0.6rem;
        z-index: 1000;
    }
    
    .top-nav-btn {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .top-nav-buttons {
        right: 10px;
        top: 10px;
        gap: 0.5rem;
    }
    
    .top-nav-btn span {
        display: none;
    }
    
    .top-nav-btn {
        padding: 0.7rem;
        width: 48px;
        height: 48px;
        justify-content: center;
        border-radius: 12px;
    }
    
    .top-nav-btn i {
        margin: 0;
        font-size: 1.2rem;
    }
}
/* ============================================
   📱 МОБИЛЬНАЯ АДАПТАЦИЯ - СТРАНИЦА ГЛАВ
   ============================================ */

/* 📱 Маленькие телефоны (320px - 480px) */
@media (max-width: 480px) {
    /* Hero компактнее */
    .chapter-hero {
        padding: 0.5rem 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        position: relative;
    }
    
    .chapter-number-badge {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 1.2rem;
    }
    
    .chapter-title {
        font-size: 1rem;
        line-height: 1.3;
        width: 100%;
    }
    
    .demo-badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.6rem;
    }
    
    /* Навигационные кнопки - fixed внизу экрана */
    .top-nav-buttons {
        position: fixed;
        bottom: 70px;
        right: 10px;
        left: 10px;
        top: auto;
        transform: none;
        justify-content: space-between;
        z-index: 999;
        background: rgba(0, 0, 0, 0.95);
        padding: 0.5rem;
        border-radius: 16px;
        border: 2px solid rgba(255, 212, 59, 0.4);
        box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.8);
    }
    
    .top-nav-btn {
        flex: 1;
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
        justify-content: center;
        flex-direction: column;
        gap: 0.3rem;
        border-radius: 10px;
    }
    
    .top-nav-btn i {
        font-size: 1.1rem;
        margin: 0;
    }
    
    .top-nav-btn span {
        font-size: 0.7rem;
    }
    
    /* Layout - одна колонка */
    .content-wrapper {
        flex-direction: column;
        padding: 0 !important;
        gap: 0;
    }
    
    /* Левый сайдбар - drawer */
    .sections-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        margin: 0;
        z-index: 1001;
        transition: left 0.3s ease;
        background: rgba(20, 20, 20, 0.98);
        border-radius: 0;
        border-right: 2px solid rgba(255, 212, 59, 0.4);
        padding-top: 60px;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .sections-sidebar.active {
        left: 0;
    }
    
    /* Кнопка открытия левого сайдбара */
    .sidebar-toggle-left {
        display: flex !important;
        position: fixed;
        left: 10px;
        bottom: 10px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.2), rgba(255, 193, 7, 0.15));
        border: 2px solid rgba(255, 212, 59, 0.5);
        border-radius: 50%;
        color: #FFD43B;
        font-size: 1.3rem;
        align-items: center;
        justify-content: center;
        z-index: 998;
        box-shadow: 0 4px 20px rgba(255, 212, 59, 0.4);
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .sidebar-toggle-left:active {
        transform: scale(0.95);
    }
    
    /* Правый сайдбар - липкая панель внизу */
    .sidebar-right {
        position: fixed;
        right: -100%;
        top: auto;
        bottom: 140px;
        left: 10px;
        right: 10px;
        width: auto;
        transform: none;
        transition: right 0.3s ease;
        background: rgba(20, 20, 20, 0.98);
        border: 2px solid rgba(255, 212, 59, 0.4);
        border-radius: 16px;
        padding: 1rem;
        z-index: 997;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .sidebar-right.active {
        right: 10px;
    }
    
    /* Кнопка открытия правого сайдбара */
    .sidebar-toggle-right {
        display: flex !important;
        position: fixed;
        right: 10px;
        bottom: 10px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.15));
        border: 2px solid rgba(76, 175, 80, 0.5);
        border-radius: 50%;
        color: #4CAF50;
        font-size: 1.3rem;
        align-items: center;
        justify-content: center;
        z-index: 998;
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .sidebar-toggle-right:active {
        transform: scale(0.95);
    }
    
    /* Overlay при открытии drawer */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.8);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Контент на всю ширину */
    .content-center {
        max-width: 100%;
        padding: 1rem 0.8rem 180px 0.8rem;
        margin: 0;
    }
    
    /* Заголовки компактнее */
    .content-section h1 {
        font-size: 1.6rem;
        padding-left: 1rem;
    }
    
    .content-section h2 {
        font-size: 1.3rem;
        padding-left: 1rem;
    }
    
    .content-section h3 {
        font-size: 1.1rem;
        padding-left: 1rem;
    }
    
    .content-section p,
    .content-section li {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    /* Code блоки с горизонтальным скроллом */
    .content-section pre {
        padding: 1rem;
        margin: 1rem 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 1.6rem);
    }
    
    .content-section pre code {
        font-size: 0.8rem;
        white-space: pre;
        word-wrap: normal;
    }
    
    /* Таблицы */
    .content-section table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Кнопки понимания крупнее для touch */
    .understanding-btn {
        min-height: 48px;
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    /* Навигационные стрелки */
    .navigation-buttons {
        gap: 0.8rem;
    }
    
    .nav-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 12px;
        font-size: 1.1rem;
    }
}

/* 📱 Большие телефоны (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .chapter-hero {
        padding: 0.6rem 1rem;
        gap: 1rem;
    }
    
    .chapter-number-badge {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 1.3rem;
    }
    
    .chapter-title {
        font-size: 1.1rem;
    }
    
    /* Навигационные кнопки */
    .top-nav-buttons {
        position: fixed;
        bottom: 80px;
        right: 15px;
        left: 15px;
        gap: 0.8rem;
        background: rgba(0, 0, 0, 0.95);
        padding: 0.6rem;
        border-radius: 16px;
        transform: none;
    }
    
    .top-nav-btn {
        flex: 1;
        padding: 0.7rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Layout */
    .content-wrapper {
        flex-direction: column;
        padding: 0 !important;
    }
    
    .sections-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 70%;
        max-width: 350px;
        margin: 0;
        z-index: 1001;
        transition: left 0.3s ease;
        background: rgba(20, 20, 20, 0.98);
        padding-top: 60px;
    }
    
    .sections-sidebar.active {
        left: 0;
    }
    
    .sidebar-toggle-left {
        display: flex !important;
        position: fixed;
        left: 15px;
        bottom: 15px;
        width: 52px;
        height: 52px;
        z-index: 998;
    }
    
    .sidebar-right {
        position: fixed;
        right: -100%;
        bottom: 160px;
        left: 15px;
        right: 15px;
        width: auto;
        transform: none;
        z-index: 997;
    }
    
    .sidebar-right.active {
        right: 15px;
    }
    
    .sidebar-toggle-right {
        display: flex !important;
        position: fixed;
        right: 15px;
        bottom: 15px;
        width: 52px;
        height: 52px;
        z-index: 998;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        z-index: 1000;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .content-center {
        max-width: 100%;
        padding: 1.5rem 1rem 200px 1rem;
    }
    
    .content-section pre {
        overflow-x: auto;
        max-width: calc(100vw - 2rem);
    }
}

/* 📱 Планшеты portrait (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .chapter-hero {
        padding: 0.7rem 1.5rem;
    }
    
    .content-wrapper {
        gap: 20px;
        padding: 20px 20px 40px 20px !important;
    }
    
    /* Левый сайдбар уже */
    .sections-sidebar {
        width: 220px;
        padding: 15px;
    }
    
    .sections-title {
        font-size: 0.9rem;
        margin: 0 1rem 1rem 1rem;
    }
    
    .section-item {
        padding: 0.7rem 1rem;
        margin: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Правый сайдбар можно сделать drawer или уменьшить */
    .sidebar-right {
        width: 220px;
        right: 15px;
    }
    
    /* Контент адаптируется */
    .content-center {
        max-width: 100%;
        padding: 0 20px;
    }
    
    /* Навигационные кнопки */
    .top-nav-buttons {
        right: 1.5rem;
        gap: 0.6rem;
    }
    
    .top-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .top-nav-btn i {
        font-size: 1rem;
    }
}

/* 💻 Маленькие ноутбуки (1025px - 1199px) */
@media (min-width: 1025px) and (max-width: 1199px) {
    .content-wrapper {
        gap: 25px;
        padding: 30px 20px 40px 250px;
    }
    
    .sections-sidebar {
        width: 240px;
    }
    
    .sidebar-right {
        width: 240px;
        right: 15px;
    }
    
    .content-center {
        max-width: 900px;
        padding: 0 30px;
    }
    
    .top-nav-buttons {
        right: 2rem;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ДЛЯ TOUCH
   ============================================ */

/* Убираем hover эффекты на touch устройствах */
@media (hover: none) and (pointer: coarse) {
    .section-item:hover {
        transform: none;
    }
    
    .top-nav-btn:hover {
        transform: translateY(-3px);
    }
    
    /* Увеличиваем активные области */
    .section-item {
        padding: 1rem 1.3rem;
    }
    
    .understanding-btn {
        min-height: 50px;
    }
}

/* Улучшение скроллинга на iOS */
.sections-sidebar,
.sidebar-right,
.content-center {
    -webkit-overflow-scrolling: touch;
}

/* Предотвращение zoom при фокусе input (если есть) */
input,
textarea,
select {
    font-size: 16px !important;
}



@media (max-width: 767px) {
    /* Стрелки навигации */
    .mobile-nav-arrows {
        display: flex;
        position: fixed;
        bottom: 140px;
        left: 50%;
        transform: translateX(-50%);
        gap: 1rem;
        z-index: 996;
    }
    
    .mobile-arrow {
        width: 54px;
        height: 54px;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.25), rgba(255, 193, 7, 0.15));
        border: 2px solid rgba(255, 212, 59, 0.6);
        border-radius: 50%;
        color: #FFD43B;
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 4px 20px rgba(255, 212, 59, 0.4);
        backdrop-filter: blur(10px);
    }
    
    .mobile-arrow:active {
        transform: scale(0.95);
    }
    
    .mobile-arrow:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
    
    .mobile-arrow i {
        pointer-events: none;
    }
    
    /* Кнопки drawer - показываем на мобильных */
    .sidebar-toggle-left,
    .sidebar-toggle-right {
        display: flex !important;
    }
}

/* Адаптация модального окна Telegram - ТОЛЬКО НА ТЕЛЕФОНЕ */
@media (max-width: 767px) {
    /* Если есть модальное окно верификации */
    .verification-modal,
    .telegram-modal,
    .modal-dialog {
        max-width: 90% !important;
        margin: 1rem auto !important;
        padding: 1.5rem !important;
    }
    
    .modal-content {
        padding: 1.5rem 1rem !important;
        border-radius: 16px !important;
    }
    
    .modal-header {
        padding: 1rem !important;
        font-size: 1.2rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .modal-footer {
        padding: 1rem !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .modal-footer .btn {
        width: 100% !important;
        min-height: 48px !important;
    }
    
    /* QR код меньше */
    .qr-code,
    .telegram-qr {
        max-width: 200px !important;
        height: auto !important;
    }
    
    /* Кнопка подтверждения */
    .verification-button,
    .telegram-verify-btn {
        width: 100% !important;
        padding: 0.85rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 50px !important;
    }
    
    /* Текст инструкций */
    .verification-instructions,
    .telegram-instructions {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    /* Overlay модального окна */
    .modal-backdrop,
    .verification-overlay {
        background: rgba(0, 0, 0, 0.85) !important;
    }
}

/* Улучшение видимости навигационных кнопок сверху */
@media (max-width: 480px) {
    /* Кнопки Дашборд/Карта/Прогресс - делаем заметнее */
    .top-nav-buttons {
        background: rgba(0, 0, 0, 0.95) !important;
        border: 2px solid rgba(255, 212, 59, 0.5) !important;
        box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.9) !important;
        padding: 0.6rem !important;
    }
    
    .top-nav-btn {
        background: rgba(255, 212, 59, 0.15) !important;
        border-color: rgba(255, 212, 59, 0.4) !important;
    }
    
    .top-nav-btn span {
        font-size: 0.7rem !important;
        font-weight: 700 !important;
    }
}

/* ============================================
   🎨 КРАСИВАЯ МОБИЛЬНАЯ ПАНЕЛЬ НАВИГАЦИИ
   ============================================ */

/* По умолчанию скрыта */
.mobile-bottom-panel {
    display: none;
}

/* ТОЛЬКО НА ТЕЛЕФОНЕ */
@media (max-width: 767px) {
    /* Нижняя панель */
    .mobile-bottom-panel {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
        backdrop-filter: blur(20px);
        border-top: 2px solid rgba(255, 212, 59, 0.5);
        padding: 0.75rem 0.5rem calc(0.75rem + env(safe-area-inset-bottom));
        gap: 0.5rem;
        z-index: 1000;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
        justify-content: space-evenly;
        align-items: center;
    }
    
    /* Кнопки в панели */
    .mobile-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.6rem 0.5rem;
        background: rgba(255, 212, 59, 0.08);
        border: 1.5px solid rgba(255, 212, 59, 0.3);
        border-radius: 12px;
        color: #FFD43B;
        font-size: 0.75rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: 56px;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-btn i {
        font-size: 1.3rem;
        transition: transform 0.3s;
    }
    
    .mobile-btn span {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
    
    /* Активное состояние */
    .mobile-btn:active {
        transform: scale(0.95);
        background: rgba(255, 212, 59, 0.2);
    }
    
    /* Основная кнопка (Next) */
    .mobile-btn-primary {
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.25), rgba(255, 193, 7, 0.15));
        border-color: rgba(255, 212, 59, 0.6);
        border-width: 2px;
    }
    
    .mobile-btn-primary i {
        font-size: 1.5rem;
    }
    
    /* Отключенная кнопка */
    .mobile-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none !important;
    }
    
    /* Эффект ripple при нажатии */
    .mobile-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 212, 59, 0.4);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }
    
    .mobile-btn:active::before {
        width: 120%;
        height: 120%;
    }
    
    /* Контент с отступом снизу чтобы не перекрывался панелью */
    .content-center {
        padding-bottom: 120px !important;
    }
    
    /* Скрываем старые навигационные кнопки сверху */
    .top-nav-buttons {
        display: none !important;
    }
    
    /* Drawer'ы - делаем их красивее */
    .sections-sidebar {
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.9);
    }
    
    .sidebar-right {
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.9);
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .mobile-btn span {
        font-size: 0.65rem;
    }
    
    .mobile-btn i {
        font-size: 1.1rem;
    }
    
    .mobile-btn {
        padding: 0.5rem 0.3rem;
        min-height: 52px;
    }
}

/* Landscape режим на телефоне */
@media (max-width: 767px) and (orientation: landscape) {
    .mobile-bottom-panel {
        padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
    }
    
    .mobile-btn {
        flex-direction: row;
        gap: 0.5rem;
        min-height: 48px;
    }
    
    .mobile-btn span {
        font-size: 0.8rem;
    }
}

/* Улучшение анимации drawer */
@media (max-width: 767px) {
    .sections-sidebar,
    .sidebar-right {
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar-overlay {
        transition: opacity 0.3s ease;
    }
}

/* ============================================
   🎨 УЗКАЯ МОБИЛЬНАЯ ПАНЕЛЬ (компактнее)
   ============================================ */

@media (max-width: 767px) {
    /* Панель более компактная */
    .mobile-bottom-panel {
        padding: 0.6rem 0.4rem calc(0.6rem + env(safe-area-inset-bottom));
        gap: 0.4rem;
    }
    
    /* Кнопки узкие */
    .mobile-btn {
        padding: 0.5rem 0.4rem;
        min-height: 54px;
        gap: 0.2rem;
    }
    
    .mobile-btn i {
        font-size: 1.2rem;
    }
    
    .mobile-btn span {
        font-size: 0.68rem;
    }
    
    /* Основная кнопка (Next) - чуть крупнее */
    .mobile-btn-primary i {
        font-size: 1.4rem;
    }
}

/* Для маленьких экранов - еще компактнее */
@media (max-width: 360px) {
    .mobile-bottom-panel {
        padding: 0.5rem 0.3rem calc(0.5rem + env(safe-area-inset-bottom));
        gap: 0.3rem;
    }
    
    .mobile-btn {
        padding: 0.45rem 0.3rem;
        min-height: 50px;
    }
    
    .mobile-btn i {
        font-size: 1.1rem;
    }
    
    .mobile-btn span {
        font-size: 0.65rem;
    }
}

/* ============================================
   🔧 ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       📱 КНОПКА "КАРТА КУРСА" В CHAPTER-HERO
       ============================================ */
    
    .chapter-hero {
        position: relative;
        padding-right: 70px !important; /* Место для кнопки */
    }
    
    .mobile-course-map-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
        border: 2px solid rgba(255, 212, 59, 0.5);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #FFD43B;
        font-size: 1.2rem;
        text-decoration: none;
        box-shadow: 0 4px 15px rgba(255, 212, 59, 0.2);
        transition: all 0.3s;
        z-index: 100;
    }
    
    .mobile-course-map-btn:active {
        transform: scale(0.95);
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.3) 0%, rgba(255, 193, 7, 0.15) 100%);
        box-shadow: 0 2px 10px rgba(255, 212, 59, 0.3);
    }
    
    /* ============================================
       📝 АДАПТАЦИЯ КОНТЕНТА
       ============================================ */
    
    /* Заголовки */
    .chapter-hero h1 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
        padding-right: 60px !important;
    }
    
    .content-section h1 {
        font-size: 1.4rem !important;
        padding: 0.8rem 0.5rem !important;
        margin: 1rem 0 !important;
    }
    
    .content-section h2 {
        font-size: 1.2rem !important;
        padding: 0.6rem 0.5rem !important;
        margin: 0.8rem 0 !important;
    }
    
    .content-section h3 {
        font-size: 1.1rem !important;
        padding: 0.5rem 0.5rem !important;
        margin: 0.6rem 0 !important;
    }
    
    /* Параграфы и текст */
    .content-section p,
    .content-section li {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        padding: 0.3rem 0.5rem !important;
    }
    
    .content-section ul,
    .content-section ol {
        padding-left: 1.5rem !important;
        margin: 0.8rem 0 !important;
    }
    
    /* КОД-БЛОКИ - ГОРИЗОНТАЛЬНАЯ ПРОКРУТКА */
    .content-section pre {
        margin: 1rem 0.5rem !important;
        padding: 0.8rem !important;
        border-radius: 8px !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        font-size: 0.75rem !important;
        line-height: 1.4 !important;
        /* Прокрутка для длинных строк */
        white-space: pre !important;
        word-wrap: normal !important;
        word-break: normal !important;
    }
    
    .content-section code {
        font-size: 0.75rem !important;
        padding: 0.15rem 0.3rem !important;
        white-space: pre !important;
    }
    
    /* Inline код */
    .content-section p code,
    .content-section li code {
        font-size: 0.85rem !important;
        padding: 0.2rem 0.4rem !important;
        white-space: nowrap !important;
    }
    
    /* ТАБЛИЦЫ - ПРОКРУТКА */
    .content-section table {
        display: block !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        font-size: 0.85rem !important;
        margin: 1rem 0.5rem !important;
    }
    
    .content-section th,
    .content-section td {
        padding: 0.5rem !important;
        white-space: nowrap !important;
    }
    
    /* Эмодзи и иконки */
    .content-section .emoji {
        font-size: 1.2rem !important;
    }
    
    /* Блоки с примечаниями */
    .content-section blockquote {
        margin: 1rem 0.5rem !important;
        padding: 0.8rem !important;
        font-size: 0.9rem !important;
        border-left-width: 3px !important;
    }
    
    /* ============================================
       🗂️ DRAWER'Ы - ИСПРАВЛЕНИЕ ОТКРЫТИЯ
       ============================================ */
    
    /* Левый drawer (Содержание) */
    .sections-sidebar {
        position: fixed !important;
        left: -100% !important; /* Скрыт слева */
        top: 0 !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        z-index: 1001 !important;
        background: rgba(20, 20, 20, 0.98) !important;
        border-right: 2px solid rgba(255, 212, 59, 0.3) !important;
        border-radius: 0 !important;
        padding: 1rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .sections-sidebar.open {
        left: 0 !important; /* Выезжает */
    }
    
    /* Правый drawer (Оценка) */
    .sidebar-right {
        position: fixed !important;
        right: -100% !important; /* Скрыт справа */
        top: 0 !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        z-index: 1001 !important;
        background: rgba(20, 20, 20, 0.98) !important;
        border-left: 2px solid rgba(255, 212, 59, 0.3) !important;
        border-radius: 0 !important;
        padding: 1rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .sidebar-right.open {
        right: 0 !important; /* Выезжает */
    }
    
    /* Заголовки в drawer'ах */
    .sections-sidebar .sections-title,
    .sidebar-right .rating-title {
        font-size: 1.1rem !important;
        padding: 0.8rem !important;
        margin-bottom: 1rem !important;
        position: sticky !important;
        top: 0 !important;
        background: rgba(20, 20, 20, 0.98) !important;
        z-index: 10 !important;
    }
    
    /* Пункты меню в drawer */
    .section-item {
        font-size: 0.9rem !important;
        padding: 0.8rem !important;
        margin: 0.3rem 0 !important;
        cursor: pointer !important;
        border-radius: 8px !important;
    }
    
    .section-arrow {
        margin: 0.2rem 0 !important;
    }
    
    /* Overlay поверх контента */
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.85) !important;
        z-index: 1000 !important;
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }
    
    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
    }
    
    /* ============================================
       🎨 МОБИЛЬНАЯ ПАНЕЛЬ - УЛУЧШЕНИЯ
       ============================================ */
    
    .mobile-bottom-panel {
        padding-bottom: calc(0.6rem + env(safe-area-inset-bottom)) !important;
    }
    
    /* Отступ снизу для контента (чтобы не перекрывалось панелью) */
    .content-center {
        padding-bottom: 120px !important;
    }
    
    /* ============================================
       🎯 CHAPTER HERO - КОМПАКТНЕЕ
       ============================================ */
    
    .chapter-number-badge {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
        top: 10px !important;
        left: 10px !important;
    }
    
    .demo-badge {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.6rem !important;
        top: 10px !important;
        right: 70px !important; /* Слева от кнопки карты */
    }
}

/* ============================================
   📱 ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */

@media (max-width: 360px) {
    .content-section h1 {
        font-size: 1.2rem !important;
    }
    
    .content-section p,
    .content-section li {
        font-size: 0.9rem !important;
    }
    
    .content-section pre {
        font-size: 0.7rem !important;
        padding: 0.6rem !important;
    }
    
    .chapter-hero h1 {
        font-size: 1.15rem !important;
    }
}

/* ============================================
   🔧 ФИНАЛЬНЫЕ ИСПРАВЛЕНИЯ МОБИЛЬНОЙ ВЕРСИИ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       🗺️ КНОПКА "КАРТА КУРСА" - УВЕЛИЧЕНА И ПРАВЕЕ
       ============================================ */
    
    .mobile-course-map-btn {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        width: 56px !important;
        height: 56px !important;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.25) 0%, rgba(255, 193, 7, 0.15) 100%) !important;
        border: 2.5px solid rgba(255, 212, 59, 0.7) !important;
        border-radius: 14px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #FFD43B !important;
        font-size: 1.5rem !important;
        text-decoration: none !important;
        box-shadow: 0 6px 20px rgba(255, 212, 59, 0.35) !important;
        transition: all 0.3s ease !important;
        z-index: 150 !important;
    }
    
    .mobile-course-map-btn:active {
        transform: scale(0.92) !important;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.35) 0%, rgba(255, 193, 7, 0.2) 100%) !important;
        box-shadow: 0 3px 15px rgba(255, 212, 59, 0.5) !important;
    }
    
    /* Отступ для заголовка от кнопки */
    .chapter-hero h1 {
        padding-right: 70px !important;
    }
    
    /* ============================================
       🗂️ DRAWER'Ы - ВИДИМОСТЬ И Z-INDEX
       ============================================ */
    
    /* Левый drawer (Содержание) */
    .sections-sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 85% !important;
        max-width: 350px !important;
        height: 100vh !important;
        height: 100dvh !important; /* Для iOS */
        z-index: 9999 !important; /* Очень высокий z-index */
        background: rgba(15, 15, 15, 0.98) !important;
        border-right: 3px solid rgba(255, 212, 59, 0.5) !important;
        border-radius: 0 !important;
        padding: 1.5rem 1rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.7) !important;
    }
    
    .sections-sidebar.open {
        left: 0 !important;
        display: block !important;
    }
    
    /* Правый drawer (Оценка) */
    .sidebar-right {
        position: fixed !important;
        right: -100% !important;
        top: 0 !important;
        width: 85% !important;
        max-width: 350px !important;
        height: 100vh !important;
        height: 100dvh !important; /* Для iOS */
        z-index: 9999 !important; /* Очень высокий z-index */
        background: rgba(15, 15, 15, 0.98) !important;
        border-left: 3px solid rgba(255, 212, 59, 0.5) !important;
        border-radius: 0 !important;
        padding: 1.5rem 1rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.7) !important;
    }
    
    .sidebar-right.open {
        right: 0 !important;
        display: block !important;
    }
    
    /* Заголовки drawer'ов - липкие */
    .sections-sidebar .sections-title,
    .sidebar-right .rating-title,
    .sidebar-right h3 {
        font-size: 1.2rem !important;
        padding: 1rem !important;
        margin: 0 0 1.5rem 0 !important;
        position: sticky !important;
        top: 0 !important;
        background: rgba(15, 15, 15, 0.98) !important;
        z-index: 100 !important;
        border-bottom: 2px solid rgba(255, 212, 59, 0.3) !important;
    }
    
    /* Пункты меню в drawer */
    .section-item {
        font-size: 0.95rem !important;
        padding: 1rem 0.8rem !important;
        margin: 0.4rem 0 !important;
        cursor: pointer !important;
        border-radius: 10px !important;
        background: rgba(255, 212, 59, 0.05) !important;
        border: 1px solid rgba(255, 212, 59, 0.2) !important;
        transition: all 0.2s !important;
    }
    
    .section-item:active {
        background: rgba(255, 212, 59, 0.15) !important;
        transform: translateX(5px) !important;
    }
    
    .section-item.active {
        background: rgba(255, 212, 59, 0.2) !important;
        border-color: rgba(255, 212, 59, 0.5) !important;
    }
    
    /* Стрелки между пунктами */
    .section-arrow {
        margin: 0.3rem 0 !important;
        text-align: center !important;
        font-size: 0.9rem !important;
    }
    
    /* Overlay поверх контента */
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important; /* Для iOS */
        background: rgba(0, 0, 0, 0.85) !important;
        z-index: 9998 !important; /* Чуть ниже drawer'ов */
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
        pointer-events: none !important;
    }
    
    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* ============================================
       📝 КОНТЕНТ - ЕЩЁ БОЛЕЕ КОМПАКТНЫЙ
       ============================================ */
    
    /* Основной контейнер */
    .content-center {
        padding: 0.8rem 0.6rem 140px 0.6rem !important;
        max-width: 100% !important;
    }
    
    /* Заголовки - компактнее */
    .content-section h1 {
        font-size: 1.25rem !important;
        padding: 0.6rem 0.4rem !important;
        margin: 0.8rem 0 !important;
        line-height: 1.3 !important;
    }
    
    .content-section h2 {
        font-size: 1.1rem !important;
        padding: 0.5rem 0.4rem !important;
        margin: 0.7rem 0 !important;
        line-height: 1.3 !important;
    }
    
    .content-section h3 {
        font-size: 1rem !important;
        padding: 0.4rem 0.4rem !important;
        margin: 0.6rem 0 !important;
        line-height: 1.3 !important;
    }
    
    /* Параграфы и текст - меньше */
    .content-section p {
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
        padding: 0.25rem 0.4rem !important;
        margin: 0.5rem 0 !important;
    }
    
    .content-section li {
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
        padding: 0.2rem 0.4rem !important;
        margin: 0.3rem 0 !important;
    }
    
    .content-section ul,
    .content-section ol {
        padding-left: 1.3rem !important;
        margin: 0.6rem 0 !important;
    }
    
    /* КОД-БЛОКИ - компактнее с прокруткой */
    .content-section pre {
        margin: 0.8rem 0.4rem !important;
        padding: 0.6rem !important;
        border-radius: 6px !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        font-size: 0.7rem !important;
        line-height: 1.35 !important;
        white-space: pre !important;
        word-wrap: normal !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .content-section code {
        font-size: 0.7rem !important;
        padding: 0.1rem 0.25rem !important;
    }
    
    /* Inline код */
    .content-section p code,
    .content-section li code {
        font-size: 0.8rem !important;
        padding: 0.15rem 0.35rem !important;
    }
    
    /* ТАБЛИЦЫ - прокрутка и компактность */
    .content-section table {
        display: block !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        font-size: 0.8rem !important;
        margin: 0.8rem 0.4rem !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .content-section th,
    .content-section td {
        padding: 0.4rem 0.6rem !important;
        white-space: nowrap !important;
        font-size: 0.8rem !important;
    }
    
    /* Блоки с примечаниями */
    .content-section blockquote {
        margin: 0.8rem 0.4rem !important;
        padding: 0.6rem 0.8rem !important;
        font-size: 0.85rem !important;
        border-left-width: 3px !important;
        line-height: 1.5 !important;
    }
    
    /* ============================================
       🎨 МОБИЛЬНАЯ ПАНЕЛЬ - УЛУЧШЕНИЯ
       ============================================ */
    
    .mobile-bottom-panel {
        z-index: 9000 !important; /* Ниже drawer'ов */
    }
    
    .mobile-btn {
        min-height: 56px !important;
    }
}

/* ============================================
   📱 ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ (≤360px)
   ============================================ */

@media (max-width: 360px) {
    .content-section h1 {
        font-size: 1.15rem !important;
    }
    
    .content-section h2 {
        font-size: 1.05rem !important;
    }
    
    .content-section p,
    .content-section li {
        font-size: 0.85rem !important;
    }
    
    .content-section pre {
        font-size: 0.65rem !important;
        padding: 0.5rem !important;
    }
    
    .mobile-course-map-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
    }
}

/* ============================================
   🔧 ФИНАЛЬНЫЕ ИСПРАВЛЕНИЯ МОБИЛЬНОЙ ВЕРСИИ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       🗺️ КНОПКА "КАРТА КУРСА" - УВЕЛИЧЕНА И ПРАВЕЕ
       ============================================ */
    
    .mobile-course-map-btn {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        width: 56px !important;
        height: 56px !important;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.25) 0%, rgba(255, 193, 7, 0.15) 100%) !important;
        border: 2.5px solid rgba(255, 212, 59, 0.7) !important;
        border-radius: 14px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #FFD43B !important;
        font-size: 1.5rem !important;
        text-decoration: none !important;
        box-shadow: 0 6px 20px rgba(255, 212, 59, 0.35) !important;
        transition: all 0.3s ease !important;
        z-index: 150 !important;
    }
    
    .mobile-course-map-btn:active {
        transform: scale(0.92) !important;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.35) 0%, rgba(255, 193, 7, 0.2) 100%) !important;
        box-shadow: 0 3px 15px rgba(255, 212, 59, 0.5) !important;
    }
    
    /* Отступ для заголовка от кнопки */
    .chapter-hero h1 {
        padding-right: 70px !important;
    }
    
    /* ============================================
       🗂️ DRAWER'Ы - ВИДИМОСТЬ И Z-INDEX
       ============================================ */
    
    /* Левый drawer (Содержание) */
    .sections-sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 85% !important;
        max-width: 350px !important;
        height: 100vh !important;
        height: 100dvh !important; /* Для iOS */
        z-index: 9999 !important; /* Очень высокий z-index */
        background: rgba(15, 15, 15, 0.98) !important;
        border-right: 3px solid rgba(255, 212, 59, 0.5) !important;
        border-radius: 0 !important;
        padding: 1.5rem 1rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.7) !important;
    }
    
    .sections-sidebar.open {
        left: 0 !important;
        display: block !important;
    }
    
    /* Правый drawer (Оценка) */
    .sidebar-right {
        position: fixed !important;
        right: -100% !important;
        top: 0 !important;
        width: 85% !important;
        max-width: 350px !important;
        height: 100vh !important;
        height: 100dvh !important; /* Для iOS */
        z-index: 9999 !important; /* Очень высокий z-index */
        background: rgba(15, 15, 15, 0.98) !important;
        border-left: 3px solid rgba(255, 212, 59, 0.5) !important;
        border-radius: 0 !important;
        padding: 1.5rem 1rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.7) !important;
    }
    
    .sidebar-right.open {
        right: 0 !important;
        display: block !important;
    }
    
    /* Заголовки drawer'ов - липкие */
    .sections-sidebar .sections-title,
    .sidebar-right .rating-title,
    .sidebar-right h3 {
        font-size: 1.2rem !important;
        padding: 1rem !important;
        margin: 0 0 1.5rem 0 !important;
        position: sticky !important;
        top: 0 !important;
        background: rgba(15, 15, 15, 0.98) !important;
        z-index: 100 !important;
        border-bottom: 2px solid rgba(255, 212, 59, 0.3) !important;
    }
    
    /* Пункты меню в drawer */
    .section-item {
        font-size: 0.95rem !important;
        padding: 1rem 0.8rem !important;
        margin: 0.4rem 0 !important;
        cursor: pointer !important;
        border-radius: 10px !important;
        background: rgba(255, 212, 59, 0.05) !important;
        border: 1px solid rgba(255, 212, 59, 0.2) !important;
        transition: all 0.2s !important;
    }
    
    .section-item:active {
        background: rgba(255, 212, 59, 0.15) !important;
        transform: translateX(5px) !important;
    }
    
    .section-item.active {
        background: rgba(255, 212, 59, 0.2) !important;
        border-color: rgba(255, 212, 59, 0.5) !important;
    }
    
    /* Стрелки между пунктами */
    .section-arrow {
        margin: 0.3rem 0 !important;
        text-align: center !important;
        font-size: 0.9rem !important;
    }
    
    /* Overlay поверх контента */
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important; /* Для iOS */
        background: rgba(0, 0, 0, 0.85) !important;
        z-index: 9998 !important; /* Чуть ниже drawer'ов */
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
        pointer-events: none !important;
    }
    
    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* ============================================
       📝 КОНТЕНТ - ЕЩЁ БОЛЕЕ КОМПАКТНЫЙ
       ============================================ */
    
    /* Основной контейнер */
    .content-center {
        padding: 0.8rem 0.6rem 140px 0.6rem !important;
        max-width: 100% !important;
    }
    
    /* Заголовки - компактнее */
    .content-section h1 {
        font-size: 1.25rem !important;
        padding: 0.6rem 0.4rem !important;
        margin: 0.8rem 0 !important;
        line-height: 1.3 !important;
    }
    
    .content-section h2 {
        font-size: 1.1rem !important;
        padding: 0.5rem 0.4rem !important;
        margin: 0.7rem 0 !important;
        line-height: 1.3 !important;
    }
    
    .content-section h3 {
        font-size: 1rem !important;
        padding: 0.4rem 0.4rem !important;
        margin: 0.6rem 0 !important;
        line-height: 1.3 !important;
    }
    
    /* Параграфы и текст - меньше */
    .content-section p {
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
        padding: 0.25rem 0.4rem !important;
        margin: 0.5rem 0 !important;
    }
    
    .content-section li {
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
        padding: 0.2rem 0.4rem !important;
        margin: 0.3rem 0 !important;
    }
    
    .content-section ul,
    .content-section ol {
        padding-left: 1.3rem !important;
        margin: 0.6rem 0 !important;
    }
    
    /* КОД-БЛОКИ - компактнее с прокруткой */
    .content-section pre {
        margin: 0.8rem 0.4rem !important;
        padding: 0.6rem !important;
        border-radius: 6px !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        font-size: 0.7rem !important;
        line-height: 1.35 !important;
        white-space: pre !important;
        word-wrap: normal !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .content-section code {
        font-size: 0.7rem !important;
        padding: 0.1rem 0.25rem !important;
    }
    
    /* Inline код */
    .content-section p code,
    .content-section li code {
        font-size: 0.8rem !important;
        padding: 0.15rem 0.35rem !important;
    }
    
    /* ТАБЛИЦЫ - прокрутка и компактность */
    .content-section table {
        display: block !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        font-size: 0.8rem !important;
        margin: 0.8rem 0.4rem !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .content-section th,
    .content-section td {
        padding: 0.4rem 0.6rem !important;
        white-space: nowrap !important;
        font-size: 0.8rem !important;
    }
    
    /* Блоки с примечаниями */
    .content-section blockquote {
        margin: 0.8rem 0.4rem !important;
        padding: 0.6rem 0.8rem !important;
        font-size: 0.85rem !important;
        border-left-width: 3px !important;
        line-height: 1.5 !important;
    }
    
    /* ============================================
       🎨 МОБИЛЬНАЯ ПАНЕЛЬ - УЛУЧШЕНИЯ
       ============================================ */
    
    .mobile-bottom-panel {
        z-index: 9000 !important; /* Ниже drawer'ов */
    }
    
    .mobile-btn {
        min-height: 56px !important;
    }
}

/* ============================================
   📱 ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ (≤360px)
   ============================================ */

@media (max-width: 360px) {
    .content-section h1 {
        font-size: 1.15rem !important;
    }
    
    .content-section h2 {
        font-size: 1.05rem !important;
    }
    
    .content-section p,
    .content-section li {
        font-size: 0.85rem !important;
    }
    
    .content-section pre {
        font-size: 0.65rem !important;
        padding: 0.5rem !important;
    }
    
    .mobile-course-map-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
    }
}

/* ============================================
   🔧 ИСПРАВЛЕНИЕ МОБИЛЬНЫХ ПРОБЛЕМ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       📝 КОД-БЛОКИ - ЕЩЁ МЕНЬШЕ, С ПРОКРУТКОЙ
       ============================================ */
    
    .content-section pre {
        margin: 0.6rem 0 !important;
        padding: 0.5rem 0.4rem !important;
        border-radius: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-width: calc(100vw - 1.2rem) !important;
        font-size: 0.6rem !important;
        line-height: 1.3 !important;
        white-space: pre !important;
        word-wrap: normal !important;
        word-break: normal !important;
        -webkit-overflow-scrolling: touch !important;
        /* Показываем скроллбар */
        scrollbar-width: thin !important;
        scrollbar-color: rgba(255, 212, 59, 0.5) rgba(0, 0, 0, 0.3) !important;
    }
    
    .content-section pre::-webkit-scrollbar {
        height: 4px !important;
    }
    
    .content-section pre::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3) !important;
    }
    
    .content-section pre::-webkit-scrollbar-thumb {
        background: rgba(255, 212, 59, 0.5) !important;
        border-radius: 2px !important;
    }
    
    .content-section code {
        font-size: 0.6rem !important;
        line-height: 1.3 !important;
    }
    
    /* Inline код */
    .content-section p code,
    .content-section li code {
        font-size: 0.75rem !important;
        padding: 0.15rem 0.3rem !important;
        white-space: nowrap !important;
    }
    
    /* ============================================
       🗂️ DRAWER'Ы - КОМПАКТНЕЕ (65% вместо 85%)
       ============================================ */
    
    /* Левый drawer (Содержание) */
    .sections-sidebar {
        width: 65% !important;
        max-width: 280px !important;
        /* Предотвращаем закрытие при скроле внутри */
        touch-action: pan-y !important;
        overscroll-behavior: contain !important;
    }
    
    /* Правый drawer (Оценка) */
    .sidebar-right {
        width: 65% !important;
        max-width: 280px !important;
        /* Предотвращаем закрытие при скроле внутри */
        touch-action: pan-y !important;
        overscroll-behavior: contain !important;
    }
    
    /* Заголовки drawer'ов - компактнее */
    .sections-sidebar .sections-title,
    .sidebar-right .rating-title,
    .sidebar-right h3 {
        font-size: 1.05rem !important;
        padding: 0.8rem !important;
        margin: 0 0 1rem 0 !important;
    }
    
    /* Пункты меню - компактнее */
    .section-item {
        font-size: 0.88rem !important;
        padding: 0.7rem 0.6rem !important;
        margin: 0.3rem 0 !important;
    }
    
    /* Overlay - не перекрывает события внутри drawer */
    .sidebar-overlay {
        pointer-events: auto !important;
    }
    
    /* Когда drawer открыт, overlay должен быть кликабельным */
    .sidebar-overlay.active {
        pointer-events: auto !important;
    }
}

/* ============================================
   📱 ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */

@media (max-width: 360px) {
    .content-section pre {
        font-size: 0.55rem !important;
        padding: 0.4rem 0.3rem !important;
    }
    
    .sections-sidebar,
    .sidebar-right {
        width: 70% !important;
        max-width: 260px !important;
    }
}

/* ============================================
   🔧 ОПТИМИЗАЦИЯ КОД-БЛОКОВ ДЛЯ МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       📝 КОД-БЛОКИ - МАКСИМАЛЬНО КОМПАКТНО
       ============================================ */
    
    .content-section pre {
        margin: 0.5rem 0 !important;
        padding: 0.4rem 0.3rem !important;
        border-radius: 6px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        /* Максимальная ширина - вся доступная область */
        max-width: calc(100vw - 1rem) !important;
        width: 100% !important;
        
        /* Еще меньше шрифт для влезания */
        font-size: 0.55rem !important;
        line-height: 1.25 !important;
        
        /* Запрещаем перенос - только горизонтальная прокрутка */
        white-space: pre !important;
        word-wrap: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        
        /* Плавная прокрутка */
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        
        /* ВИДИМЫЙ скроллбар */
        scrollbar-width: auto !important;
        scrollbar-color: rgba(255, 212, 59, 0.7) rgba(50, 50, 50, 0.5) !important;
    }
    
    /* Webkit браузеры (Chrome, Safari) - ЯРЧЕ скроллбар */
    .content-section pre::-webkit-scrollbar {
        height: 6px !important;
        background: rgba(50, 50, 50, 0.5) !important;
        border-radius: 3px !important;
    }
    
    .content-section pre::-webkit-scrollbar-track {
        background: rgba(50, 50, 50, 0.5) !important;
        border-radius: 3px !important;
        margin: 0 0.3rem !important;
    }
    
    .content-section pre::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, rgba(255, 212, 59, 0.8) 0%, rgba(255, 193, 7, 0.8) 100%) !important;
        border-radius: 3px !important;
        border: 1px solid rgba(255, 212, 59, 0.4) !important;
    }
    
    .content-section pre::-webkit-scrollbar-thumb:active {
        background: linear-gradient(90deg, rgba(255, 212, 59, 1) 0%, rgba(255, 193, 7, 1) 100%) !important;
    }
    
    /* Код внутри pre */
    .content-section pre code {
        font-size: 0.55rem !important;
        line-height: 1.25 !important;
        display: block !important;
        white-space: pre !important;
        padding: 0 !important;
    }
    
    /* Inline код в тексте - чуть крупнее */
    .content-section p code,
    .content-section li code,
    .content-section td code {
        font-size: 0.72rem !important;
        padding: 0.15rem 0.3rem !important;
        white-space: nowrap !important;
        background: rgba(255, 212, 59, 0.1) !important;
        border: 1px solid rgba(255, 212, 59, 0.2) !important;
        border-radius: 3px !important;
    }
    
    /* Визуальная подсказка что можно скроллить */
    .content-section pre::after {
        content: '⟶ скролл' !important;
        position: absolute !important;
        bottom: 0.3rem !important;
        right: 0.5rem !important;
        font-size: 0.65rem !important;
        color: rgba(255, 212, 59, 0.5) !important;
        pointer-events: none !important;
        opacity: 0.7 !important;
        font-family: system-ui, -apple-system, sans-serif !important;
    }
    
    /* Убираем подсказку если блок прокручен */
    .content-section pre:not([scrollLeft="0"])::after {
        display: none !important;
    }
    
    /* Контейнер для pre - относительное позиционирование */
    .content-section pre {
        position: relative !important;
    }
    
    /* ============================================
       📊 ТАБЛИЦЫ С КОДОМ - КОМПАКТНЕЕ
       ============================================ */
    
    .content-section table {
        font-size: 0.75rem !important;
        max-width: calc(100vw - 1rem) !important;
        overflow-x: auto !important;
        display: block !important;
    }
    
    .content-section table code {
        font-size: 0.7rem !important;
        white-space: nowrap !important;
    }
    
    .content-section th,
    .content-section td {
        padding: 0.35rem 0.5rem !important;
    }
    
    /* ============================================
       📝 КОММЕНТАРИИ В КОДЕ - КОМПАКТНЕЕ
       ============================================ */
    
    .content-section pre .comment,
    .content-section pre .c,
    .content-section pre .c1 {
        font-size: 0.5rem !important;
        opacity: 0.7 !important;
    }
}

/* ============================================
   📱 ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ (≤360px)
   ============================================ */

@media (max-width: 360px) {
    .content-section pre {
        font-size: 0.5rem !important;
        padding: 0.35rem 0.25rem !important;
        line-height: 1.2 !important;
    }
    
    .content-section pre code {
        font-size: 0.5rem !important;
    }
    
    .content-section p code,
    .content-section li code {
        font-size: 0.68rem !important;
    }
    
    .content-section pre::after {
        font-size: 0.6rem !important;
        bottom: 0.2rem !important;
        right: 0.3rem !important;
    }
}

/* ============================================
   🎨 УЛУЧШЕНИЕ КОНТРАСТА ДЛЯ ЧИТАЕМОСТИ
   ============================================ */

@media (max-width: 767px) {
    /* Код-блоки с более контрастным фоном */
    .content-section pre {
        background: rgba(20, 20, 20, 0.95) !important;
        border: 1px solid rgba(255, 212, 59, 0.2) !important;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Подсветка синтаксиса - ярче */
    .content-section pre .k,
    .content-section pre .kd,
    .content-section pre .keyword {
        color: #FFD43B !important;
        font-weight: 600 !important;
    }
    
    .content-section pre .s,
    .content-section pre .s1,
    .content-section pre .s2,
    .content-section pre .string {
        color: #a8ff60 !important;
    }
    
    .content-section pre .n,
    .content-section pre .na,
    .content-section pre .name {
        color: #ffffff !important;
    }
    
    .content-section pre .m,
    .content-section pre .mi,
    .content-section pre .number {
        color: #ff6188 !important;
    }
}

/* ============================================
   🎨 КРАСИВЫЙ DRAWER ОЦЕНКИ ДЛЯ МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       ⭐ ПРАВЫЙ DRAWER (ОЦЕНКА)
       ============================================ */
    
    /* Заголовок "Как понял?" */
    .sidebar-right h3,
    .sidebar-right .rating-title {
        font-size: 1.1rem !important;
        text-align: center !important;
        padding: 1rem 0.5rem !important;
        margin: 0 0 1.5rem 0 !important;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
        border-radius: 10px !important;
        border: 2px solid rgba(255, 212, 59, 0.3) !important;
    }
    
    /* Блок "💬 Как понял?" */
    .understanding-section h3 {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    /* Текст "Оцени насколько ты понял эту тему" */
    .understanding-section p,
    .sidebar-right p {
        font-size: 0.85rem !important;
        text-align: center !important;
        color: rgba(255, 255, 255, 0.7) !important;
        margin: 0.5rem 0 1rem 0 !important;
        line-height: 1.4 !important;
    }
    
    /* Подзаголовок "ТВОЯ ОЦЕНКА:" */
    .understanding-section strong,
    .sidebar-right strong {
        display: block !important;
        font-size: 0.75rem !important;
        text-align: center !important;
        color: rgba(255, 212, 59, 0.8) !important;
        margin: 1rem 0 0.8rem 0 !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
    }
    
    /* ============================================
       🎯 КНОПКИ ОЦЕНКИ - КРАСИВЫЕ
       ============================================ */
    
    /* Контейнер кнопок */
    .understanding-buttons,
    .sidebar-right .btn-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.7rem !important;
        padding: 0 !important;
        margin: 1rem 0 !important;
    }
    
    /* Общие стили для всех кнопок оценки */
    .understanding-buttons button,
    .sidebar-right button[onclick*="updateUnderstanding"] {
        width: 100% !important;
        padding: 0.9rem 1rem !important;
        border-radius: 12px !important;
        border: 2px solid !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.7rem !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    /* Иконки в кнопках */
    .understanding-buttons button i,
    .sidebar-right button[onclick*="updateUnderstanding"] i {
        font-size: 1.3rem !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* Кнопка "ОТЛИЧНО!" (зеленая) */
    .understanding-buttons button:first-child,
    .sidebar-right button[onclick*="'excellent'"] {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.05) 100%) !important;
        border-color: rgba(76, 175, 80, 0.5) !important;
        color: #81C784 !important;
    }
    
    .understanding-buttons button:first-child:active,
    .sidebar-right button[onclick*="'excellent'"]:active {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.25) 0%, rgba(76, 175, 80, 0.15) 100%) !important;
        border-color: rgba(76, 175, 80, 0.8) !important;
        transform: scale(0.98) !important;
    }
    
    .understanding-buttons button:first-child i,
    .sidebar-right button[onclick*="'excellent'"] i {
        background: rgba(76, 175, 80, 0.2) !important;
        color: #66BB6A !important;
    }
    
    /* Кнопка "Частично" (желтая) */
    .understanding-buttons button:nth-child(2),
    .sidebar-right button[onclick*="'partial'"] {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
        border-color: rgba(255, 193, 7, 0.5) !important;
        color: #FFD54F !important;
    }
    
    .understanding-buttons button:nth-child(2):active,
    .sidebar-right button[onclick*="'partial'"]:active {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 193, 7, 0.15) 100%) !important;
        border-color: rgba(255, 193, 7, 0.8) !important;
        transform: scale(0.98) !important;
    }
    
    .understanding-buttons button:nth-child(2) i,
    .sidebar-right button[onclick*="'partial'"] i {
        background: rgba(255, 193, 7, 0.2) !important;
        color: #FFC107 !important;
    }
    
    /* Кнопка "Не понял" (красная) */
    .understanding-buttons button:last-child,
    .sidebar-right button[onclick*="'poor'"] {
        background: linear-gradient(135deg, rgba(244, 67, 54, 0.15) 0%, rgba(244, 67, 54, 0.05) 100%) !important;
        border-color: rgba(244, 67, 54, 0.5) !important;
        color: #E57373 !important;
    }
    
    .understanding-buttons button:last-child:active,
    .sidebar-right button[onclick*="'poor'"]:active {
        background: linear-gradient(135deg, rgba(244, 67, 54, 0.25) 0%, rgba(244, 67, 54, 0.15) 100%) !important;
        border-color: rgba(244, 67, 54, 0.8) !important;
        transform: scale(0.98) !important;
    }
    
    .understanding-buttons button:last-child i,
    .sidebar-right button[onclick*="'poor'"] i {
        background: rgba(244, 67, 54, 0.2) !important;
        color: #EF5350 !important;
    }
    
    /* Кнопка "Частично" - если активна (выбрана) */
    .understanding-buttons button.active,
    .sidebar-right button.selected {
        border-width: 3px !important;
        box-shadow: 0 0 20px rgba(255, 212, 59, 0.4) !important;
    }
    
    /* ============================================
       📊 СТАТИСТИКА В DRAWER
       ============================================ */
    
    .sidebar-right .stats,
    .sidebar-right .progress-info {
        margin-top: 1.5rem !important;
        padding: 0.8rem !important;
        background: rgba(255, 212, 59, 0.05) !important;
        border-radius: 10px !important;
        border: 1px solid rgba(255, 212, 59, 0.2) !important;
    }
    
    .sidebar-right .stats p,
    .sidebar-right .progress-info p {
        font-size: 0.8rem !important;
        margin: 0.3rem 0 !important;
        display: flex !important;
        justify-content: space-between !important;
    }
    
    /* ============================================
       🔙 КНОПКА "ПРЕДЫДУЩАЯ" В DRAWER
       ============================================ */
    
    .sidebar-right .nav-button,
    .sidebar-right a[href*="chapter"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.6rem !important;
        padding: 0.8rem !important;
        margin-top: 1.5rem !important;
        background: rgba(255, 212, 59, 0.1) !important;
        border: 2px solid rgba(255, 212, 59, 0.3) !important;
        border-radius: 10px !important;
        color: #FFD43B !important;
        text-decoration: none !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
    }
    
    .sidebar-right .nav-button:active,
    .sidebar-right a[href*="chapter"]:active {
        background: rgba(255, 212, 59, 0.2) !important;
        border-color: rgba(255, 212, 59, 0.5) !important;
        transform: translateX(-5px) !important;
    }
    
    /* ============================================
       ✨ ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ
       ============================================ */
    
    /* Разделитель */
    .sidebar-right hr {
        border: none !important;
        height: 1px !important;
        background: linear-gradient(90deg, transparent 0%, rgba(255, 212, 59, 0.3) 50%, transparent 100%) !important;
        margin: 1.5rem 0 !important;
    }
    
    /* Прокрутка внутри drawer */
    .sidebar-right {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-bottom: 2rem !important;
    }
    
    /* Скроллбар для drawer */
    .sidebar-right::-webkit-scrollbar {
        width: 4px !important;
    }
    
    .sidebar-right::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3) !important;
    }
    
    .sidebar-right::-webkit-scrollbar-thumb {
        background: rgba(255, 212, 59, 0.5) !important;
        border-radius: 2px !important;
    }
}

/* ============================================
   🎨 КРАСИВЫЙ DRAWER "КАК ПОНЯЛ?" + МЕНЮ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       ⭐ DRAWER ОЦЕНКИ - МАКСИМАЛЬНО КРАСИВО
       ============================================ */
    
    /* Весь drawer */
    .sidebar-right {
        background: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(25, 25, 25, 0.98) 100%) !important;
        backdrop-filter: blur(20px) !important;
    }
    
    /* Заголовок "Как понял?" */
    .sidebar-right h3,
    .understanding-section h3 {
        font-size: 1.3rem !important;
        text-align: center !important;
        padding: 1.2rem 1rem !important;
        margin: 0 0 0.8rem 0 !important;
        background: linear-gradient(135deg, rgba(255, 212, 59, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%) !important;
        border-radius: 15px !important;
        border: 2px solid rgba(255, 212, 59, 0.4) !important;
        color: #FFD43B !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.6rem !important;
        box-shadow: 0 4px 15px rgba(255, 212, 59, 0.15) !important;
    }
    
    /* Описание */
    .sidebar-right p:first-of-type,
    .understanding-section > p {
        font-size: 0.9rem !important;
        text-align: center !important;
        color: rgba(255, 255, 255, 0.75) !important;
        margin: 0 0 1.2rem 0 !important;
        line-height: 1.5 !important;
        padding: 0 0.5rem !important;
    }
    
    /* "ТВОЯ ОЦЕНКА:" */
    .sidebar-right strong {
        display: block !important;
        font-size: 0.7rem !important;
        text-align: center !important;
        color: rgba(255, 212, 59, 0.7) !important;
        margin: 1.5rem 0 1rem 0 !important;
        letter-spacing: 2px !important;
        text-transform: uppercase !important;
    }
    
    /* ============================================
       🎯 КНОПКИ ОЦЕНКИ - СУПЕР КРАСИВЫЕ
       ============================================ */
    
    /* Контейнер */
    .understanding-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.8rem !important;
        padding: 0 0.3rem !important;
        margin: 0 0 1.5rem 0 !important;
    }
    
    /* Все кнопки */
    .understanding-buttons button,
    .sidebar-right button[onclick*="updateUnderstanding"] {
        width: 100% !important;
        padding: 1rem 1.2rem !important;
        border-radius: 14px !important;
        border: 2.5px solid !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.8rem !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        cursor: pointer !important;
        position: relative !important;
        overflow: hidden !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Иконки - красивые квадраты */
    .understanding-buttons button i,
    .sidebar-right button[onclick*="updateUnderstanding"] i {
        font-size: 1.4rem !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }
    
    /* "Отлично!" - зеленая */
    .understanding-buttons button:first-child,
    .sidebar-right button[onclick*="'excellent'"] {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.1) 100%) !important;
        border-color: rgba(76, 175, 80, 0.6) !important;
        color: #81C784 !important;
    }
    
    .understanding-buttons button:first-child:active,
    .sidebar-right button[onclick*="'excellent'"]:active {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.2) 100%) !important;
        border-color: rgba(76, 175, 80, 0.9) !important;
        transform: scale(0.97) !important;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4) !important;
    }
    
    .understanding-buttons button:first-child i,
    .sidebar-right button[onclick*="'excellent'"] i {
        background: rgba(76, 175, 80, 0.25) !important;
        color: #66BB6A !important;
    }
    
    /* "Частично" - желтая */
    .understanding-buttons button:nth-child(2),
    .sidebar-right button[onclick*="'partial'"] {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%) !important;
        border-color: rgba(255, 193, 7, 0.6) !important;
        color: #FFD54F !important;
    }
    
    .understanding-buttons button:nth-child(2):active,
    .sidebar-right button[onclick*="'partial'"]:active {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 193, 7, 0.2) 100%) !important;
        border-color: rgba(255, 193, 7, 0.9) !important;
        transform: scale(0.97) !important;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4) !important;
    }
    
    .understanding-buttons button:nth-child(2) i,
    .sidebar-right button[onclick*="'partial'"] i {
        background: rgba(255, 193, 7, 0.25) !important;
        color: #FFC107 !important;
    }
    
    /* "Не понял" - красная */
    .understanding-buttons button:last-child,
    .sidebar-right button[onclick*="'poor'"] {
        background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(244, 67, 54, 0.1) 100%) !important;
        border-color: rgba(244, 67, 54, 0.6) !important;
        color: #E57373 !important;
    }
    
    .understanding-buttons button:last-child:active,
    .sidebar-right button[onclick*="'poor'"]:active {
        background: linear-gradient(135deg, rgba(244, 67, 54, 0.3) 0%, rgba(244, 67, 54, 0.2) 100%) !important;
        border-color: rgba(244, 67, 54, 0.9) !important;
        transform: scale(0.97) !important;
        box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4) !important;
    }
    
    .understanding-buttons button:last-child i,
    .sidebar-right button[onclick*="'poor'"] i {
        background: rgba(244, 67, 54, 0.25) !important;
        color: #EF5350 !important;
    }
    
    /* ============================================
       📱 ОСНОВНОЕ МЕНЮ (NAVBAR) - КРАСИВЕЕ
       ============================================ */
    
    /* Меню когда открыто */
    .navbar-menu.active {
        background: linear-gradient(180deg, rgba(20, 20, 20, 0.98) 0%, rgba(30, 30, 30, 0.98) 100%) !important;
        backdrop-filter: blur(20px) !important;
        padding: 1.5rem 1rem !important;
        border-radius: 0 0 20px 20px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Ссылки в меню */
    .navbar-menu .nav-link {
        padding: 1rem 1.2rem !important;
        margin: 0.4rem 0 !important;
        border-radius: 12px !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
        border: 2px solid transparent !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.8rem !important;
    }
    
    .navbar-menu .nav-link i {
        font-size: 1.3rem !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        background: rgba(255, 212, 59, 0.1) !important;
    }
    
    /* Дашборд */
    .navbar-menu .nav-link:nth-child(1) {
        border-color: rgba(76, 175, 80, 0.3) !important;
        background: rgba(76, 175, 80, 0.05) !important;
        color: #81C784 !important;
    }
    
    .navbar-menu .nav-link:nth-child(1):active {
        background: rgba(76, 175, 80, 0.15) !important;
        border-color: rgba(76, 175, 80, 0.6) !important;
        transform: translateX(5px) !important;
    }
    
    /* Карта курса */
    .navbar-menu .nav-link:nth-child(2) {
        border-color: rgba(33, 150, 243, 0.3) !important;
        background: rgba(33, 150, 243, 0.05) !important;
        color: #64B5F6 !important;
    }
    
    .navbar-menu .nav-link:nth-child(2):active {
        background: rgba(33, 150, 243, 0.15) !important;
        border-color: rgba(33, 150, 243, 0.6) !important;
        transform: translateX(5px) !important;
    }
    
    /* Мой прогресс */
    .navbar-menu .nav-link:nth-child(3) {
        border-color: rgba(255, 193, 7, 0.3) !important;
        background: rgba(255, 193, 7, 0.05) !important;
        color: #FFD54F !important;
    }
    
    .navbar-menu .nav-link:nth-child(3):active {
        background: rgba(255, 193, 7, 0.15) !important;
        border-color: rgba(255, 193, 7, 0.6) !important;
        transform: translateX(5px) !important;
    }
    
    /* Админ панель */
    .navbar-menu .nav-link:nth-child(4) {
        border-color: rgba(156, 39, 176, 0.3) !important;
        background: rgba(156, 39, 176, 0.05) !important;
        color: #BA68C8 !important;
    }
    
    .navbar-menu .nav-link:nth-child(4):active {
        background: rgba(156, 39, 176, 0.15) !important;
        border-color: rgba(156, 39, 176, 0.6) !important;
        transform: translateX(5px) !important;
    }
}

/* ============================================
   🎨 POPUP ОЦЕНКИ + ИСПРАВЛЕНИЕ СКРОЛА
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       ⭐ DRAWER ОЦЕНКИ - КАК POPUP ОТ КНОПКИ
       ============================================ */
    
    /* Правый drawer теперь popup */
    .sidebar-right {
        position: fixed !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: 80px !important; /* Над нижней панелью */
        top: auto !important;
        width: 90% !important;
        max-width: 380px !important;
        height: auto !important;
        max-height: 70vh !important;
        z-index: 10001 !important;
        background: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(25, 25, 25, 0.98) 100%) !important;
        backdrop-filter: blur(20px) !important;
        border: 3px solid rgba(255, 212, 59, 0.5) !important;
        border-radius: 20px !important;
        padding: 1.5rem 1rem 1.2rem 1rem !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 0 9999px rgba(0, 0, 0, 0.7) !important;
        
        /* Скрыт по умолчанию */
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateX(-50%) translateY(20px) scale(0.95) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* Открытое состояние */
    .sidebar-right.open {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateX(-50%) translateY(0) scale(1) !important;
    }
    
    /* Убираем старый переход справа */
    .sidebar-right {
        left: 50% !important;
        right: auto !important;
    }
    
    /* Скролл внутри popup */
    .sidebar-right {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* ============================================
       🗂️ DRAWER "ТЕМЫ" - НЕ ЗАКРЫВАЕТСЯ ПРИ СКРОЛЕ
       ============================================ */
    
    /* Левый drawer - запрещаем закрытие при скроле */
    .sections-sidebar {
        touch-action: pan-y !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Overlay - только при тапе, не при движении */
    .sidebar-overlay {
        touch-action: none !important;
    }
    
    /* ============================================
       ✨ СТРЕЛКА ОТ КНОПКИ К POPUP
       ============================================ */
    
    /* Маленькая стрелка снизу popup */
    .sidebar-right::before {
        content: '' !important;
        position: absolute !important;
        bottom: -12px !important;
        right: 30px !important;
        width: 0 !important;
        height: 0 !important;
        border-left: 12px solid transparent !important;
        border-right: 12px solid transparent !important;
        border-top: 12px solid rgba(255, 212, 59, 0.5) !important;
        z-index: 1 !important;
    }
    
    .sidebar-right::after {
        content: '' !important;
        position: absolute !important;
        bottom: -9px !important;
        right: 32px !important;
        width: 0 !important;
        height: 0 !important;
        border-left: 10px solid transparent !important;
        border-right: 10px solid transparent !important;
        border-top: 10px solid rgba(15, 15, 15, 0.98) !important;
        z-index: 2 !important;
    }
    
    /* ============================================
       📱 АДАПТАЦИЯ КНОПОК В POPUP
       ============================================ */
    
    /* Заголовок компактнее */
    .sidebar-right h3 {
        font-size: 1.15rem !important;
        padding: 0.8rem 0.5rem !important;
        margin: 0 0 0.6rem 0 !important;
    }
    
    /* Описание компактнее */
    .sidebar-right p:first-of-type {
        font-size: 0.85rem !important;
        margin: 0 0 1rem 0 !important;
    }
    
    /* "ТВОЯ ОЦЕНКА:" */
    .sidebar-right strong {
        margin: 1rem 0 0.7rem 0 !important;
    }
    
    /* Кнопки оценки компактнее */
    .understanding-buttons {
        gap: 0.6rem !important;
        margin: 0 0 1rem 0 !important;
    }
    
    .understanding-buttons button {
        padding: 0.8rem 1rem !important;
        font-size: 0.95rem !important;
    }
    
    .understanding-buttons button i {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.3rem !important;
    }
}

/* ============================================
   📱 ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */

@media (max-width: 360px) {
    .sidebar-right {
        width: 95% !important;
        bottom: 75px !important;
        padding: 1.2rem 0.8rem 1rem 0.8rem !important;
    }
    
    .sidebar-right h3 {
        font-size: 1.05rem !important;
    }
    
    .understanding-buttons button {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.9rem !important;
    }
}

/* ============================================
   🔧 ИСПРАВЛЕНИЕ КНОПКИ ОЦЕНКА
   ============================================ */

@media (max-width: 767px) {
    
    /* Нижняя панель должна быть выше overlay но ниже popup */
    .mobile-bottom-panel {
        z-index: 9500 !important;
        position: relative !important;
    }
    
    /* Кнопки должны быть кликабельными */
    .mobile-btn {
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Popup оценки должен быть выше всего */
    .sidebar-right {
        z-index: 10001 !important;
        display: block !important; /* Всегда в DOM */
    }
    
    /* Overlay должен быть между панелью и popup */
    .sidebar-overlay {
        z-index: 10000 !important;
    }
    
    /* Убеждаемся что popup действительно скрыт по умолчанию */
    .sidebar-right:not(.open) {
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateX(-50%) translateY(30px) scale(0.9) !important;
        visibility: hidden !important;
    }
    
    /* И виден когда открыт */
    .sidebar-right.open {
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateX(-50%) translateY(0) scale(1) !important;
        visibility: visible !important;
        display: block !important;
    }
    
    /* Overlay не должен перекрывать нижнюю панель когда неактивен */
    .sidebar-overlay:not(.active) {
        pointer-events: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    .sidebar-overlay.active {
        pointer-events: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 10000 !important;
    }
    
    /* Тень popup не должна быть 9999px - это ломает клики */
    .sidebar-right {
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8) !important;
    }
    
    /* Отдельный backdrop для popup */
    .sidebar-right.open::before {
        content: '' !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        z-index: -1 !important;
        animation: fadeIn 0.3s ease !important;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

/* ============================================
   🔧 СРОЧНОЕ ИСПРАВЛЕНИЕ МОБИЛЬНОЙ ВЕРСИИ
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       📱 НИЖНЯЯ ПАНЕЛЬ - ФИКСИРОВАННАЯ!
       ============================================ */
    
    .mobile-bottom-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9500 !important;
        /* Все остальное как было */
    }
    
    /* ============================================
       🗂️ DRAWER "ТЕМЫ" - ДОЛЖЕН ОТКРЫВАТЬСЯ!
       ============================================ */
    
    .sections-sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 65% !important;
        max-width: 280px !important;
        height: 100vh !important;
        z-index: 10001 !important;
        transition: left 0.3s ease !important;
    }
    
    .sections-sidebar.open {
        left: 0 !important;
    }
    
    /* ============================================
       ⭐ POPUP ОЦЕНКИ - КОМПАКТНЕЕ!
       ============================================ */
    
    .sidebar-right {
        /* Позиционирование */
        position: fixed !important;
        left: 50% !important;
        bottom: 90px !important;
        transform: translateX(-50%) !important;
        
        /* Размер - меньше! */
        width: 88% !important;
        max-width: 360px !important;
        max-height: 60vh !important;
        
        /* Скрыт по умолчанию */
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateX(-50%) scale(0.9) !important;
        transition: all 0.3s ease !important;
        
        /* Остальное */
        top: auto !important;
        right: auto !important;
        height: auto !important;
        z-index: 10002 !important;
    }
    
    .sidebar-right.open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateX(-50%) scale(1) !important;
    }
    
    /* Компактный контент внутри popup */
    .sidebar-right h3 {
        font-size: 1.05rem !important;
        padding: 0.7rem 0.5rem !important;
        margin: 0 0 0.5rem 0 !important;
    }
    
    .sidebar-right p {
        font-size: 0.8rem !important;
        margin: 0 0 0.8rem 0 !important;
    }
    
    .sidebar-right strong {
        margin: 0.8rem 0 0.5rem 0 !important;
        font-size: 0.65rem !important;
    }
    
    .understanding-buttons {
        gap: 0.5rem !important;
        margin: 0 0 0.8rem 0 !important;
    }
    
    .understanding-buttons button {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.9rem !important;
    }
    
    .understanding-buttons button i {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.2rem !important;
    }
    
    /* Кнопка "Предыдущая" компактнее */
    .sidebar-right a[href*="chapter"],
    .sidebar-right .nav-button {
        padding: 0.7rem !important;
        margin-top: 0.8rem !important;
        font-size: 0.85rem !important;
    }
    
    /* ============================================
       🌑 OVERLAY - ПРАВИЛЬНЫЙ Z-INDEX
       ============================================ */
    
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, 0.8) !important;
        z-index: 10000 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
    }
    
    .sidebar-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* ============================================
   📱 ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */

@media (max-width: 360px) {
    .sidebar-right {
        width: 92% !important;
        max-height: 55vh !important;
        bottom: 85px !important;
    }
    
    .understanding-buttons button {
        padding: 0.6rem 0.7rem !important;
        font-size: 0.85rem !important;
    }
}

