html {
    position: relative;
    min-height: 100%;
    scrollbar-color: rgb(var(--tint-7))transparent;
}
body {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 24px;
    font-family: "Inter", "Inter Fallback", system-ui, arial;
    color: rgb(28, 29, 30);
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 27px;
}

h3 {
    font-size: 24px;
}

h3 {
    font-size: 22px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo img { margin-right: 0 !important; }

.popover-content {
    font-size: 14px;
    line-height: 20px;
    font-family: "Inter", "Inter Fallback", system-ui, arial;
    color: rgb(28, 29, 30);
}

a .glyphicon{
    padding-right: 3px;
    padding-top:5px;
}

.hide-scrollbar {
    scrollbar-color:transparent transparent;
    transition:scrollbar-color .2s ease-in-out;
    scrollbar-width: thin;

}

.hide-scrollbar:hover {
    scrollbar-color:unset;
}

#main {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.navbar-fixed-top > .container-fluid {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

#menu {
    position: sticky;
    top: 90px;  /*отступ под фиксированный хедер */
    height: calc(100vh - 100px); /* фиксированная высота относительно экрана */
    overflow-y: auto; /* независимый скролл */
    padding-right: 10px;
    overscroll-behavior-y: contain;
}

/* Тонкий скроллбар (опционально) */
#menu::-webkit-scrollbar,#content-menu::-webkit-scrollbar { width: 4px; }
#menu::-webkit-scrollbar-thumb,#content-menu::-webkit-scrollbar-thumb { 
    background: rgba(0,0,0,0.2); 
    border-radius: 2px; 
    
}
#content-menu{
    scrollbar-width: thin;
}


#content-main h1, #content-main h2, #content-main h3, #content-main h4, #content-main [id] {
    scroll-margin-top: 100px; /* высота навбара + запас */
}

#menu h2{
    font-size:17px;
}

#menu ul, #mobmenu ul {
    list-style-type: none; 
}
#mobmenu h2, #menu h2{
    font-size:12px;
    text-transform: uppercase;
    padding-left:25px;
    font-weight: bold;
    color: rgb(28, 29, 30);
}

#mobmenu a,#menu a{
    color: oklab(0.230081 -0.00092198 -0.00227435 / 0.64);
}
.popover-content .nav > li > a {
    position: relative;
    display: block;
    padding: 5px 5px 5px 5px;
}

.popover-content .nav > li > a > div{
    color: rgb(28, 29, 30);
}

.nav > li > a {
    position: relative;
    display: block;
    padding: 3px 5px 5px 20px;
    font-size: 15px;
}


.navbar-toggle {
    margin-left: 15px;
    float: left;
}

#search{
    margin-right: 15px;
    float: right;
}


#content-main  h1:nth-of-type(2), #content-main  hr:first-of-type{
    display: none;
}

.alert{
    margin-top:10px;
    margin-bottom:10px;
}

.logo{
    color: rgb(28, 29, 30);
    font-size: 24px;
}
.logo:hover{
    text-decoration: none;
    color: rgb(28, 29, 30);
}

mark{
    background-color: unset;
    color: black !important;
}

.nav-pills mark{
    color: oklab(0.230081 -0.00092198 -0.00227435 / 0.64)!important;
}

.nav-pills .nav-pills{
    margin-left:20px;
}

#menu a.link, #mobmenu a.link{
    display: none;
}

a.link{
    color: transparent;
    font-size: 1px;
}

h2:hover > a.link, h3:hover > a.link,h4:hover > a.link{
    color:#ccc;
}


#main{
    margin-top:80px;
}

#content-menu a{
    color: oklab(0.230081 -0.00092198 -0.00227435 / 0.64);
    font-weight: 400;
    line-height: 25px;
    font-size: 15px;
}

.menu-2{
    margin-left:15px
}

.menu-3{
    margin-left:15px
}


/* 1. Синий стиль ТОЛЬКО для левой колонки */
#menu li a.active,
#menu li.active a {
    color: rgb(23, 114, 183) !important;
    font-weight: bolder;
    background-color: transparent !important;
    border-left: 2px solid rgb(23, 114, 183);
    border-radius: 0px;
}

/* 2. Сброс стилей для правой колонки */
#content-menu li a.active,
#content-menu li.active a {
    font-weight: normal !important;
    border-left: none !important;
    background-color: transparent !important;
}

/* Отключает все рамки, подсветки и мерцания при клике в правой колонке */
#content-menu .nav > li > a,
#content-menu .nav > li > a:hover,
#content-menu .nav > li > a:focus,
#content-menu .nav > li.active > a,
#content-menu .nav > li.active > a:hover,
#content-menu .nav > li.active > a:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    text-decoration: none !important;
    line-height: 1.2;
    font-size: 13px;
}

.panel a{
    text-transform: capitalize;
}

ul.nav-stacked ul.nav-stacked{
    display: none;
}

/* По умолчанию резервируем 2px прозрачным цветом */
.nav-stacked li a {
    border-left: 2px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* При активации меняем только цвет рамки */
 
.nav-stacked li a.active {
    border-left-color: rgb(23, 114, 183);
    background-color: transparent !important;
}

blockquote{
    font-size: 16px;
}

figcaption{
    text-align: center;
    font-size:13px;
    font-style: italic;
}

@media (max-width: 768px) {

    a.link {
        display: block;
        width: 0px;
    }

    #main{
        margin-top:0px;
    }

    #content-main{
        padding: 15px;
    }

}

