/* ============================================================
   VPN Bot — Style v2.1 (Deeper Indigo + Warm Gray)
   Тёмная тема: v2.1 «Deeper Indigo + muted glow»
   Светлая тема: D «Cool Gray»
   Дата: 14.09.2026
   ============================================================ */

/* ============ СВЕТЛАЯ ТЕМА (по умолчанию) ============ */
:root {
    /* Фоны */
    --bg: #f5f7fa;
    --bg-alt: #eef1f6;
    --card: #ffffff;

    /* Границы */
    --border: #e1e5ee;
    --border-hover: #c7cde0;

    /* Текст */
    --text: #131735;
    --text-dim: #6b7292;
    --text-muted: #959bb5;

    /* Акценты */
    --accent: #4f46e5;
    --accent-2: #3b82f6;
    --accent-glow: rgba(79,70,229,0.22);
    --accent-active-glow: rgba(79,70,229,0.12);
    --accent-active-bg: #e9ebf9;
    --accent-soft: rgba(79,70,229,0.1);
    --accent-soft-border: rgba(79,70,229,0.2);

    /* Специальные */
    --tg-bar-bg: #e9ecf4;
    --code-bg: #eef1f6;
    --code-color: #c2410c;
    --quote-bg: #f5f7fa;
    --quote-border: #4f46e5;
    --success: #16a34a;
    --danger: #dc2626;

    /* Тени */
    --shadow-sm: 0 1px 3px rgba(19,23,53,0.04);
    --shadow-md: 0 4px 14px rgba(19,23,53,0.06);
    --shadow-lg: 0 20px 40px -12px rgba(79,70,229,0.2);

    /* Радиусы */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
}

/* ============ ТЁМНАЯ ТЕМА ============ */
body.dark {
    --bg: #030310;
    --bg-alt: #0a0b1f;
    --card: #0d0e28;

    --border: #1a1c3f;
    --border-hover: #2a2d5c;

    --text: #d8d8ff;
    --text-dim: #8585b8;
    --text-muted: #5a5a85;

    --accent: #4f46e5;
    --accent-2: #3b82f6;
    --accent-glow: rgba(79,70,229,0.55);
    --accent-active-glow: rgba(79,70,229,0.18);
    --accent-active-bg: #050514;
    --accent-soft: rgba(79,70,229,0.2);
    --accent-soft-border: rgba(79,70,229,0.45);

    --tg-bar-bg: #05051a;
    --code-bg: #171728;
    --code-color: #f0abfc;
    --quote-bg: #0f1030;
    --quote-border: #4f46e5;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 50px -12px rgba(79,70,229,0.55);
}

/* ============ БАЗА ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background .3s ease, color .3s ease;
    background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(79,70,229,0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(59,130,246,0.04) 0%, transparent 55%);
    background-attachment: fixed;
    min-height: 100vh;
}
body.dark {
    background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(79,70,229,0.14) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(59,130,246,0.07) 0%, transparent 55%);
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ============ HEADER ============ */
header {
    background: rgba(245,247,250,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    position: sticky; top: 0; z-index: 100;
    transition: background .3s ease, border-color .3s ease;
}
body.dark header { background: rgba(3,3,16,0.85); }
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo {
    font-size: 20px; font-weight: 800; color: var(--text); text-decoration: none;
    letter-spacing: -0.3px;
    display: flex; align-items: center; gap: 10px;
}
.logo-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; font-weight: 800;
    box-shadow: 0 4px 14px var(--accent-glow);
}
nav { display: flex; align-items: center; gap: 4px; }
nav a {
    color: var(--text-dim); text-decoration: none; margin-left: 20px;
    font-size: 14px; font-weight: 500;
    transition: color .15s;
}
nav a:hover { color: var(--text); }

.theme-toggle {
    background: var(--card); border: 1px solid var(--border); color: var(--text);
    padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 15px;
    margin-left: 16px;
    transition: all .15s ease;
    box-shadow: var(--shadow-sm);
}
.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}
.theme-toggle:active {
    transform: translateY(1px) scale(0.97);
    background: var(--accent-active-bg);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

/* ============ TELEGRAM BAR ============ */
.tg-bar {
    background: var(--tg-bar-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    text-align: center;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    transition: background .3s ease;
}
.tg-bar::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-2) 70%, transparent);
    opacity: 0.5;
}
body.dark .tg-bar::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-2) 70%, transparent);
    opacity: 0.4;
}
.tg-bar a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .2s ease;
    padding: 4px 12px;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}
