/*
Theme Name: Банк заданий ЕГЭ
Description: Тема для банка заданий ЕГЭ по географии
Version: 3.0
Author: Ваше имя
*/

/* ===== ПОДКЛЮЧЕНИЕ ШРИФТА TT NORMS PRO ===== */
@font-face {
    font-family: 'TT Norms Pro';
    src: url('fonts/tt-norms-pro-regular.woff2') format('woff2'),
         url('fonts/tt-norms-pro-regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TT Norms Pro';
    src: url('fonts/tt-norms-pro-medium.woff2') format('woff2'),
         url('fonts/tt-norms-pro-medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ===== БАЗОВЫЕ СБРОСЫ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'TT Norms Pro', Arial, sans-serif;
    /*
     * Базовый фон сайта — светлый.
     *
     * Раньше здесь глобально стоял #CFFFD6. Из-за этого любой внешний
     * отступ перед/после футера показывал зелёную полосу даже на белых
     * и светло-серых страницах.
     *
     * Зелёный фон теперь включается только на страницах, которым он
     * действительно нужен (банк заданий, варианты, вход/регистрация).
     */
    background: #fff;
    color: #2c3e50;
    line-height: 1.6;
    padding: 0px;
}

/* =====================================================
   ФОНЫ СТРАНИЦ
   ===================================================== */

/* Банк заданий и связанные учебные страницы */
body.post-type-archive-ege_task,
body.single-ege_task,
body.tax-ege_section,
body.tax-code_theme,
body.page-template-page-variants {
    background: #CFFFD6;
}

/* Страницы авторизации — сохраняем существующий зелёный фон */
body.page-template-page-login,
body.page-template-page-register {
    background: #CFFFD6;
}

/*
 * Светлые системные страницы.
 * Явно задаём фон body, чтобы он продолжался и в margin футера,
 * и в нижнем mobile safe-area / padding под фиксированное меню.
 */
body.page-template-page-profile,
body.page-template-page-progress {
    background: #fafafa !important;
}

body.page-template-page-privacy-policy,
body.page-template-page-personal-data-consent,
body.page-template-page-user-agreement {
    background: #fafafa !important;
}

/* Блог уже использует #fafafa внутри шаблонов, фиксируем и на body */
body.post-type-archive-blog,
body.single-blog,
body.category {
    background: #fafafa !important;
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.ege-bank-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== ШАПКА ===== */
.ege-bank-header {
    text-align: left;  /* Выравнивание по левому краю */
    margin-bottom: 20px;  /* Уменьшаем отступ снизу */
    padding: 10px 0;  /* Убираем белый фон, только вертикальные отступы */
    background: transparent;  /* Прозрачный фон */
    border-radius: 0;  /* Убираем скругление */
}

.page-title {
    font-size: 1.8em;  /* Немного уменьшаем размер */
    color: #2c3e50;
    margin-bottom: 5px;  /* Уменьшаем отступ */
    font-weight: 500;
    line-height: 1.2;  /* Уменьшаем высоту строки */
}

.bank-stats {
    display: none; /* Скрываем счетчик в верхнем блоке */
}

/* Новая статистика в сайдбаре */
.sidebar-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.sidebar-stat {
    font-size: 0.9em;
    color: #2c3e50;
}

.stat-count {
    font-weight: 500;
    color: #2c3e50;
}

/* ===== ОСНОВНОЙ МАКЕТ ===== */
.ege-bank-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start; /* Выравнивание по верху */
}

/* ===== САЙДБАР ===== */
.bank-sidebar {
    background: white;
    padding: 25px;
    border-radius: 20px;
    height: fit-content; /* Ограничиваем высоту по содержимому */
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-title {
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 500;
}

/* ===== ТРЕНИРОВОЧНЫЕ ВАРИАНТЫ ===== */
.variant-button-container {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #e0e0e0;
}

.go-to-variants-btn {
    display: inline-block;
    background: #CFFFD6;
    color: #000;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.go-to-variants-btn:hover {
    background: #b8f0c4;
    transform: translateY(-2px);
}

.variants-description {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    line-height: 1.4;
}

/* ===== КНОПКИ С НОМЕРАМИ ЗАДАНИЙ ===== */
.task-numbers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: flex-start;
}

.task-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;        /* Фиксированная ширина */
    height: 48px;       /* Фиксированная высота - круг */
    padding: 0;         /* Убираем внутренние отступы */
    background: white;
    border: 1px solid #CFFFD6;  /* Тонкая зеленая обводка */
    border-radius: 50%;         /* Круглая форма */
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 16px;    /* Чуть меньше текст */
}

.task-number:hover {
    background: #CFFFD6;
    border-color: #CFFFD6;  /* Зеленая обводка при наведении */
    transform: scale(1.05);  /* Легкое увеличение при наведении */
}

.task-number.active {
    background: #CFFFD6;
    border-color: #CFFFD6;  /* Зеленая обводка */
    font-weight: 600;
}

/* Для мобильной версии чуть уменьшаем */
@media (max-width: 768px) {
    .task-number {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* Разделы */
.sections-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 15px;
}

.section-number {
    color: #2c3e50;
    font-weight: 500;
    min-width: 24px;
}

.section-link {
    flex: 1;
    color: #2c3e50;
    text-decoration: none;
}

.section-count {
    background: #e0e0e0;
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Выбор темы */
.theme-selector select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: white;
    font-family: 'TT Norms Pro', Arial, sans-serif;
}

/* Кнопки фильтров */
.filter-actions {
    margin-top: 15px;
}

.filter-btn, .reset-filters-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 10px;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    font-size: 0.95em;
    transition: all 0.2s;
}

.filter-btn {
    background: #CFFFD6;
    color: #000;
}

.filter-btn:hover {
    background: #b8f0c4;
}

.reset-filters-btn {
    background: #e0e0e0;
    color: #000;
}

.reset-filters-btn:hover {
    background: #d0d0d0;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.bank-main-content {
    min-height: 400px;
}

/* Группа заданий */
.task-kim-group {
    margin-bottom: 20px;
    padding: 25px;
    background: white;
    border-radius: 20px;
}

.kim-group-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 500;
}