.cookie-message {
    width: 100%;
    height: auto;
    background-color: rgba(255, 255, 255, 0.9);
    position: fixed;
    bottom: 0;
    z-index: 100000;
    text-align: center;
    -webkit-transform: translateZ(0);
    padding: 16px 0;
    font-size: 13px;
    -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4)
}

.cookie-message a {
    border: none;
    font-size: 13px
}

#menu > div{
    padding-bottom:30px;
}

.img-responsive.img-center {
  margin: 0 auto;
}


@media (min-width: 992px){
    .popover {min-width:300px;max-width:500px;}
    
        #content-menu {
        position: sticky;
        top: 90px; /* отступ под фиксированный хедер */
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        padding-left: 10px;
        overscroll-behavior-y: contain; /* чтобы скролл не «перетекал» на страницу */
    }

    /* Тонкий скроллбар */
    #content-menu::-webkit-scrollbar { width: 4px; }
    #content-menu::-webkit-scrollbar-thumb { 
        background: rgba(0,0,0,0.2); 
        border-radius: 2px; 
    }

    /* Важно: родители не должны обрезать контент */
    .row, #main, .container-fluid {
        overflow: visible !important;
    }

}


@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    table td, table th {
        padding: 8px 10px;
        font-size: 14px;
    }
    
        .navbar-default.visible-xs {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1030;
        margin-bottom: 0;
    }

    #main {
        padding-top: 55px; /* отступ под высоту фиксированного меню */
        margin-top: 0 !important;
    }
    
        .search-mobil {
        font-size: 16px !important;
    }

}


#main { 
    opacity: 0; 
    transition: opacity 0.35s ease-in-out; 
}
#main.loaded { 
    opacity: 1; 
}


/* Табы */
.nav-tabs { border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; }
.nav-tabs > li { margin-bottom: -2px; }
.nav-tabs > li > a {
    border: none; border-radius: 8px 8px 0 0;
    color: #6b7280; font-weight: 500; padding: 12px 20px;
    transition: all 0.2s ease; background: transparent;
}
.nav-tabs > li > a:hover { background: #f3f4f6; color: #111827; border-color: transparent; }
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    border: none; border-bottom: 2px solid rgb(23, 114, 183);
    color: rgb(23, 114, 183); background: transparent; font-weight: 600;
    outline: none; box-shadow: none;
}

/* Таблицы внутри табов */
.tab-content .table {
    border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; margin-bottom: 0;
}
.tab-content .table > thead > tr > th {
    background: #f9fafb; border-bottom: 2px solid #e5e7eb;
    font-weight: 600; color: #111827; padding: 14px; text-align: center;
}
.tab-content .table > tbody > tr > td {
    padding: 14px; text-align: center; vertical-align: middle;
    border-color: #f3f4f6; color: #374151;
}
.tab-content .table > tbody > tr > td strong { color: rgb(23, 114, 183); font-weight: 600; }
.tab-content .table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9fafb; }




/* ===== ПАЛИТРА ===== */
:root {
    --primary: #1772b7;        /* ваш синий */
    --primary-hover: #135d94;
    --secondary: #6b7280;
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-soft: #f9fafb;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;
}

/* ===== БАЗА ===== */
body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: #fff;
}

/* ===== ССЫЛКИ ===== */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ===== ЗАГОЛОВКИ ===== */
h1, h2, h3, h4, h5, h6 {
    color: #111827;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5rem;
}
h1 { font-size: 28px; }
h2 { font-size: 24px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
h3 { font-size: 20px; }

/* ===== BREADCRUMBS ===== */
.breadcrumb {
    background: var(--bg-soft);
    border-radius: 6px;
    font-size: 14px;
    padding: 8px 15px;
}
.breadcrumb > li + li::before { color: var(--secondary); padding: 0 8px; }
.breadcrumb a { color: var(--secondary); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb > .active { color: var(--text); font-weight: 500; }

/* ===== ALERTS ===== */
.alert {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1772b7; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert a { font-weight: 500; text-decoration: none; }
.alert a:hover { text-decoration: underline; }

/* ===== TABLES ===== */
.table {
    border-color: var(--border);
    font-size: 15px;
}
.table > thead > tr > th {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    color: #111827;
    font-weight: 600;
}
.table-striped > tbody > tr:nth-of-type(odd) { background: #fafafa; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* ===== CODE & MARK ===== */
code {
    background: var(--bg-soft);
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
pre code {
    background: #f1f5f9;
    color: #334155;
    padding: 12px;
    border-radius: 8px;
    display: block;
    overflow-x: auto;
}
mark {
    color: #854d0e;
    padding: 2px 4px;
    border-radius: 3px;
}

/* ===== DETAILS / SUMMARY ===== */
details {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}
summary {
    font-weight: 500;
    cursor: pointer;
    color: var(--primary);
}
summary:hover { color: var(--primary-hover); }

/* ===== BLOCKQUOTE ===== */
blockquote {
    border-left: 3px solid var(--primary);
    background: #f0f7ff;
    padding: 12px 16px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
}

/* ===== IMAGES ===== */
.img-rounded { border-radius: 8px; }
figure { margin: 24px 0; }
figcaption {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== HR ===== */
hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}






/* ===== ТАБЛИЦА-СПИСОК (фичи/скидки) ===== */
#content-main .table.table-striped.table-bordered {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Скрываем пустые колонки */
#content-main .table.table-striped.table-bordered th:empty,
#content-main .table.table-striped.table-bordered td:empty {
    -display: none;
}

/* Строки */
#content-main .table > tbody > tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}
#content-main .table > tbody > tr:last-child { border-bottom: none; }
#content-main .table > tbody > tr:hover {
    background: #f8fafc;
}

/* Ячейки */
#content-main .table > tbody > tr > td {
    padding: 14px 16px;
    border: none;
    vertical-align: middle;
}

/* Название фичи (вторая колонка) */
#content-main .table > tbody > tr > td:nth-child(2) {
    font-weight: 500;
    color: var(--text);
    width: 65%;
}
#content-main .table > tbody > tr > td:nth-child(2) strong {
    color: #111827;
    font-weight: 600;
}
#content-main .table > tbody > tr > td:nth-child(2) mark {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Ссылка-якорь (четвертая колонка) — как аккуратный бейдж */
#content-main .table > tbody > tr > td:nth-child(4) {
    width: 35%;
    text-align: right;
}
#content-main .table > tbody > tr > td:nth-child(4) a {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}
#content-main .table > tbody > tr > td:nth-child(4) a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(23, 114, 183, 0.15);
}