.tg-bar a .rocket { display: inline-block; transition: transform .2s ease; }
.tg-bar a .tg-handle {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.2px;
}
body.dark .tg-bar a .tg-handle {
    color: var(--accent-2);
    text-shadow: 0 0 12px rgba(59,130,246,0.5);
}
.tg-bar a:hover { background: rgba(79,70,229,0.08); }
.tg-bar a:hover .rocket { transform: translateY(-2px) rotate(-10deg); }
.tg-bar a:active {
    background: var(--accent-active-bg);
    transform: scale(0.98);
    box-shadow: inset 0 2px 6px rgba(79,70,229,0.15);
}

/* ============ КАТЕГОРИИ ============ */
.categories { padding: 28px 0; margin-bottom: 40px; }
.categories ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.categories a {
    color: var(--text-dim); text-decoration: none; padding: 8px 16px;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    background: var(--card); border: 1px solid var(--border);
    transition: all .15s ease;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}
.categories a:hover {
    color: var(--accent); border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}
.categories a:active {
    transform: translateY(1px) scale(0.97);
    background: var(--accent-active-bg);
    border-color: var(--accent);
    box-shadow: inset 0 2px 4px rgba(79,70,229,0.15);
}
.categories a.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.categories a.active:active {
    transform: translateY(1px) scale(0.97);
    background: linear-gradient(135deg, #3f37c9 0%, #2f6fd9 100%);
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.15);
}

/* ============ СЕТКА НОВОСТЕЙ ============ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}
.news-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .3s ease;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79,70,229,0.25);
}
.news-card:active {
    transform: translateY(-1px) scale(0.99);
    box-shadow: inset 0 2px 6px rgba(79,70,229,0.1);
}
.news-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: var(--bg-alt);
}
.news-card-body { padding: 24px; }
.news-card .category-tag {
    display: inline-block;
    font-size: 11px;
    padding: 4px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent-soft-border);
    border-radius: 6px;
    margin-bottom: 12px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
body.dark .news-card .category-tag { color: #a5b4fc; }
.news-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--text);
}
.news-card h3 a { color: var(--text); }
.news-card h3 a:hover { color: var(--accent); }
.news-card .meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.news-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.55;
}

/* ============ СТРАНИЦА НОВОСТИ ============ */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
    align-items: center;
}
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

.article {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 44px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
    transition: background .3s ease, border-color .3s ease;
}
.article h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text);
}
.article .meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-dim);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.article img.main-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin: 24px 0;
}

/* ============ КОНТЕНТ СТАТЬИ ============ */
.article .content {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
    padding-top: 24px;
    word-wrap: break-word;
}
body.dark .article .content { color: #c8c8e8; }
.article .content p { margin-bottom: 20px; }
.article .content h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 36px 0 16px;
    color: var(--text);
}
.article .content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text);
}
.article .content h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 22px 0 10px;
    color: var(--text);
}
.article .content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}
body.dark .article .content a { color: #93b4fd; }
.article .content a:hover { color: var(--accent-2); }
.article .content ul,
.article .content ol { margin: 0 0 20px 24px; }
.article .content li { margin-bottom: 8px; }
.article .content strong { font-weight: 700; color: var(--text); }
.article .content code {
    background: var(--code-bg);
    color: var(--code-color);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: 500;
}
.article .content blockquote {
    border-left: 3px solid var(--quote-border);
    background: var(--quote-bg);
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--text-dim);
}
.article .content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    display: block;
}
.article .content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}
.article .content table {
    border-collapse: collapse;
    width: 100%;
    margin: 20px 0;
    font-size: 15px;
}
.article .content table th,
.article .content table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}
.article .content table th {
    background: var(--bg-alt);
    font-weight: 600;
}

/* ============ ТЕГИ ============ */
.tags-block {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tags-block .tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-alt);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
}
.tags-block .tag:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(79,70,229,0.08);
}
.tags-block .tag:active {
    transform: scale(0.96);
    background: var(--accent-active-bg);
    box-shadow: inset 0 2px 4px rgba(79,70,229,0.15);
}

/* ============ СОЦСЕТИ ============ */
.share-block {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-dim);
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}
.share-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.share-btn:active {
    transform: translateY(1px) scale(0.97);
    background: var(--accent-active-bg);
    box-shadow: inset 0 2px 4px rgba(79,70,229,0.15);
}

/* ============ BACK LINK ============ */
.back-link { margin-top: 30px; }