/* Карточка задания */
.task-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 20px;
}

.task-header {
    margin-bottom: 20px;
}

.task-title {
    font-size: 1.4em;
    color: #2c3e50;
    font-weight: 500;
}

.task-card-content {
    margin-bottom: 25px;
}

.task-full-text {
    font-size: 1em;
    line-height: 1.6;
    color: #2c3e50;
    margin-bottom: 20px;
}

.task-full-text p {
    margin-bottom: 12px;
}

.task-image {
    margin: 20px 0;
    text-align: center;
}

.task-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

.task-table {
    margin: 20px 0;
    overflow-x: auto;
}

.task-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
}

.task-table th,
.task-table td {
    padding: 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.task-table th {
    background: #f8f9fa;
    font-weight: 500;
}

.task-meta {
    margin: 10px 0;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 14px;
    color: #666;
}

.task-meta strong {
    color: #2c3e50;
    margin-right: 5px;
}

/* ===== ИСПРАВЛЕНИЯ ДЛЯ СПИСКОВ ===== */
.task-full-text ul,
.task-full-text ol,
.correct-answer ul,
.correct-answer ol,
.answer-explanation ul,
.answer-explanation ol,
.spoiler-content ul,
.spoiler-content ol,
.explanation-content ul,
.explanation-content ol {
    margin: 15px 0 15px 25px !important; /* Одинаковые отступы сверху и снизу */
    padding-left: 20px !important;
    line-height: 1.6 !important;
}

.task-full-text li,
.correct-answer li,
.answer-explanation li,
.spoiler-content li,
.explanation-content li {
    margin-bottom: 8px !important;
    line-height: 1.6 !important;
}

.task-full-text ul,
.correct-answer ul,
.answer-explanation ul,
.spoiler-content ul,
.explanation-content ul {
    list-style-type: disc !important;
}

.task-full-text ol,
.correct-answer ol,
.answer-explanation ol,
.spoiler-content ol,
.explanation-content ol {
    list-style-type: decimal !important;
}

/* ===== БЛОКИ ОТВЕТОВ ДЛЯ РАЗНЫХ ТИПОВ ЗАДАНИЙ ===== */

/* Блок ответа для первой части (с автопроверкой) */
.task-answer-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 18px;
    margin: 20px 0;
}