/* Убираем лишние отступы у заголовка, если он пустой */
#content-main .table > thead:empty { display: none; }

/* Адаптив: на мобильных — ссылка под текстом */
@media (max-width: 767px) {
    #content-main .table > tbody > tr > td {
        display: block;
        width: 100% !important;
        text-align: left !important;
        padding: 10px 16px;
    }
    #content-main .table > tbody > tr > td:nth-child(4) {
        padding-top: 4px;
    }
    #content-main .table > tbody > tr > td:nth-child(4) a {
        width: 100%;
        text-align: center;
    }
}




/* Контейнер: выравниваем и фиксируем размер */
/* 1. Ссылка становится flex-контейнером (текст + стрелка в одной линии) */
#menu .nav > li > a,
#mobmenu .nav > li > a {
    display: flex !important;
    align-items: center !important; /* Вертикальное центрирование */
    line-height: normal !important;
    gap: 6px;
}

/* 2. Сброс pull-right + прижим в конец + центрирование иконки */
#menu .nav > li > a .glyphicon-menu-right,
#mobmenu .nav > li > a .glyphicon-menu-right {
    float: none !important;         /* Убивает Bootstrap pull-right */
    margin-left: auto !important;   /* Прижимает строго в конец */
    order: 1;                       /* Гарантирует позицию после текста */
    
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 1 !important;
    top: 0 !important;
    font-size: 12px !important;
    
    /* Сохраняем вращение */
    transform-origin: 50% 50% !important;
    transition: transform 0.2s ease;
}


/* Вращаем ТОЛЬКО визуальную часть иконки */
#menu .nav-stacked > li > a .glyphicon-menu-right::before,
#mobmenu .nav-stacked > li > a .glyphicon-menu-right::before {
    display: inline-block;
    transition: transform 0.2s ease;
    transform-origin: center center !important;
    transform: rotate(0deg);
}

/* Раскрытое состояние */
#menu .nav-stacked > li > a.expanded .glyphicon-menu-right::before,
#mobmenu .nav-stacked > li > a.expanded .glyphicon-menu-right::before {
    transform: rotate(90deg);
}



@media (max-width: 767px) {
    #navbar {
        max-height: calc(100vh - 55px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px 15px 60px 15px;
    }
    .navbar-collapse {
        margin: 0 !important;
    }
    .navbar-default, .container-fluid {
        overflow: visible !important;
    }
}

/* Контейнер поиска */
.search-dropdown { 
    position: relative; 
    width: 100%; 
    max-width: 400px; 
}

/* Выпадающий список */
.search-results {
    position: absolute;
    top: 100%; left: 0; right: 0;
    max-height: 600px; overflow-y: auto;
    margin-top: 4px; padding: 8px 0;
    border: 1px solid #e5e7eb; border-radius: 8px;
    background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1050; display: none;
}
.search-results.show { display: block; scrollbar-width: thin;}

/* Элементы списка */
.search-results li a {
    display: block; padding: 8px 16px; color: var(--text);
    font-size: 14px; 
    line-height: 1.2;
    text-wrap: auto;
}
.search-results li a:hover {
    background: #f0f7ff; color: var(--primary); text-decoration: none;
}
.search-results li a div {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
	
/* Скроллбар */
.search-results::-webkit-scrollbar { width: 4px; }
.search-results::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }



@media (max-width: 767px) {
    .search-dropdown-mobil { position: relative; width: 100%; }
    
    .search-results-mobil {
        position: absolute;
        top: 100%; left: 0; right: 0;
        max-height: 450px; overflow-y: auto;
        margin-top: 4px; padding: 8px 0;
        border: 1px solid #e5e7eb; border-radius: 8px;
        background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        z-index: 1050; display: none; width: 100%;
    }
    .search-results-mobil.show { display: block; }
    
    .search-results-mobil li a {
        display: block; padding: 10px 16px; color: var(--text);
        font-size: 15px; line-height: 1.2; 
	    text-wrap: auto;
	    border-bottom: 1px solid #f3f4f6;
    }
    .search-results-mobil li a:last-child { border-bottom: none; }
    .search-results-mobil li a:hover {
        background: #f0f7ff; color: var(--primary); text-decoration: none;
    }
    .search-results-mobil li a div {
        font-size: 13px; color: var(--text-muted); margin-top: 3px;
    }
}