/* ============ ПОХОЖИЕ ============ */
.related-block { margin-top: 40px; }
.related-block h2 {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ============ КОММЕНТАРИИ ============ */
.comments-block {
    margin-top: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}
.comments-block h2 {
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 700;
}
.comments-list { margin-bottom: 30px; }
.comment {
    padding: 15px 18px;
    background: var(--bg-alt);
    border-radius: 10px;
    margin-bottom: 15px;
}
.comment-reply {
    margin-left: 30px;
    margin-top: 10px;
    background: var(--card);
    border-left: 3px solid var(--accent);
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    gap: 10px;
}
.comment-author { font-weight: 600; color: var(--text); }
.comment-date { color: var(--text-dim); font-size: 12px; }
.comment-body {
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
    word-wrap: break-word;
}
body.dark .comment-body { color: #c8c8e8; }
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 5px;
    font-family: inherit;
}
.comment-reply-btn:hover { text-decoration: underline; }
.comment-replies { margin-top: 15px; }
.no-comments, .comments-loading {
    text-align: center;
    color: var(--text-dim);
    padding: 30px 0;
}

.comment-form-wrapper {
    border-top: 1px solid var(--border);
    padding-top: 25px;
}
.comment-form-wrapper h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 700;
}
.comment-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.comment-form input[type=text],
.comment-form input[type=email],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
    background: var(--card);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-active-glow);
}

/* ============ КНОПКИ ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
    color: #fff;
}
.btn:active {
    transform: translateY(1px) scale(0.97);
    background: linear-gradient(135deg, #3f37c9 0%, #2f6fd9 100%);
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.15);
}
.btn-secondary {
    background: var(--bg-alt);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--bg-alt);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-danger { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Активная навигация (десктоп) */
nav a.active {
    color: var(--accent);
}
nav a.active::after {
    /* опционально: подчёркивание */
    /* content: ''; */
    /* display: block; */
    /* height: 2px; */
    /* background: var(--accent); */
    /* border-radius: 2px; */
    /* margin-top: 4px; */
}

/* Активная навигация на мобильных — индиго-подсветка */
@media (max-width: 768px) {
    nav a.active {
        color: var(--accent);
    }
    .nav-categories.active .nav-categories-icon,
    .nav-search.active::before {
        filter: drop-shadow(0 0 6px var(--accent-glow));
    }
}

/* ============ СТАТУС СЕРВЕРОВ ============ */
.servers-block {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}
.servers-block h3 {
    margin-bottom: 15px;
    font-weight: 700;
}
.server-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.server-row:last-child { border-bottom: none; }
.server-online { color: var(--success); font-weight: 600; }
.server-offline { color: var(--danger); font-weight: 600; }

/* ============ ПАГИНАЦИЯ ============ */
.pagination {
    text-align: center;
    margin: 30px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
}
.pagination a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.pagination a.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* ============ FOOTER ============ */
footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    transition: border-color .3s ease;
}

/* ============ ПУСТО ============ */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