.task-answer-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 500;
}

/* ===== ИСПРАВЛЕНИЯ ДЛЯ ПОЛЯ ВВОДА С ЕДИНИЦАМИ ИЗМЕРЕНИЯ ===== */
.answer-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    align-items: center;
}

.answer-input {
    flex: 1;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 1em;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    min-width: 0; /* Важно для flex-контейнера */
}

.answer-input:focus {
    outline: none;
    border-color: #CFFFD6;
}

.answer-input.correct {
    border-color: #28a745;
    background-color: #f8fff9;
}

.answer-input.incorrect {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.answer-unit {
    padding: 14px 12px;
    font-size: 1em;
    font-weight: 500;
    color: #2c3e50;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 15px;
    white-space: nowrap;
}

.check-answer-btn {
    background: #CFFFD6;
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
}

.check-answer-btn:hover {
    background: #b8f0c4;
}

.check-answer-btn:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
}

.answer-result {
    padding: 12px 15px;
    border-radius: 15px;
    font-weight: 500;
}

.answer-result.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.answer-result.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.answer-result.error {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.answer-result.loading {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Блок ответа для второй части (с кнопкой показа ответа) */
.task-answer-section.second-part {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 18px;
    margin: 20px 0;
}

.show-answer-section {
    text-align: left; /* Выравнивание по левому краю */
    margin-bottom: 0;
}

.show-answer-btn {
    background: #e0e0e0; /* Серый цвет */
    color: #000;
    border: none;
    padding: 10px 20px; /* Уменьшенный padding */
    border-radius: 15px;
    cursor: pointer;
    font-weight: 500;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    transition: all 0.2s;
    font-size: 0.9em; /* Уменьшенный размер текста */
}

.show-answer-btn:hover {
    background: #d0d0d0; /* Темнее при наведении */
}

.full-answer-content {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.full-answer-content h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 500;
}

.correct-answer {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.correct-answer strong {
    color: #28a745;
    display: block;
    margin-bottom: 8px;
}

.answer-explanation strong {
    color: #17a2b8;
    display: block;
    margin-bottom: 8px;
}

/* Спойлеры - светло-серый цвет */
.task-help-section {
    margin: 20px 0;
}

.task-spoiler,
.task-explanation {
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    margin-bottom: 12px;
    overflow: hidden;
}

.spoiler-toggle,
.explanation-toggle {
    width: 100%;
    background: #f8f9fa; /* Светло-серый вместо зеленого */
    border: none;
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    color: #2c3e50; /* Темный текст */
    border-radius: 15px 15px 0 0;
    transition: all 0.2s;
}

.spoiler-toggle:hover,
.explanation-toggle:hover {
    background: #e9ecef; /* Немного темнее при наведении */
}

.spoiler-content,
.explanation-content {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.spoiler-content p,
.explanation-content p {
    margin-bottom: 12px;
}

.spoiler-content p:last-child,
.explanation-content p:last-child {
    margin-bottom: 0;
}

/* Футер карточки */
.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.task-id {
    font-size: 0.8em;
    color: #999;
}

.solve-btn {
    background: white; /* Белый цвет */
    color: #2c3e50;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 500;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    transition: all 0.2s;
    font-size: 0.85em; /* Уменьшенный размер текста */
}

.solve-btn:hover {
    background: #f8f9fa;
    border-color: #CFFFD6;
}

/* Сообщение когда нет заданий */
.no-tasks-message {
    text-align: center;
    padding: 50px 30px;
    background: white;
    border-radius: 20px;
    border: 2px dashed #bdc3c7;
}

.no-tasks-message h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 500;
}

.no-tasks-message p {
    color: #666;
    margin-bottom: 25px;
}

/* Кнопка в сообщении */
.no-tasks-message .button {
    background: #CFFFD6;
    color: #000;
    padding: 12px 24px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 500;
    font-family: 'TT Norms Pro', Arial, sans-serif;
    display: inline-block;
    margin-top: 20px;
}

.no-tasks-message .button:hover {
    background: #b8f0c4;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    body {
        padding: 0px;
    }
    
    .ege-bank-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bank-sidebar {
        order: 2;
    }
    
    .bank-main-content {
        order: 1;
    }
    
    .page-title {
        font-size: 1.5em;
    }
    
    .answer-input-group {
        flex-direction: column;
    }
    
    .answer-input,
    .answer-unit,
    .check-answer-btn {
        width: 100%;
        border-radius: 15px !important;
    }
    
    .answer-unit {
        order: 2;
        text-align: center;
        margin-top: 5px;
    }
    
    .task-numbers-list {
        justify-content: center;
    }
    
    .task-card-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .show-answer-btn {
        width: 100%;
        padding: 12px;
    }
    
    .filter-actions {
        width: 100%;
    }
    
    .filter-btn, .reset-filters-btn {
        flex: 1;
    }
    
    .task-number {
        padding: 8px 14px;
        font-size: 0.9em;
        min-width: 26px;
    }
    
    .go-to-variants-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

/* ===== УТИЛИТЫ ===== */
.filter-message {
    background: #e3f2fd;
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-filter {
    background: #CFFFD6;
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'TT Norms Pro', Arial, sans-serif;
}

.clear-filter:hover {
    background: #b8f0c4;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #000000;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Стили для математических формул */
.task-full-text mjx-container {
    display: inline-block;
    margin: 0 2px;
}

/* Стили для ссылок в контенте */
.task-full-text a {
    color: #1a73e8;
    text-decoration: none;
}

.task-full-text a:hover {
    text-decoration: underline;
}

/* Стили для контента внутри ответов */
.correct-answer p,
.answer-explanation p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.correct-answer p:last-child,
.answer-explanation p:last-child {
    margin-bottom: 0;
}

/* Дополнительные стили для лучшего отображения контента */
.task-full-text img,
.correct-answer img,
.answer-explanation img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.task-full-text table,
.correct-answer table,
.answer-explanation table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.task-full-text table th,
.task-full-text table td,
.correct-answer table th,
.correct-answer table td,
.answer-explanation table th,
.answer-explanation table td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
}

.task-full-text table th,
.correct-answer table th,
.answer-explanation table th {
    background: #f8f9fa;
    font-weight: 500;
}
/* Добавляем в конец файла style.css */

/* Стили для ответов второй части */
.second-part-answer {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.second-part-answer strong {
    color: #28a745;
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.answer-explanation strong {
    color: #17a2b8;
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

/* Стили для лучшего отображения контента во второй части */
.full-answer-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.full-answer-content p:last-child {
    margin-bottom: 0;
}

.full-answer-content ul,
.full-answer-content ol {
    margin: 10px 0 10px 25px;
    padding-left: 20px;
    line-height: 1.5;
}

.full-answer-content li {
    margin-bottom: 6px;
}

.full-answer-content ul {
    list-style-type: disc;
}

.full-answer-content ol {
    list-style-type: decimal;
}
/* Добавляем в конец style.css */
.task-meta {
    margin: 8px 0;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.task-meta strong {
    color: #2c3e50;
    margin-right: 5px;
    font-weight: 600;
}

.task-meta ul,
.task-meta ol {
    margin: 5px 0 5px 15px;
    padding-left: 15px;
}

.task-meta li {
    margin-bottom: 3px;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
    body {
        padding: 0px;  /* Умеренные отступы от краев */
    }
    
    /* Перестраиваем layout - меню сверху */
    .ege-bank-layout {
        display: flex;
        flex-direction: column;
    }
    
    .bank-sidebar {
        order: 1;
        margin-bottom: 10px;
        padding: 12px;  /* Уменьшаем внутренние отступы */
    }
    
    .bank-main-content {
        order: 2;
    }
    
    /* Уменьшаем отступы в карточках заданий */
    .task-card {
        padding: 15px;  /* Умеренно, но меньше чем было */
        margin-bottom: 12px;
    }
    
    /* Заголовок задания */
    .task-title {
        font-size: 1.1em;  /* Уменьшаем */
        margin-bottom: 8px;
    }
    
    /* Текст задания */
    .task-full-text {
        font-size: 0.95em;  /* Немного меньше */
        line-height: 1.4;
    }
    
    .task-full-text p {
        margin-bottom: 8px;
    }
    
    /* ===== ОГРАНИЧЕНИЕ ДЛИНЫ КОНТЕНТА ===== */
    .task-full-text {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: break-word;
    }
    
    .task-full-text img {
        max-width: 100%;
        height: auto;
    }
    
    /* Таблицы */
    .task-table {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 8px 0;
    }
    
    .task-table table {
        min-width: 400px;  /* Уменьшаем минимальную ширину */
        font-size: 11px;   /* Еще меньше шрифт */
    }
    
    .task-table th,
    .task-table td {
        padding: 4px 6px;  /* Сильно уменьшаем отступы */
        white-space: nowrap;
    }
    
    /* Блоки ответов - делаем компактнее */
    .task-answer-section {
        padding: 12px;
        margin: 12px 0;
    }
    
    .task-answer-section h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .answer-input-group {
        flex-direction: column;
        gap: 5px;
    }
    
    .answer-input {
        padding: 10px;  /* Уменьшаем */
        font-size: 0.95em;
    }
    
    .answer-unit {
        padding: 10px;
        font-size: 0.95em;
    }
    
    .check-answer-btn,
    .show-answer-btn {
        padding: 12px;  /* Уменьшаем */
        font-size: 0.95em;
        width: 100%;
        border-radius: 10px !important;
    }
    
    /* Спойлеры */
    .spoiler-toggle,
    .explanation-toggle {
        padding: 10px 12px;
        font-size: 0.95em;
    }
    
    .spoiler-content,
    .explanation-content {
        padding: 12px;
        font-size: 0.95em;
    }
    
    /* Мета информация */
    .task-meta {
        padding: 8px 10px;
        font-size: 0.9em;
        margin: 5px 0;
    }
    
    /* Футер карточки */
    .task-card-footer {
        flex-direction: row;  /* Возвращаем в строку */
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .task-id {
        font-size: 0.75em;
    }
    
    .solve-btn {
        width: auto;  /* Не на всю ширину */
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    /* Контейнер для номеров КИМ */
    .task-numbers-list {
        justify-content: flex-start;  /* Не центрируем */
        gap: 5px;
    }
    
    /* Кнопки номеров уже уменьшены отдельным блоком */
    
    /* Разделы */
    .section-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .section-link {
        font-size: 0.95em;
    }
    
    .section-count {
        padding: 3px 8px;
        font-size: 0.75em;
    }
    
    /* Выбор темы */
    .theme-selector select {
        padding: 8px 10px;
        font-size: 0.95em;
    }
    
    /* Кнопки фильтров */
    .filter-btn, .reset-filters-btn {
        padding: 10px;
        font-size: 0.95em;
        margin-bottom: 8px;
    }
}

/* Хедер сайта */
.site-header {
    background: white;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: block;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
}

.main-navigation {
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.2s;
    padding: 8px 0;
    display: inline-block;
}

.nav-link:hover {
    color: #CFFFD6;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .header-container {
        padding: 12px 15px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 15px;
    }
    
    .nav-link {
        font-size: 14px;
    }
}

/* ===== ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ ===== */
@media (max-width: 480px) {
    body {
        padding: 0px;
    }
    
    .bank-sidebar {
        padding: 10px;
    }
    
    .task-card {
        padding: 10px;
    }
    
    .task-title {
        font-size: 1em;
    }
    
    .task-full-text {
        font-size: 0.9em;
    }
    
    .task-answer-section {
        padding: 8px;
    }
    
    .answer-input {
        padding: 8px;
    }
    
    .check-answer-btn,
    .show-answer-btn {
        padding: 10px;
    }
    
    .task-meta {
        padding: 6px 8px;
        font-size: 0.85em;
    }
    
    .task-card-footer {
        flex-direction: column;  /* На очень маленьких экранах - в колонку */
        gap: 8px;
    }
    
    .solve-btn {
        width: 100%;
        text-align: center;
    }
    
    .sidebar-section {
        margin-bottom: 12px;
    }
    
    .sidebar-title {
        font-size: 1em;
        margin-bottom: 8px;
    }

    /* ===== ФУТЕР ===== */
    .site-footer {
        background: white;
        border-top: 1px solid #e8e8e8;
        padding: 30px 0 20px 0;
        margin-top: 40px;
        width: 100%;
    }
    
    .footer-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
        text-align: center !important;
    }
    
    .footer-bottom {
        display: flex;
        justify-content: center !important;
        align-items: center;
        gap: 30px;
        font-size: 14px;
        flex-wrap: wrap;
        text-align: center !important;
    }
    
    .footer-copy {
        color: #999;
        font-weight: 400;
    }
    
    .footer-policy {
        color: #999;
        text-decoration: none;
        font-weight: 400;
        transition: color 0.2s;
    }
    
    .footer-policy:hover {
        color: #2c3e50;
    }
    
    /* Адаптивность */
    @media (max-width: 768px) {
        .footer-container {
            padding: 0 15px;
        }
        
        .footer-bottom {
            font-size: 12px;
            gap: 15px;
            flex-direction: column;
            text-align: center;
        }
}
/* =====================================================
   BANK TASK CARD
   Отдельный компонент только банка заданий
   ===================================================== */

@media (max-width: 768px) {

    /*
     * Карточка.
     * Основной ритм строим на шаге ~12–16 px,
     * а не на случайных разных значениях.
     */
    .ege-bank-task-card {
        padding: 20px !important;
        margin-bottom: 18px !important;

        border-radius: 16px !important;
    }


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

    .ege-bank-task-card .task-header {
        margin-bottom: 16px !important;
    }

    .ege-bank-task-card .task-title {
        margin: 0 !important;

        font-size: 20px !important;
        line-height: 1.3 !important;
        font-weight: 500 !important;

        color: #2c3e50 !important;
    }


    /* ================================================
       ТЕКСТ ЗАДАНИЯ
       ================================================ */

    .ege-bank-task-card .task-card-content {
        margin-bottom: 18px !important;
    }

    .ege-bank-task-card .task-full-text {
        font-size: 16px !important;
        line-height: 1.6 !important;

        color: #2c3e50 !important;
    }

    .ege-bank-task-card .task-full-text p {
        margin-top: 0 !important;
        margin-bottom: 12px !important;
    }

    .ege-bank-task-card .task-full-text p:last-child {
        margin-bottom: 0 !important;
    }


    /* ================================================
       БЛОК ОТВЕТА
       Компактнее, чем мы делали раньше.
       ================================================ */

    .ege-bank-task-card .task-answer-section {
        margin: 16px 0 !important;

        padding: 14px !important;

        border-radius: 15px !important;

        background: #f8f9fa;
    }

    .ege-bank-task-card .task-answer-section h4 {
        margin: 0 0 10px !important;

        font-size: 15px !important;
        line-height: 1.35 !important;
        font-weight: 500 !important;

        color: #2c3e50 !important;
    }


    /*
     * Поле и кнопка оставляем одной системой размеров.
     */
    .ege-bank-task-card .answer-input-group {
        display: flex !important;

        flex-direction: column !important;

        gap: 8px !important;
    }

    .ege-bank-task-card .answer-input {
        width: 100% !important;
        min-height: 44px !important;

        padding: 10px 12px !important;

        box-sizing: border-box !important;

        font-size: 15px !important;

        border-radius: 12px !important;
    }

    .ege-bank-task-card .check-answer-btn {
        width: 100% !important;
        min-height: 44px !important;

        padding: 10px 14px !important;

        box-sizing: border-box !important;

        font-size: 15px !important;
        font-weight: 500 !important;

        border-radius: 12px !important;
    }


    /* ================================================
       СПРАВОЧНЫЕ МАТЕРИАЛЫ / ПОЯСНЕНИЕ

       ВНУТРЕННЕЕ СОДЕРЖИМОЕ НЕ ТРОГАЕМ.
       Только внешние кнопки.
       ================================================ */

    .ege-bank-task-card .task-help-section {
        margin: 16px 0 !important;
    }

    .ege-bank-task-card .task-spoiler,
    .ege-bank-task-card .task-explanation {
        margin: 10px 0 0 !important;
    }

    .ege-bank-task-card .spoiler-toggle,
    .ege-bank-task-card .explanation-toggle {
        width: 100% !important;

        padding: 13px 16px !important;

        box-sizing: border-box !important;

        text-align: left !important;

        font-size: 15px !important;
        line-height: 1.4 !important;
        font-weight: 500 !important;

        border-radius: 14px !important;
    }


    /* ================================================
       ТЕМА
       Не делаем её мелкой подписью.
       ================================================ */

    .ege-bank-task-card .task-meta {
        margin-top: 18px !important;

        padding: 12px 14px !important;

        font-size: 15px !important;
        line-height: 1.5 !important;

        border-radius: 12px !important;
    }

    .ege-bank-task-card .task-meta strong {
        font-size: inherit !important;
        font-weight: 600 !important;
    }


    /* ================================================
       ФУТЕР
       ================================================ */

    .ege-bank-task-card .task-card-footer {
        margin-top: 16px !important;
        padding-top: 14px !important;
    }

    .ege-bank-task-card .task-id {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .ege-bank-task-card .solve-btn {
        font-size: 14px !important;
    }

}


/*
 * На маленьком телефоне НЕ уменьшаем
 * отдельные элементы несогласованно.
 */
@media (max-width: 480px) {

    .ege-bank-task-card {
        padding: 20px !important;
    }

    .ege-bank-task-card .task-title {
        font-size: 20px !important;
    }

    .ege-bank-task-card .task-full-text {
        font-size: 16px !important;
    }

}

/* Magellan editorial lists v3: tight line wrapping and bullet rhythm. */
:is(.tb-prose, .mag-article-content, .entry-content, .task-full-text,
 .correct-answer, .answer-explanation, .spoiler-content,
 .explanation-content, .full-answer-content) :is(ul, ol) {
  margin: 0.5em 0 0.85em !important;
  padding-inline-start: 1.25em !important;
  line-height: 1.42 !important;
}
:is(.tb-prose, .mag-article-content, .entry-content, .task-full-text,
 .correct-answer, .answer-explanation, .spoiler-content,
 .explanation-content, .full-answer-content) :is(ul, ol) > li {
  margin: 0 0 0.28em !important;
  padding-inline-start: 0.12em !important;
  line-height: 1.42 !important;
}
:is(.tb-prose, .mag-article-content, .entry-content, .task-full-text,
 .correct-answer, .answer-explanation, .spoiler-content,
 .explanation-content, .full-answer-content) :is(ul, ol) > li:last-child { margin-bottom: 0 !important; }
:is(.tb-prose, .mag-article-content, .entry-content, .task-full-text,
 .correct-answer, .answer-explanation, .spoiler-content,
 .explanation-content, .full-answer-content) :is(ul, ol) > li > p {
  margin: 0 0 0.25em !important;
  line-height: inherit !important;
}

/* Editorial list alignment v4: markers remain INSIDE the text column. */
:is(.tb-prose, .mag-article-content, .entry-content, .task-full-text,
 .correct-answer, .answer-explanation, .spoiler-content,
 .explanation-content, .full-answer-content) :is(ul, ol) {
  margin-inline-start: 0 !important;
  margin-inline-end: 0 !important;
  padding-inline-start: 1.65em !important;
  list-style-position: outside !important;
}
:is(.tb-prose, .mag-article-content, .entry-content, .task-full-text,
 .correct-answer, .answer-explanation, .spoiler-content,
 .explanation-content, .full-answer-content) :is(ul, ol) > li {
  margin-inline-start: 0 !important;
  padding-inline-start: 0 !important;
}