/* Скелетон-загрузчик */
.search-skeleton { padding: 10px 16px; pointer-events: none; }
.skeleton-line {
    height: 14px; border-radius: 4px; margin-bottom: 8px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 0.7s infinite linear;
}
.skeleton-line.title { height: 16px; width: 80%; background-color: #e5e7eb; }
.skeleton-line.desc  { height: 10px; width: 100%; background-color: #f3f4f6; margin-bottom: 0; }

@keyframes skeleton-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}



@media (min-width: 768px) and (max-width: 991px) {
    /* Держим колонки в одну линию */
    header .container-fluid > .row {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }
    /* Отключаем float и фиксированную ширину Bootstrap */
    header .container-fluid > .row > [class*="col-"] {
        float: none;
        width: auto;
    }
    /* Пустую колонку скрываем, поиск растягиваем */
    header .container-fluid > .row > .col-md-3:last-child { display: none; }
    header .container-fluid > .row > .col-md-4 { flex-grow: 1; }
}




/* Рамка и курсор */
figure img.img-center {
    cursor: zoom-in;
}

/* Лупа при наведении */
figure { position: relative; }
figure::after {
    content: '\e081'; /* Код иконки Плюс */
    font-family: 'Glyphicons Halflings';
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 16px;
    color: #fff;
    background: rgba(0,0,0,0.3); /* Полупрозрачный круг */
    border-radius: 50%; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s; pointer-events: none;
    line-height: 1;
}
/* Не забудьте правило появления при наведении (если удаляли) */
figure:hover::after { opacity: 1; }

figure::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgb(0 0 0 / 3%); /* Лёгкое затемнение */
    border-radius: 8px; opacity: 0; transition: opacity 0.2s ease;
    pointer-events: none; z-index: 1;
}
figure:hover::before { opacity: 1; }

/* Иконка поверх затемнения */
figure::after { z-index: 2; } /* добавьте это свойство в ваш существующий блок figure::after */

/* Лайтбокс */
#lightbox-overlay {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.85); z-index: 99999;
    justify-content: center; align-items: center; cursor: zoom-out;
    opacity: 0; transition: opacity 0.2s ease;
}
#lightbox-overlay.active { display: flex; opacity: 1; }
#lightbox-overlay img {
    max-width: 90vw; max-height: 90vh; border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4); object-fit: contain;
}
#content-main{
   padding-top:10px;
}




/* ===== АНКОРНЫЕ ССЫЛКИ ДЛЯ ЗАГОЛОВКОВ (иконка после текста) ===== */

/* Контейнер заголовка */
.heading-with-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    scroll-margin-top: 80px;
    gap: 4px;
    width: 100%;
}

/* Иконка-ссылка - сразу после текста */
.heading-link {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #007bff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
}

/* Убираем рамку фокуса для ссылки */
.heading-link:focus,
.heading-link:focus-visible,
.heading-link:active {
    outline: none;
    box-shadow: none;
}

/* Появление иконки при наведении на заголовок */
.heading-with-link:hover .heading-link {
    opacity: 0.6;
}

/* Увеличение прозрачности при наведении на саму иконку */
.heading-link:hover {
    opacity: 1 !important;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Размер SVG иконки */
.heading-link svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

/* Текст заголовка */
.heading-with-link span {
    display: inline;
}

/* Анимация при копировании */
.heading-link.copied {
    animation: linkPulse 0.3s ease;
}

@keyframes linkPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}




/* Иконка-ссылка - сразу после текста */
.heading-link {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #007bff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    transform: translateY(3px);  /* Опускаем на 3px */
}

/* Убираем рамку фокуса */
.heading-link:focus,
.heading-link:focus-visible,
.heading-link:active {
    outline: none;
    box-shadow: none;
}