/* ============ ФОРМА ПОИСКА ============ */
.search-form {
    margin-bottom: 30px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.search-form input[type=text] {
    flex: 1;
    min-width: 200px;
    padding: 12px 18px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.search-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-active-glow);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }

    /* Header */
    header { padding: 14px 0; }
    header .container {
        flex-direction: row;
        gap: 8px;
    }
    .logo { font-size: 17px; gap: 8px; }
    .logo-mark { width: 28px; height: 28px; font-size: 14px; }
    nav { gap: 0; }
    nav a {
        margin-left: 12px;
        font-size: 13px;
        padding: 4px 6px;
    }
    /* Скрываем все ссылки навигации кроме главной, категорий, поиска */
    nav a:not(.nav-home):not(.nav-categories):not(.nav-search) { display: none; }
    /* На мобильных — только иконка категорий */
    .nav-categories .nav-categories-text { display: none; }
    .nav-categories .nav-categories-icon {
        display: inline-block;
        font-size: 18px;
    }
    .nav-categories {
        padding: 6px 10px !important;
        font-size: 18px;
        line-height: 1;
    }
    .nav-search {
        font-size: 18px;
        padding: 6px 10px !important;
    }
    /* Скрываем текст "Поиск", оставляем только иконку */
    .nav-search {
        font-size: 0;
    }
    .nav-search::before {
        content: '🔍';
        font-size: 18px;
    }
	
	@media (max-width: 768px) {
    .nav-categories.active,
    .nav-search.active {
        color: var(--accent);
    }
    .nav-categories.active::before,
    .nav-search.active::before {
        /* ничего */
    }
}
	
    .theme-toggle {
        margin-left: 8px;
        padding: 6px 10px;
        font-size: 14px;
    }

    /* TG bar */
    .tg-bar { padding: 10px 0; font-size: 13px; }
    .tg-bar a { padding: 4px 8px; gap: 6px; }
    .tg-bar a .rocket { font-size: 14px; }

    /* Категории — горизонтальный скролл */
    .categories {
        padding: 14px 0;
        margin-bottom: 20px;
        overflow: hidden;
    }
    .categories ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
        padding-bottom: 6px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .categories ul::-webkit-scrollbar { height: 3px; }
    .categories ul::-webkit-scrollbar-track { background: transparent; }
    .categories ul::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }
    .categories a {
        white-space: nowrap;
        padding: 6px 14px;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Сетка новостей — одна колонка */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 40px;
    }
    .news-card img { height: 200px; }
    .news-card-body { padding: 20px; }
    .news-card h3 { font-size: 17px; }
    .news-card p { font-size: 14px; }

    /* Статья */
    .article {
        padding: 24px 20px;
        border-radius: var(--radius);
        margin-bottom: 24px;
    }
    .article h1 {
        font-size: 24px;
        letter-spacing: -0.5px;
        line-height: 1.25;
    }
    .article .meta {
        font-size: 12px;
        gap: 10px;
        padding-bottom: 16px;
    }
    .article img.main-image {
        max-height: 240px;
        border-radius: 10px;
        margin: 20px 0;
    }
    .article .content {
        font-size: 16px;
        line-height: 1.7;
        padding-top: 18px;
    }
    .article .content p { margin-bottom: 16px; }
    .article .content h2 {
        font-size: 21px;
        margin: 28px 0 12px;
    }
    .article .content h3 {
        font-size: 18px;
        margin: 22px 0 10px;
    }
    .article .content h4 { font-size: 16px; }
    .article .content ul,
    .article .content ol { margin-left: 20px; }
    .article .content blockquote {
        padding: 12px 16px;
        margin: 20px 0;
    }
    .article .content table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .article .content table th,
    .article .content table td {
        padding: 8px 10px;
    }

    /* Хлебные крошки */
    .breadcrumbs {
        font-size: 12px;
        margin-bottom: 16px;
        gap: 4px;
    }
    /* Скрываем последний элемент (текущая страница) */
    .breadcrumbs .current { display: none; }

    /* Теги */
    .tags-block {
        margin-top: 24px;
        padding-top: 18px;
        gap: 6px;
    }
    .tags-block .tag {
        font-size: 12px;
        padding: 4px 10px;
    }

    /* Соцсети */
    .share-block {
        margin-top: 20px;
        padding-top: 18px;
        gap: 8px;
    }
    .share-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* Комментарии */
    .comments-block {
        padding: 20px 16px;
        margin-top: 24px;
        border-radius: var(--radius);
    }
    .comments-block h2 { font-size: 18px; }
    .comment {
        padding: 12px 14px;
        margin-bottom: 12px;
    }
    .comment-reply { margin-left: 14px; }
    .comment-body { font-size: 14px; }
    .comment-header { font-size: 13px; }

    .comment-form-wrapper { padding-top: 18px; }
    .comment-form-wrapper h3 { font-size: 16px; }
    .comment-form-row {
        flex-direction: column;
        gap: 0;
    }
    /* Важно: 16px — чтобы iOS не зумил при фокусе */
    .comment-form input,
    .comment-form textarea {
        font-size: 16px;
        padding: 12px 14px;
    }

    /* Похожие */
    .related-block { margin-top: 30px; }
    .related-block h2 { font-size: 18px; }

    /* Кнопки */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Сетка серверов */
    .servers-block { padding: 16px; margin-bottom: 20px; }
    .servers-block h3 { font-size: 16px; }
    .server-row { font-size: 13px; }

    /* Пусто */
    .empty { padding: 40px 16px; }
    .empty h2 { font-size: 18px; }

    /* Футер */
    footer { padding: 28px 0; font-size: 13px; }

    /* Форма поиска */
    .search-form { margin-bottom: 20px; }
    .search-form input[type=text] {
        padding: 12px 14px;
        font-size: 16px;
    }
}

/* ============ ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ ============ */
@media (max-width: 400px) {
    .container { padding: 0 14px; }
    .logo { font-size: 16px; }
    .logo-mark { width: 26px; height: 26px; font-size: 13px; }

    .article h1 { font-size: 22px; }
    .article .content { font-size: 15px; }

    .news-card img { height: 180px; }
    .news-card h3 { font-size: 16px; }

    .categories a {
        font-size: 12px;
        padding: 5px 12px;
    }

    .tg-bar a { font-size: 12px; }
    .tg-bar a .tg-handle { font-size: 12px; }
}