* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* Тёмная тема */
body.dark-theme {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .sidebar li.active {
    background-color: #333;
}

body.dark-theme .warning {
    background-color: #664d03;
    border-color: #997404;
}

body.dark-theme .info {
    background-color: #0c5460;
    border-color: #117a8b;
}

body.dark-theme .pricing-table th {
    background-color: #333;
}

body.dark-theme .pricing-table th,
body.dark-theme .pricing-table td {
    border-color: #444;
}

body.dark-theme header,
body.dark-theme .footer-links {
    border-color: #444;
}

body.dark-theme .sidebar {
    background-color: #1a1a1a;
}

body.dark-theme .menu-toggle {
    color: #e0e0e0;
}

body.dark-theme .sidebar li {
    border-bottom: 1px solid #444;
}

body.dark-theme .accordion-header {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-theme .accordion-content {
    background-color: #2a2a2a;
    border-color: #444;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    position: relative;
    background-color: #f5f5f5;
    transition: background-color 0.3s;
}

body.dark-theme header {
    background-color: #1a1a1a;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px; /* Высота логотипа */
    width: auto; /* Ширина подстраивается автоматически, чтобы сохранить пропорции */
}

/* Кнопка гамбургер-меню */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Переключатель темы */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle span {
    flex: 1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #007bff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Обёртка для контента */
.content-wrapper {
    display: flex;
    flex-direction: row;
    margin-top: 20px;
    gap: 20px;
}

/* Боковое меню слева */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    transition: transform 0.3s ease;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    padding: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.sidebar li span {
    margin-right: 10px;
}

.sidebar li.active {
    background-color: #e0e0e0;
    border-radius: 5px;
}

body.dark-theme .sidebar li.active {
    background-color: #333;
}

/* Стили для переключателя темы в меню */
.sidebar .theme-toggle {
    padding: 15px;
    border-top: 1px solid #ddd;
    margin-top: 10px;
}

body.dark-theme .sidebar .theme-toggle {
    border-top: 1px solid #444;
}

/* Прокручиваемый контент */
.main-content {
    flex: 1;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    gap: 20px;
}

/* Основной текст */
main {
    flex: 1;
    margin-right: 0;
}

/* Боковая панель справа (Содержание) */
.toc-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.toc-sidebar h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.toc-sidebar ul.toc {
    list-style: none;
    margin-left: 0;
}

.toc-sidebar ul.toc li {
    margin-bottom: 5px;
}

h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

h2 {
    font-size: 20px;
    margin: 20px 0 10px;
}

ul {
    list-style: disc;
    margin-left: 20px;
}

ul.toc {
    list-style: none;
    margin-left: 0;
}

ul.toc li {
    margin-bottom: 5px;
}

ul li {
    margin-bottom: 10px;
}

p {
    line-height: 1.6;
    margin-bottom: 20px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Блоки предупреждений и информации */
.warning, .info {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    margin: 5px 0;
    border-radius: 5px;
}

.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

.warning i, .info i {
    margin-right: 8px;
    font-size: 14px;
    line-height: 1;
}

.info p {
    font-size: 14px;
    line-height: 1;
    margin: 0;
}

/* Аккордеон */
.accordion {
    margin: 10px 0;
}

.accordion-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.accordion-header {
    background-color: #f9f9f9;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 16px;
    transition: background-color 0.3s;
}

.accordion-header:hover {
    background-color: #f0f0f0;
}

.accordion-header i {
    transition: transform 0.3s;
}

.accordion-header.active i {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.accordion-content.active {
    display: block;
}

/* Таблица тарифов */
.pricing-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin: 20px 0;
}

.pricing-table th,
.pricing-table td {
    border: 1px solid #ddd;
    padding: 15px 30px;
    text-align: left;
    font-size: 16px;
}

.pricing-table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

body.dark-theme .pricing-table th {
    background-color: #333;
}

body.dark-theme .pricing-table th,
body.dark-theme .pricing-table td {
    border-color: #444;
}

/* Футер */
footer {
    margin-top: 20px;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid #ddd;
}

.footer-links a {
    margin: 0;
}

.footer-copyright {
    padding: 10px 0;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #666;
}

.copyright-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yandex-metrika {
    display: inline-block;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-wrap: wrap;
    }

    .main-content {
        flex-direction: column;
        max-height: none;
    }

    .toc-sidebar {
        width: 100%;
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    /* Фиксируем шапку */
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 10px 20px;
    }

    /* Добавляем отступ сверху для контента */
    .container {
        padding-top: 60px;
    }

    /* Скрываем переключатель темы в шапке */
    .theme-toggle.desktop-only {
        display: none !important;
    }

    /* Показываем переключатель темы в меню */
    .theme-toggle.mobile-only {
        display: flex !important;
    }

    /* Скрываем боковое меню и показываем кнопку гамбургер-меню */
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #f5f5f5;
        transform: translateX(-100%);
        z-index: 1001;
        padding: 60px 20px 20px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar ul {
        display: block;
    }

    .sidebar li {
        flex: none;
        text-align: left;
        padding: 15px;
        border-bottom: 1px solid #ddd;
    }

    /* Скрываем правое меню "Содержание" */
    .toc-sidebar {
        display: none;
    }

    .pricing-table th,
    .pricing-table td {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }

    .footer-links {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .pricing-table th,
    .pricing-table td {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Скрываем переключатель темы в меню на десктопе */
@media (min-width: 769px) {
    .theme-toggle.mobile-only {
        display: none !important;
    }
}