/* Не забываем про анимацию при копировании - тоже нужно скорректировать */
@keyframes linkPulse {
    0% {
        transform: translateY(3px) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(3px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(3px) scale(1);
        opacity: 0.6;
    }
}


/* ===== АДАПТИВ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    .heading-link {
        opacity: 0.5;
    }
    
    .heading-with-link:hover .heading-link {
        opacity: 0.5;
    }
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.custom-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.custom-notification.show {
    transform: translateX(0);
}

.custom-notification.notification-error {
    background: #dc3545;
}




/* Убираем рамку фокуса при клике со всех ссылок */
a:focus,
a:focus-visible,
a:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Но оставляем рамку для навигации с клавиатуры (для accessibility) */
a:focus-visible {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
}



    /* Стили виджета чата */

    .chat-widget {
      position: fixed;
      bottom: 30px;
      right: 30px;
      display: flex;
      align-items: center;
      z-index: 1000;
    }

    .tooltip-bubble {
background: #03A9F4;
    color: white;
    padding: 3px 12px;
    border-radius: 16px;
    font-size: 14px;
    margin-right: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 1;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    }

    .icon-group {
      position: relative;
      display: inline-block;
    }

    .main-icon {
      width: 60px;
      height: 60px;
      background: #03a9f4;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 28px;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      transition: transform 0.3s ease;
      position: relative;
      z-index: 2;
    }

    .main-icon:hover {
      transform: scale(1.05);
    }

    .social-icons {
      position: absolute;
      bottom: 68px;
      right: 0;
      display: flex;
      gap: 12px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease, transform 0.4s ease;
      transform: translateY(10px);
      z-index: 1;
    }

    .social-icon {
      width: 50px;
      height: 50px;
      background: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 34px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      transition: transform 0.2s ease;
    }

    .social-icon:hover {
      transform: scale(1.05);
    }

    .social-icon.telegram {
      color: #0088cc;
    }

    .social-icon.whatsapp {
      color: #25d366;
    }

    /* Ключевой фикс: невидимый «мост» для hover */
    .icon-group::before {
      content: '';
      position: absolute;
      top: -40px; /* от основной иконки вверх */
      left: 50%;
      transform: translateX(-50%);
      width: 60px;
      height: 40px;
      background: transparent;
      pointer-events: auto;
      z-index: 0;
    }

    /* Показываем иконки, если hover на группе или на мосте */
    .icon-group:hover .social-icons,
    .icon-group .social-icons:hover {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    /* Скрываем тултип только при hover на кнопке */
    .main-icon:hover ~ .tooltip-bubble {
      opacity: 0;
    }

    @media (max-width: 768px) {
      .icon-group::before {
        display: none;
      }

      .icon-group:hover .social-icons,
      .icon-group .social-icons:hover {
        opacity: 0;
        pointer-events: none;
      }

      .icon-group.active .social-icons {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
      }
    }
    
  
/* ========== СТИЛИ ДЛЯ ЧАТ-ВИДЖЕТА (снизу) ========== */
.main-icon:hover {
  transform: scale(1.05);
}

.main-icon svg {
  width: 28px;
  height: 28px;
}

.icon-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.icon-group.active .social-icons,
.icon-group:hover .social-icons {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.social-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Увеличенные кружочки и центрирование иконок */
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: all 0.3s ease;
  text-decoration: none;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}

.social-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Стили для QR-кода с надписью (только для чат-виджета) */
.qr-code {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
  min-width: 140px;
}

.qr-code img {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto;
}

.qr-text {
  font-size: 11px;
  color: #333;
  text-align: center;
  margin-top: 8px;
  max-width: 120px;
  line-height: 1.3;
  font-family: Arial, sans-serif;
}

/* Специально для MAX (третья иконка) */
.social-item:last-child .qr-code {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.social-item:hover .qr-code {
  opacity: 1;
  visibility: visible;
  bottom: 55px;
}

/* ========== СТИЛИ ДЛЯ ПОПАПА В ШАПКЕ ========== */
.header-chat-icons {
  position: relative;
  display: inline-block;
}

.header-chat-icons .chat-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #333;
}

.header-chat-icons .chat-trigger:hover {
  text-decoration: none;
}

.header-chat-icons .social-icons-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 12px;
  display: none;
  z-index: 10000;
  flex-direction: column;
  gap: 8px;
}

.header-chat-icons .social-icons-popup.show {
  display: flex;
}

/* Стили для элементов попапа */
.popup-item-wrapper {
  position: relative;
}

.header-chat-icons .popup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background 0.2s;
  text-decoration: none;
  color: #333;
}

.header-chat-icons .popup-item:hover {
  background: #f5f5f5;
  text-decoration: none;
}

.header-chat-icons .popup-item svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.header-chat-icons .popup-item span {
  font-size: 14px;
  font-weight: 500;
}

/* QR-код в попапе шапки (справа при ховере) */
.popup-qr {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: 10px;
  transform: translateY(-50%);
  background: white;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10001;
  min-width: 130px;
  pointer-events: none;
  white-space: nowrap;
}

.popup-item-wrapper:hover .popup-qr {
  opacity: 1;
  visibility: visible;
}

.popup-qr img {
  width: 110px;
  height: 110px;
  display: block;
  margin: 0 auto;
}

.popup-qr-text {
  font-size: 10px;
  color: #333;
  text-align: center;
  margin-top: 6px;
  white-space: normal;
  font-family: Arial, sans-serif;
}

/* ========== ПЛАНШЕТЫ (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
  .qr-code img {
    width: 100px;
    height: 100px;
  }
  
  .qr-text {
    font-size: 10px;
    max-width: 100px;
  }
  
  /* Для планшетов попап НЕ меняем позиционирование */
  .header-chat-icons {
    position: relative;
  }
  
  .header-chat-icons .social-icons-popup {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    bottom: auto;
  }
}

/* ========== МОБИЛЬНЫЕ (до 768px) ========== */
@media (max-width: 768px) {
  /* ЧАТ-ВИДЖЕТ: мобильные стили */
  .social-icons {
    position: absolute;
    bottom: 70px;
    right: 0;
    flex-direction: column;
    gap: 12px;
  }
  
  /* Скрываем QR-коды везде на мобильных */
  .qr-code,
  .popup-qr {
    display: none !important;
  }
  
  .social-icon {
    pointer-events: auto;
    width: 44px;
    height: 44px;
  }
  
  .social-icon svg {
    width: 24px;
    height: 24px;
  }
  
  /* ШАПКА на мобильных: оставляем как есть, только убираем затемнение и fixed */
  .header-chat-icons {
    position: relative;
    display: inline-block;
  }
  
  .header-chat-icons .social-icons-popup {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    bottom: auto;
    margin-top: 10px;
    width: auto;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  }
  
  /* Убираем затемнение */
  .header-chat-icons .social-icons-popup.show::before {
    display: none;
  }
}


