/* ========================= */
/* БАЗА */
/* ========================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* Контейнер */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================= */
/* ШАПКА */
/* ========================= */

.page-header {
    padding: 20px;
    margin-bottom: 20px;
}

/* КНОПКА НАЗАД */
.back-link {
    display: inline-block;
    margin-bottom: 10px;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.back-link:hover {
    background: rgba(26, 115, 232, 0.1);
}

/* ЗАГОЛОВОК + КНОПКИ */
.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.header-flex h1 {
    margin: 0;
}

/* 🔥 ОБЁРТКА КНОПОК */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ========================= */
/* КНОПКА ТЕМЫ */
/* ========================= */

.theme-btn {
    border: none;
    background: #1a73e8;
    color: white;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;

    box-shadow: 0 4px 0 #0c47a1;
    transition: all 0.15s ease;

    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0c47a1;
}

/* ========================= */
/* ♿ КНОПКА ДОСТУПНОСТИ */
/* ========================= */

.access-btn {
    border: none;
    background: #ffb300;
    color: #111;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;

    box-shadow: 0 4px 0 #b37400;
    transition: all 0.15s ease;

    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-btn:hover {
    background: #ffc233;
}

.access-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b37400;
}

body.accessibility .access-btn {
    background: #34a853;
    box-shadow: 0 4px 0 #1e7e34;
    color: #fff;
}

/* ========================= */
/* ТЕРМИНАЛ */
/* ========================= */

.terminal-window {
    background: #2d2d2d;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.terminal-header {
    background: #444;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.terminal-title {
    color: #bbb;
    font-size: 0.8rem;
    margin-left: 8px;
    flex: 1;
}

.copy-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;

    box-shadow: 0 4px 0 #0c47a1;
    transition: all 0.15s ease;
}

.copy-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0c47a1;
}

.copy-btn.copied {
    background: #34a853;
    box-shadow: 0 4px 0 #1e7e34;
}

.terminal-body {
    padding: 15px;
}

.code-wrapper {
    overflow-x: auto;
}

.code-wrapper code {
    display: inline-block;
    color: #50fa7b;
    font-family: monospace;
    font-size: 1rem;
    white-space: nowrap;
}

/* ========================= */
/* ТЕМЫ */
/* ========================= */

body.dark {
    background-color: #1e1e1e;
    color: #eaeaea;
}

body.light {
    background-color: #f4f6f8;
    color: #202124;
}

body.dark .page-header {
    background: #2a2a2a;
    border-bottom: 1px solid #444;
}

body.light .page-header {
    background: #ffffff;
    border-bottom: 1px solid #dcdcdc;
}

body.dark .back-link {
    color: #8ab4f8;
}

body.light .back-link {
    color: #1a73e8;
}

/* ========================= */
/* ♿ ACCESSIBILITY (ИСПРАВЛЕНО) */
/* ========================= */

body.accessibility {
    font-size: 20px;
    line-height: 1.8;
}

/* НЕ ЛОМАЕМ ТЕМУ */
body.accessibility.dark {
    background: #000;
    color: #fff;
}

body.accessibility.light {
    background: #f4f6f8;
    color: #000;
}

body.accessibility h1,
body.accessibility h2,
body.accessibility p {
    color: inherit;
}

/* ========================= */
/* ЛОГО */
/* ========================= */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.site-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

/* ========================= */
/* АДАПТИВ */
/* ========================= */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .terminal-header {
        flex-wrap: wrap;
    }

    .terminal-title {
        width: 100%;
        margin: 5px 0;
    }

    .copy-btn {
        width: 100%;
    }

    .header-buttons {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 15px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .header-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}


/* ===== МОБИЛЬНОЕ УЛУЧШЕНИЕ ===== */

@media (max-width: 768px) {

    .header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-buttons {
        width: 100%;
        justify-content: flex-end;
    }

    .theme-btn,
    .access-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .terminal-window {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {

    .container {
        padding: 12px;
    }

    .terminal-window {
        border-radius: 8px;
    }

    .code-wrapper code {
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.2rem;
    }
}