
    :root {
        --primary: #d00000;
        --primary-hover: #a00000;
        --text-main: #1f2937;
        --text-muted: #4b5563;
        --bg-body: #f8fafc;
        --bg-card: #ffffff;
        --border: #e2e8f0;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; max-width: 100vw; overflow-x: hidden; }
    body { font-family: 'Inter', -apple-system, sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.65; display: flex; flex-direction: column; min-height: 100vh; max-width: 100vw; overflow-x: hidden; }
    a { color: var(--primary); text-decoration: none; word-break: break-word; }
    a:hover { text-decoration: underline; }
    
    header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; width: 100%; }
    .header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding: 0.5rem 1rem; gap: 15px; flex-wrap: wrap; width: 100%; max-width: 1200px; margin: 0 auto; }
    .header-top-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
    @media (min-width: 992px) { .header-top-row { width: auto; } }
    
    .logo { font-size: 1.2rem; font-weight: 800; color: #0f172a; letter-spacing: 0.5px; white-space: nowrap; }
    
    /* Гамбургер кнопка */
    .menu-toggle { display: flex; flex-direction: column; justify-content: space-between; width: 28px; height: 21px; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 110; }
    .menu-toggle span { display: block; width: 100%; height: 3px; background: var(--text-main); border-radius: 2px; transition: all 0.3s; }
    .menu-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
    @media (min-width: 992px) { .menu-toggle { display: none; } }

    /* Поиск в шапке */
    .search-box { position: relative; flex-grow: 1; max-width: 100%; }
    @media (min-width: 992px) { .search-box { max-width: 300px; } }
    #site-search { width: 100%; padding: 8px 14px; font-size: 0.9rem; border: 1px solid var(--border); border-radius: 8px; outline: none; background: #f8fafc; transition: all 0.2s; }
    #site-search:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(208,0,0,0.08); }
    .search-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); max-height: 300px; overflow-y: auto; z-index: 200; display: none; }
    .search-item { display: block; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; text-decoration: none; transition: background 0.1s; }
    .search-item:hover { background: #fef2f2; text-decoration: none; }
    .search-item strong { display: block; font-size: 0.88rem; color: #1e293b; font-weight: 600; line-height: 1.3; }
    .search-item span { font-size: 0.75rem; color: var(--primary); }
    .search-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

    /* Меню навигации (адаптивное скрытие на мобилках) */
    .nav-categories { display: none; flex-direction: column; width: 100%; gap: 0.4rem; padding-bottom: 1rem; border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.5rem; }
    .nav-categories.active { display: flex; }
    @media (min-width: 992px) {
        .nav-categories { display: flex !important; flex-direction: row; width: auto; border-top: none; margin-top: 0; padding-top: 0; padding-bottom: 0; }
    }
    .nav-categories a { color: var(--text-muted); font-weight: 500; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 5px; }
    .nav-categories a svg { stroke: var(--text-muted); transition: stroke 0.2s; }
    .nav-categories a:hover { color: var(--primary); background: #fef2f2; text-decoration: none; }
    .nav-categories a:hover svg { stroke: var(--primary); }

    .container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; width: 100%; box-sizing: border-box; }
    .breadcrumbs { padding: 1.5rem 0 1rem; font-size: 0.875rem; color: var(--text-muted); word-break: break-word; }
    .breadcrumbs a { color: var(--text-muted); }
    .breadcrumbs span { margin: 0 0.4rem; color: #94a3b8; }
    .breadcrumbs .current { color: #0f172a; font-weight: 500; }

    .layout-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 4rem; width: 100%; }
    @media (min-width: 992px) { .layout-grid { grid-template-columns: 1fr 300px; } }

    /* Исправление вылетов текста и блоков */
    .main-article { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; width: 100%; max-width: 100%; overflow: hidden; box-sizing: border-box; }
    @media (min-width: 768px) { .main-article { padding: 2.5rem; } }

    .article-body { width: 100%; max-width: 100%; overflow-x: auto; word-wrap: break-word; overflow-wrap: break-word; }
    .article-body p, .article-body li, .article-body span, .article-body div { max-width: 100%; word-break: break-word; }

    /* Обертка таблиц для прокрутки на смартфонах */
    .article-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; display: block; overflow-x: auto; white-space: nowrap; }
    @media (min-width: 768px) { .article-body table { display: table; white-space: normal; } }
    .article-body th, .article-body td { border: 1px solid var(--border); padding: 0.65rem; text-align: left; }
    .article-body th { background: #f8fafc; font-weight: 600; color: #0f172a; }

    .sidebar-sticky { display: flex; flex-direction: column; gap: 1.5rem; width: 100%; max-width: 100%; overflow: hidden; }
    @media (min-width: 992px) { .sidebar-sticky { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; } }

    .widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; width: 100%; box-sizing: border-box; }
    .widget-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #334155; }
    .widget ul.related-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
    .widget ul.related-list li { border-bottom: 1px dashed var(--border); padding-bottom: 0.6rem; word-break: break-word; }
    .widget ul.related-list li:last-child { border-bottom: none; padding-bottom: 0; }
    .widget ul.related-list li a { font-size: 0.92rem; color: var(--primary); font-weight: 500; line-height: 1.45; display: flex; align-items: baseline; gap: 6px; }
    .widget ul.related-list li a:before { content: "→"; color: #94a3b8; font-size: 0.9rem; flex-shrink: 0; }
    .widget ul.related-list li a:hover { text-decoration: underline; color: var(--primary-hover); }

    footer { margin-top: auto; background: var(--bg-card); border-top: 1px solid var(--border); padding: 1.5rem 0; font-size: 0.88rem; color: var(--text-muted); width: 100%; }
    .footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
    .cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #0f172a; color: #fff; padding: 12px 20px; z-index: 1000; display: none; font-size: 0.9rem; box-shadow: 0 -4px 10px rgba(0,0,0,0.1); }
    .cookie-banner p { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; gap: 10px; }
    .cookie-btn { background: var(--primary); color: #fff; border: none; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
    .cookie-btn:hover { background: var(--primary-hover); }

    .articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; width: 100%; }
    .grid-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: all 0.2s; word-break: break-word; }
    .grid-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(208,0,0,0.08); text-decoration: none; transform: translateY(-2px); }
    .grid-card h3 { font-size: 1.05rem; color: #0f172a; font-weight: 700; line-height: 1.4; }
    .card-badge { align-self: flex-start; background: #f1f5f9; padding: 3px 8px; border-radius: 6px; font-size: 0.75rem; color: #64748b; font-weight: 600; }
    
    .btn-cat { display: inline-block; background: #f1f5f9; color: #334155; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: background 0.15s; }
    .btn-cat:hover { background: var(--primary); color: #fff; text-decoration: none; }

    .bottom-related { margin-top: 2rem; width: 100%; }
    .bottom-related h3 { font-size: 1.2rem; margin-bottom: 1rem; color: #1e293b; }
    .related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; width: 100%; }
    .related-card-item { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; transition: all 0.2s; word-break: break-word; }
    .related-card-item:hover { border-color: var(--primary); background: #fef2f2; text-decoration: none; }
    .related-card-item strong { font-size: 0.95rem; color: #1e293b; font-weight: 600; }
    .related-card-item span { font-size: 0.85rem; color: var(--primary); font-weight: 500; }

    .main-article h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin-bottom: 1.5rem; color: #0f172a; word-break: break-word; }
    @media (min-width: 768px) { .main-article h1 { font-size: 2.2rem; } }
    .main-article h2 { font-size: 1.3rem; font-weight: 700; margin: 2.0rem 0 1rem; color: #1e293b; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); word-break: break-word; }
    .main-article h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: #334155; word-break: break-word; }
    .main-article p { margin-bottom: 1.25rem; color: #334155; font-size: 1rem; word-break: break-word; }
    .main-article ul, .main-article ol { margin-bottom: 1.25rem; padding-left: 1.2rem; color: #334155; font-size: 1rem; word-break: break-word; }
    .main-article li { margin-bottom: 0.4rem; word-break: break-word; }
    .main-article blockquote { border-left: 4px solid var(--primary); background: #fef2f2; padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-radius: 0 8px 8px 0; font-style: italic; color: #7f1d1d; word-break: break-word; }
    
    @media (max-width: 768px) {
        .header-inner { padding: 0.5rem; }
        .main-article { padding: 1rem; }
    }
    