/* Для мобильных: скрываем соцсети по умолчанию */
@media (max-width: 768px) {
  .icon-group .social-icons {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
  }
  
  .icon-group.active .social-icons {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}


/* ========== АНИМАЦИЯ ДЛЯ ЧАТ-ВИДЖЕТА ========== */
.chat-widget .main-icon {
    transition: transform 0.3s ease;
}

/* При наведении на виджет */
.chat-widget:hover .main-icon {
    transform: scale(1.05);
}

/* Анимация при наведении */
.chat-widget:hover .dot1 {
    animation: dotFadeOut 0.3s ease forwards;
}
.chat-widget:hover .dot2 {
    animation: dotFadeOut 0.3s ease 0.1s forwards;
}
.chat-widget:hover .dot3 {
    animation: dotFadeOut 0.3s ease 0.2s forwards;
}
.chat-widget:hover .smiley {
    animation: smileyFadeIn 0.3s ease 0.25s forwards;
}

/* Убираем анимацию, когда курсор ушёл */
.chat-widget .dot1,
.chat-widget .dot2,
.chat-widget .dot3,
.chat-widget .smiley {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Базовые стили для обратной анимации (через transition) */
.chat-widget:not(:hover) .dot1,
.chat-widget:not(:hover) .dot2,
.chat-widget:not(:hover) .dot3 {
    opacity: 1;
    transform: scale(1);
    animation: none;
}

.chat-widget:not(:hover) .smiley {
    opacity: 0;
    transform: scale(0.5);
}

/* ========== ПЕРИОДИЧЕСКАЯ АНИМАЦИЯ (раз в 15 секунд) ========== */
.chat-animation.animate .dot1 {
    animation: dotFadeOut 0.3s ease forwards;
}
.chat-animation.animate .dot2 {
    animation: dotFadeOut 0.3s ease 0.1s forwards;
}
.chat-animation.animate .dot3 {
    animation: dotFadeOut 0.3s ease 0.2s forwards;
}
.chat-animation.animate .smiley {
    animation: smileyFadeIn 0.3s ease 0.25s forwards;
}

/* ОБРАТНАЯ АНИМАЦИЯ — смайлик в точки */
.chat-animation.reset .smiley {
    animation: smileyFadeOut 0.3s ease forwards;
}
.chat-animation.reset .dot1 {
    animation: dotFadeIn 0.3s ease 0.25s forwards;
}
.chat-animation.reset .dot2 {
    animation: dotFadeIn 0.3s ease 0.15s forwards;
}
.chat-animation.reset .dot3 {
    animation: dotFadeIn 0.3s ease 0.05s forwards;
}

/* Ключевые кадры */
@keyframes dotFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

@keyframes dotFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes smileyFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes smileyFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* На мобильных отключаем анимацию при наведении */
@media (max-width: 768px) {
    .chat-widget:hover .dot1,
    .chat-widget:hover .dot2,
    .chat-widget:hover .dot3,
    .chat-widget:hover .smiley {
        animation: none;
    }
}

/* =============================================
   ТЁМНАЯ ТЕМА
   Активируется атрибутом data-theme="dark" на <html>
   ============================================= */

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: #0f1115;
    color: #d6d9de;
}

/* ===== ПАЛИТРА (переопределяем переменные) ===== */
html[data-theme="dark"] {
    --primary: #4ea1e0;
    --primary-hover: #6cb6f0;
    --secondary: #9aa1ab;
    --success: #34d399;
    --info: #60a5fa;
    --warning: #fbbf24;
    --danger: #f87171;
    --bg-soft: #1a1d24;
    --border: #2a2f3a;
    --text: #d6d9de;
    --text-muted: #9aa1ab;
}

/* ===== HEADER / NAVBAR ===== */
html[data-theme="dark"] .navbar-default {
    background-color: #151821;
    border-color: #2a2f3a;
}
html[data-theme="dark"] .navbar-default .navbar-brand,
html[data-theme="dark"] .logo,
html[data-theme="dark"] .logo:hover {
    color: #e6e8ec;
}
html[data-theme="dark"] .navbar-default .navbar-toggle {
    border-color: #2a2f3a;
}
html[data-theme="dark"] .navbar-default .navbar-toggle .icon-bar {
    background-color: #9aa1ab;
}
html[data-theme="dark"] .navbar-default .navbar-toggle:hover {
    background-color: #1f242e;
}

/* ===== ЗАГОЛОВКИ ===== */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
    color: #eef1f5;
}
html[data-theme="dark"] h2 {
    border-bottom-color: #2a2f3a;
}

/* ===== ССЫЛКИ ===== */
html[data-theme="dark"] a {
    color: var(--primary);
}
html[data-theme="dark"] a:hover {
    color: var(--primary-hover);
}

/* ===== ЛЕВОЕ МЕНЮ И ПРАВЫЙ TOC ===== */
html[data-theme="dark"] #menu a,
html[data-theme="dark"] #mobmenu a,
html[data-theme="dark"] #content-menu a {
    color: #b6bcc6;
}
html[data-theme="dark"] #menu a:hover,
html[data-theme="dark"] #mobmenu a:hover,
html[data-theme="dark"] #content-menu a:hover {
    color: var(--primary);
}
html[data-theme="dark"] #menu h2,
html[data-theme="dark"] #mobmenu h2 {
    color: #e6e8ec;
}
html[data-theme="dark"] #menu li a.active,
html[data-theme="dark"] #menu li.active a {
    color: var(--primary) !important;
    border-left-color: var(--primary);
}
html[data-theme="dark"] .nav-stacked li a.active {
    border-left-color: var(--primary);
}
html[data-theme="dark"] #menu::-webkit-scrollbar-thumb,
html[data-theme="dark"] #content-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

/* ===== BREADCRUMB ===== */
html[data-theme="dark"] .breadcrumb {
    background: #1a1d24;
}
html[data-theme="dark"] .breadcrumb a {
    color: var(--text-muted);
}
html[data-theme="dark"] .breadcrumb a:hover {
    color: var(--primary);
}
html[data-theme="dark"] .breadcrumb > .active {
    color: #e6e8ec;
}

/* ===== ПОИСК ===== */
html[data-theme="dark"] .form-control {
    background-color: #1a1d24;
    border-color: #2a2f3a;
    color: #d6d9de;
}
html[data-theme="dark"] .form-control::placeholder {
    color: #6b7280;
}
html[data-theme="dark"] .form-control:focus {
    background-color: #1f242e;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 161, 224, 0.15);
}
html[data-theme="dark"] .search-results,
html[data-theme="dark"] .search-results-mobil {
    background: #151821;
    border-color: #2a2f3a;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
html[data-theme="dark"] .search-results li a,
html[data-theme="dark"] .search-results-mobil li a {
    color: #d6d9de;
    border-bottom-color: #232831;
}
html[data-theme="dark"] .search-results li a:hover,
html[data-theme="dark"] .search-results-mobil li a:hover {
    background: #1f242e;
    color: var(--primary);
}
html[data-theme="dark"] .search-results li a div,
html[data-theme="dark"] .search-results-mobil li a div {
    color: var(--text-muted);
}
html[data-theme="dark"] .skeleton-line {
    background: linear-gradient(90deg, #232831 25%, #2a2f3a 50%, #232831 75%);
    background-size: 200% 100%;
}

/* ===== КОД ===== */
html[data-theme="dark"] code {
    background: #1f242e;
    color: #f472b6;
}
html[data-theme="dark"] pre code {
    background: #151821;
    color: #cbd5e1;
    border: 1px solid #2a2f3a;
}
html[data-theme="dark"] kbd {
    background: #2a2f3a;
    color: #e6e8ec;
}

/* ===== ТАБЛИЦЫ ===== */
html[data-theme="dark"] .table {
    color: #d6d9de;
    border-color: #2a2f3a;
}
html[data-theme="dark"] .table > thead > tr > th {
    background: #1a1d24;
    color: #e6e8ec;
    border-bottom-color: #2a2f3a;
    border-top-color: #2a2f3a;
}
html[data-theme="dark"] .table > tbody > tr > td,
html[data-theme="dark"] .table > tbody > tr > th {
    border-top-color: #2a2f3a;
}
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #151821;
}
html[data-theme="dark"] .table-hover > tbody > tr:hover {
    background-color: #1f242e;
}
html[data-theme="dark"] #content-main .table > tbody > tr:hover {
    background: #1a1d24;
}
html[data-theme="dark"] #content-main .table.table-striped.table-bordered {
    background: #151821;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
html[data-theme="dark"] #content-main .table > tbody > tr > td:nth-child(2) strong {
    color: #e6e8ec;
}
html[data-theme="dark"] #content-main .table > tbody > tr > td:nth-child(2) mark {
    background: #1e3a5f;
    color: #93c5fd ;
}
html[data-theme="dark"] #content-main .table > tbody > tr > td:nth-child(4) a {
    background: #1f242e;
    border-color: #2a2f3a;
    color: var(--primary);
}
html[data-theme="dark"] #content-main .table > tbody > tr > td:nth-child(4) a:hover {
    background: var(--primary);
    color: #0f1115;
}

/* ===== ALERTS ===== */
html[data-theme="dark"] .alert-success { background: #0d2818; border-color: #14532d; color: #86efac; }
html[data-theme="dark"] .alert-info    { background: #0c1e33; border-color: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .alert-warning { background: #2b1d05; border-color: #78350f; color: #fcd34d; }
html[data-theme="dark"] .alert-danger  { background: #2b0f0f; border-color: #7f1d1d; color: #fca5a5; }

/* ===== BLOCKQUOTE ===== */
html[data-theme="dark"] blockquote {
    background: #151821;
    border-left-color: var(--primary);
    color: var(--text-muted);
}

/* ===== DETAILS ===== */
html[data-theme="dark"] details {
    background: #151821;
    border-color: #2a2f3a;
}
html[data-theme="dark"] summary {
    color: var(--primary);
}

/* ===== HR ===== */
html[data-theme="dark"] hr {
    border-top-color: #2a2f3a;
}

/* ===== MARK ===== */
html[data-theme="dark"] mark {
    background: #422006;
    color: #fcd34d !important;
}
html[data-theme="dark"] .nav-pills mark {
    color: #fcd34d !important;
}

/* ===== BUTTONS ===== */
html[data-theme="dark"] .btn-default {
    background-color: #1a1d24;
    border-color: #2a2f3a;
    color: #d6d9de;
}
html[data-theme="dark"] .btn-default:hover {
    background-color: #232831;
    border-color: #3a4150;
    color: #eef1f5;
}
html[data-theme="dark"] .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #0f1115;
}
html[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ===== COOKIE MESSAGE ===== */
html[data-theme="dark"] .cookie-message {
    background-color: rgba(21, 24, 33, 0.95);
    color: #d6d9de;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}

/* ===== ИИ-ЧАТ ===== */
html[data-theme="dark"] #ai-chat-widget {
    background: #151821;
    border-color: #2a2f3a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
html[data-theme="dark"] #ai-chat-log {
    scrollbar-color: #3a4150 transparent;
}
html[data-theme="dark"] #ai-chat-log::-webkit-scrollbar-thumb {
    background: #3a4150;
}
html[data-theme="dark"] #ai-chat-log::-webkit-scrollbar-thumb:hover {
    background: #4a5160;
}
html[data-theme="dark"] .ai-msg-user span {
    background: #1e3a5f;
    color: #e6e8ec;
}
html[data-theme="dark"] .ai-msg-bot span {
    background: #232831;
    color: #d6d9de;
}
html[data-theme="dark"] #ai-chat-input-wrapper {
    border-top-color: #2a2f3a;
}
html[data-theme="dark"] #ai-chat-input {
    background: #1a1d24;
    border-color: #2a2f3a;
    color: #d6d9de;
}
html[data-theme="dark"] #ai-chat-input::placeholder {
    color: #6b7280;
}
html[data-theme="dark"] #ai-chat-send {
    background: var(--primary);
    color: #0f1115;
}
html[data-theme="dark"] #ai-chat-send:disabled {
    background: #3a4150;
    color: #6b7280;
}
html[data-theme="dark"] .support-links {
    background: #1a1d24 !important;
}
html[data-theme="dark"] .support-links > div:first-child {
    color: #9aa1ab !important;
}

/* ===== TABS ===== */
html[data-theme="dark"] .nav-tabs {
    border-bottom-color: #2a2f3a;
}
html[data-theme="dark"] .nav-tabs > li > a {
    color: #9aa1ab;
}
html[data-theme="dark"] .nav-tabs > li > a:hover {
    background: #1f242e;
    color: #e6e8ec;
}
html[data-theme="dark"] .nav-tabs > li.active > a,
html[data-theme="dark"] .nav-tabs > li.active > a:hover,
html[data-theme="dark"] .nav-tabs > li.active > a:focus {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
html[data-theme="dark"] .tab-content .table {
    border-color: #2a2f3a;
}
html[data-theme="dark"] .tab-content .table > thead > tr > th {
    background: #1a1d24;
    color: #e6e8ec;
    border-bottom-color: #2a2f3a;
}
html[data-theme="dark"] .tab-content .table > tbody > tr > td {
    color: #d6d9de;
    border-color: #232831;
}
html[data-theme="dark"] .tab-content .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #151821;
}

/* ===== POPOVER ===== */
html[data-theme="dark"] .popover {
    background: #151821;
    border-color: #2a2f3a;
    color: #d6d9de;
}
html[data-theme="dark"] .popover-content .nav > li > a > div {
    color: #d6d9de;
}

/* ===== FIGURE ===== */
html[data-theme="dark"] figure::before {
    background: rgba(0, 0, 0, 0.15);
}

/* ===== BREADCRUMB HOME ICON ===== */
html[data-theme="dark"] .glyphicon {
    color: inherit;
}

/* ===== МОБИЛЬНОЕ МЕНЮ ===== */
html[data-theme="dark"] #navbar {
    background: #151821;
}
html[data-theme="dark"] .navbar-default.visible-xs {
    background-color: #151821;
    border-color: #2a2f3a;
}

/* ===== AI CHAT HEADER (оставляем синий, но чуть темнее) ===== */
html[data-theme="dark"] #ai-chat-header {
    background: #1a5a94;
}

/* ===== ФОКУС ===== */
html[data-theme="dark"] a:focus-visible {
    outline-color: var(--primary) !important;
}

/* ===== СКРОЛЛБАР ===== */
html[data-theme="dark"] {
    scrollbar-color: #3a4150 transparent;
}
html[data-theme="dark"] body::-webkit-scrollbar {
    width: 10px;
}
html[data-theme="dark"] body::-webkit-scrollbar-track {
    background: #0f1115;
}
html[data-theme="dark"] body::-webkit-scrollbar-thumb {
    background: #3a4150;
    border-radius: 5px;
}
html[data-theme="dark"] body::-webkit-scrollbar-thumb:hover {
    background: #4a5160;
}

.theme-toggle {
    padding: 6px 10px;
    font-size: 16px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s ease;
    vertical-align: middle;
}
.theme-toggle:hover {
    transform: scale(1.05);
}
.theme-toggle .theme-icon {
    display: inline-block;
    line-height: 1;
}

/* Выравнивание кнопки переключения темы */
.theme-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 16px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ccc;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    transform: none; /* Убираем дергание, если задано в предыдущем коде */
    background-color: #e6e6e6;
}

/* Стили для кнопки в тёмной теме */
html[data-theme="dark"] .theme-toggle {
    background-color: #1a1d24;
    border-color: #2a2f3a;
    color: #d6d9de;
}
html[data-theme="dark"] .theme-toggle:hover {
    background-color: #232831;
    border-color: #3a4150;
}
