/* ============================================================
   База знаний — стили в стиле Яндекс.Справки.
   Используем дизайн-токены из темы (var(--blue400), --black* и т.п.)
   ============================================================ */

/* ===== Поиск ===== */
.kb-search {
    position: relative;
    margin: 0 0 32px;
}

.kb-search__field {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--white0);
    border: 1px solid var(--black200);
    border-radius: 12px;
    padding: 0 14px 0 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kb-search__field:focus-within {
    border-color: var(--blue400);
    box-shadow: 0 0 0 3px var(--blue50);
}

.kb-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--black400);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.kb-search__field:focus-within .kb-search__icon {
    color: var(--blue400);
}

.kb-search__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 14px 0;
    font-family: var(--font_inter);
    font-size: 15px;
    color: var(--black900);
    outline: none;
}
.kb-search__input::placeholder {
    color: var(--black500);
}
.kb-search__input::-webkit-search-cancel-button {
    display: none;
}

.kb-search__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    background: var(--black100);
    border-radius: 50%;
    color: var(--black600);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    margin-left: 6px;
    flex-shrink: 0;
}
.kb-search__clear:hover {
    background: var(--black200);
    color: var(--black900);
}
.kb-search__clear[hidden] {
    display: none;
}

.kb-search__submit {
    flex-shrink: 0;
    padding: 0 24px;
    background: var(--blue500);
    color: var(--white0);
    border: 0;
    border-radius: 12px;
    font-family: var(--font_inter);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.kb-search__submit:hover {
    background: var(--blue600);
}
.kb-search__submit:active {
    transform: translateY(1px);
}

/* ===== Dropdown с результатами ===== */
.kb-search__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white0);
    border: 1px solid var(--black100);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 8px 0 rgba(0, 6, 26, 0.1);
    overflow: hidden;
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
}
.kb-search__dropdown[hidden] {
    display: none;
}

.kb-search__dropdown-body {
    overflow-y: auto;
    flex: 1;
}

.kb-search__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--black800);
    border-bottom: 1px solid var(--black100);
    transition: background 0.1s ease;
    cursor: pointer;
}
.kb-search__item:last-child {
    border-bottom: 0;
}
.kb-search__item:hover,
.kb-search__item.is-active {
    background: var(--blue50);
}

.kb-search__item-title {
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    color: var(--black900);
}
.kb-search__item.is-active .kb-search__item-title,
.kb-search__item:hover .kb-search__item-title {
    color: var(--blue700);
}

.kb-search__item-excerpt {
    font-family: var(--font_inter);
    font-size: 13px;
    line-height: 1.45;
    color: var(--black600);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.kb-search__item-cat {
    margin-top: 2px;
    font-family: var(--font_inter);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--blue500);
}

.kb-search__empty {
    padding: 18px;
    font-family: var(--font_inter);
    font-size: 14px;
    line-height: 1.5;
    color: var(--black600);
    text-align: center;
}
.kb-search__empty strong {
    color: var(--black900);
}

.kb-search__dropdown-footer {
    border-top: 1px solid var(--black200);
    padding: 0;
    background: var(--black50);
}
.kb-search__dropdown-footer[hidden] {
    display: none;
}

.kb-search__see-all {
    display: block;
    padding: 12px 18px;
    text-align: center;
    font-family: var(--font_inter);
    font-weight: 600;
    font-size: 14px;
    color: var(--blue500);
    text-decoration: none;
    transition: background 0.1s ease, color 0.1s ease;
}
.kb-search__see-all:hover {
    background: var(--blue50);
    color: var(--blue600);
}

/* ===== Результаты поиска (старая страница поиска) ===== */
.kb-search-results__head {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--black200);
}

.kb-search-results__title {
    margin: 0 0 6px;
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    color: var(--black900);
}
.kb-search-results__title strong {
    color: var(--blue600);
}

.kb-search-results__query {
    margin: 0;
    font-family: var(--font_inter);
    font-size: 14px;
    color: var(--black600);
}

.kb-search-results__list {
    margin-top: 8px;
}

.kb-search-results mark,
.kb-section__link-title mark,
.kb-section__link-excerpt mark {
    background: var(--yellow100);
    color: var(--black900);
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== Общий лейаут: сайдбар + контент ===== */
.kb-layout {
    display: block;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.kb-layout_with-sidebar {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin: 0 auto 130px;
}

.kb-main {
    min-width: 0;
}

/* ===== Сайдбар ===== */
.kb-sidebar__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    margin-bottom: 4px;
    border: 0;
    border-radius: 8px;
    background: var(--black50);
    color: var(--black900);
    cursor: pointer;
    transition: background 0.15s ease;
}
.kb-sidebar__close:hover {
    background: var(--black100);
}
.kb-sidebar {
    position: sticky;
    top: calc(var(--kb-header-offset, 0px) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--kb-header-offset, 0px) - 32px);
    overflow-y: auto;
    border-right: 1px solid var(--black200);
    padding-right: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--black200) transparent;
}

.kb-sidebar::-webkit-scrollbar {
    width: 6px;
}
.kb-sidebar::-webkit-scrollbar-thumb {
    background: var(--black200);
    border-radius: 4px;
}

.kb-sidebar__root {
    display: block;
    padding: 12px 0;
    border-radius: 12px;
    color: var(--black900);
    text-decoration: none;
    font-family: var(--font_inter);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.3;
    transition: color 0.15s ease;
}

.kb-sidebar__nav {
    display: flex;
    flex-direction: column;
}

.kb-sidebar__group {
    border-radius: 12px;
}

.kb-sidebar__group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    color: var(--black900);
    font-family: var(--font_inter);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.15s ease;
    text-align: left;
}
.kb-sidebar__group-toggle_active {
    color: var(--black900);
}

.kb-sidebar__group-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-sidebar__group-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--black900);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.kb-sidebar__group-arrow svg {
    width: 24px;
    height: 24px;
}
.kb-sidebar__group_open .kb-sidebar__group-arrow {
    transform: rotate(180deg);
}

.kb-sidebar__items {
    list-style: none;
    margin: 2px 0 8px;
    padding: 0;
    display: none;
}
.kb-sidebar__group_open > .kb-sidebar__items {
    display: block;
}

.kb-sidebar__item {
    margin: 0;
}

.kb-sidebar__link {
    display: block;
    padding: 12px;
    border-radius: 12px;
    color: var(--black700);
    text-decoration: none;
    font-family: var(--font_inter);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease, font-weight 0.15s ease;
}
.kb-sidebar__link:hover {
    background: var(--black50);
    color: var(--black900);
    font-weight: 500;
}

.kb-sidebar__item_active > .kb-sidebar__link {
    background: var(--black50);
    color: var(--black900);
}

/* ===== Оглавление статьи ===== */
.kb-article-wrap {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}
.kb-article-main {
    flex: 1;
    min-width: 0;
}
.kb-toc {
    width: 160px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--kb-header-offset, 0px) + 24px);
    max-height: calc(100vh - var(--kb-header-offset, 0px) - 48px);
    overflow-y: auto;
    border-left: 1px solid var(--black200);
    display: flex;
    flex-direction: column;
    font-family: var(--font_inter);
    scrollbar-width: thin;
}
.kb-toc__link {
    display: flex;
    align-items: center;
    min-height: 50px;
    box-sizing: border-box;
    padding: 8px 12px 8px 16px;
    border-left: 2px solid transparent;
    color: var(--black500);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.5;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.kb-toc__text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.5;
}
.kb-toc__link:hover {
    color: var(--black700);
}
.kb-toc__link_active {
    border-left-color: var(--blue400);
    color: var(--blue400);
}

/* ===== Хлебные крошки в статье ===== */
.kb-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    font-family: var(--font_inter);
    font-size: 14px;
    font-weight: 500;
    color: var(--black700);
}
.kb-breadcrumbs a {
    color: var(--black700);
    text-decoration: none;
    transition: color 0.15s ease;
}
.kb-breadcrumbs a:hover {
    color: var(--black900);
}
.kb-breadcrumbs a:active {
    color: var(--black350);
}
.kb-breadcrumbs__sep {
    color: var(--black350);
    font-size: 13px;
    line-height: 1.2;
}
.kb-breadcrumbs__current {
    color: var(--black350);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Главная страница (default.htm): карточки тем ===== */
.kb-index .kb-sidebar-toggle {
    margin-left: 0;
    margin-bottom: 24px;
}

.kb-topics__title {
    margin: 0 0 24px;
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 32px;
    line-height: 1.2;
    color: var(--black900);
    text-wrap: balance;
}

.kb-topics__grid {
    display: grid;
    grid-template-columns: repeat(3, 270px);
    justify-content: center;
    gap: 16px;
}

.kb-topics__card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 270px;
    box-sizing: border-box;
    padding: 24px;
    background: var(--black50);
    border: 1px solid transparent;
    border-radius: 24px;
    text-decoration: none;
    color: var(--black900);
    transition: border-color 0.15s ease;
}
.kb-topics__card:hover {
    border-color: var(--black300);
}

.kb-topics__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--blue400);
    flex-shrink: 0;
}
.kb-topics__icon svg {
    width: 32px;
    height: 32px;
}

.kb-topics__label {
    font-family: var(--font_golos_text);
    font-weight: 500;
    font-size: 20px;
    line-height: 1.3;
    color: var(--black900);
}

/* ===== Страница категории (?category=...) ===== */
.kb-category__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.kb-category__title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.kb-category__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.kb-category__icon svg {
    width: 32px;
    height: 32px;
}

.kb-category__title {
    margin: 0;
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.3;
    color: var(--black900);
    text-wrap: balance;
    white-space: nowrap;
}

.kb-category__list {
    display: block;
    margin: 0;
}

.kb-category__list .kb-section__item {
    margin: 0;
}

.kb-category__list .kb-section__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 12px;
    background: var(--white0);
    border: 0;
    border-bottom: 1px solid var(--black200);
    border-radius: 0;
    text-decoration: none;
    color: var(--black700);
    transition: color 0.15s ease;
    height: auto;
}
.kb-category__list .kb-section__link:hover {
    background: var(--white0);
    border-bottom-color: var(--black200);
}
.kb-category__list .kb-section__link-title {
    font-family: var(--font_inter);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--black700);
}
.kb-category__list .kb-section__link:hover .kb-section__link-title {
    color: var(--blue400);
}

.kb-category__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}

.kb-category__all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font_inter);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.3;
    color: var(--blue400);
    text-decoration: none;
    white-space: nowrap;
}
.kb-category__all:hover {
    color: var(--blue600);
}

.kb-category__count {
    margin: 0;
    font-family: var(--font_inter);
    font-size: 14px;
    color: var(--black700);
}

.kb-category__pages {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kb-category__pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-category__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--black700);
    text-decoration: none;
    transition: color 0.15s ease;
}
.kb-category__page:hover {
    color: var(--blue400);
}
.kb-category__page svg {
    width: 20px;
    height: 20px;
}
.kb-category__page_disabled {
    color: var(--black300);
    pointer-events: none;
}

.kb-section {
    margin-bottom: 48px;
}

.kb-section__head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--black200);
}

.kb-section__title {
    margin: 0;
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    color: var(--black900);
    text-wrap: balance;
}

.kb-section__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.kb-section__item {
    margin: 0;
}

.kb-section__link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    background: var(--black50);
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    color: var(--black800);
    transition: background 0.15s ease, border-color 0.15s ease;
    height: 100%;
    box-sizing: border-box;
}
.kb-section__link:hover {
    background: var(--blue50);
    border-color: var(--blue50);
}

.kb-section__link-title {
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    color: var(--black900);
}
.kb-section__link:hover .kb-section__link-title {
    color: var(--blue400);
}

.kb-section__link-excerpt {
    font-family: var(--font_inter);
    font-size: 14px;
    line-height: 1.5;
    color: var(--black600);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ===== Статья (item.htm) ===== */
.saby-article {
    max-width: 100%;
}

.saby-article-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.saby-article-header h1 {
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 16px;
    color: var(--black900);
    text-wrap: balance;
}

.saby-article-header .saby-article-excerpt {
    font-family: var(--font_inter);
    font-size: 16px;
    line-height: 1.6;
    color: var(--black700);
    margin: 0 0 20px;
}

.saby-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--black500);
    font-family: var(--font_inter);
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--black200);
}

/* Кнопка "Разделы" — видна только на мобильных */
.kb-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 6px 12px;
    background: var(--black50);
    border: 1px solid var(--black200);
    border-radius: 999px;
    color: var(--black700);
    font-family: var(--font_inter);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.kb-sidebar-toggle:hover {
    background: var(--blue50);
    border-color: var(--blue200);
    color: var(--blue600);
}

/* ===== Контент статьи ===== */
.saby-article-content {
    font-family: var(--font_inter);
    font-size: 16px;
    line-height: 1.6;
    color: var(--black700);
}

.saby-article-content h2 {
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.3;
    margin: 20px 0 20px;
    padding: 0 0 20px;
    color: var(--black900);
    text-wrap: balance;
    scroll-margin-top: calc(var(--kb-header-offset, 0px) + 24px);
}

.saby-article-content h2:first-child {
    margin-top: 24px;
}

.saby-article-content h3 {
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 19px;
    line-height: 1.3;
    margin: 36px 0 12px;
    color: var(--black900);
    scroll-margin-top: calc(var(--kb-header-offset, 0px) + 24px);
}

.saby-article-content h4 {
    font-family: var(--font_golos_text);
    font-weight: 500;
    font-size: 17px;
    line-height: 1.3;
    margin: 28px 0 8px;
    color: var(--black800);
}

.saby-article-content p {
    margin: 0 0 16px;
}

.saby-article-content strong {
    color: var(--black900);
    font-weight: 600;
}

.saby-article-content ul,
.saby-article-content ol {
    margin: 0 0 20px;
    padding-left: 28px;
}

.saby-article-content ul {
    list-style: disc;
}

.saby-article-content ol {
    list-style: decimal;
}

.saby-article-content ul li,
.saby-article-content ol li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.saby-article-content ul li::marker,
.saby-article-content ol li::marker {
    color: var(--blue400);
}

.saby-article-content a {
    color: var(--blue400);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
.saby-article-content a:hover {
    color: var(--blue600);
}

.saby-article-content blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--blue300);
    background: var(--blue50);
    color: var(--black800);
    border-radius: 0 12px 12px 0;
    font-style: normal;
}
.saby-article-content blockquote p:last-child {
    margin-bottom: 0;
}

.saby-article-content pre {
    background: var(--black900);
    color: var(--white0);
    padding: 18px 22px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.55;
    margin: 24px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.saby-article-content code {
    background: var(--black100);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.92em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--black900);
}
.saby-article-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

.saby-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 15px;
    background: var(--white0);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--black200);
}
.saby-article-content th,
.saby-article-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--black200);
    text-align: left;
    vertical-align: top;
}
.saby-article-content th {
    background: var(--black50);
    font-weight: 600;
    color: var(--black900);
    font-size: 14px;
}
.saby-article-content tr:last-child td {
    border-bottom: 0;
}

.saby-article-content img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
    margin: 16px 0;
}

.saby-article-content figure {
    margin: 32px 0;
    text-align: center;
}
.saby-article-content figure img {
    border: 1px solid var(--black200);
    border-radius: 12px;
}
.saby-article-content figure figcaption {
    margin-top: 10px;
    color: var(--black500);
    font-size: 14px;
    line-height: 1.4;
    font-family: var(--font_inter);
}

/* Кнопка/ссылка в конце статьи (callout CTA) */
.saby-article-content .cta,
.saby-article-content a.button-blue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 12px 22px;
    background: var(--blue500);
    color: var(--white0);
    border-radius: 10px;
    text-decoration: none;
    font-family: var(--font_inter);
    font-weight: 600;
    font-size: 15px;
    transition: background 0.15s ease, transform 0.15s ease;
}
.saby-article-content .cta:hover,
.saby-article-content a.button-blue:hover {
    background: var(--blue600);
    color: var(--white0);
    transform: translateY(-1px);
}

/* Подвал статьи: ссылка "Все статьи" */
.kb-article-nav {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--black200);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.kb-article-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue500);
    text-decoration: none;
    font-family: var(--font_inter);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.15s ease, gap 0.15s ease;
}
.kb-article-nav__back:hover {
    color: var(--blue600);
    gap: 10px;
}

/* ===== Пустые состояния ===== */
.kb-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--black500);
    font-family: var(--font_inter);
}
.kb-empty h2 {
    font-family: var(--font_golos_text);
    font-weight: 600;
    font-size: 22px;
    color: var(--black800);
    margin: 0 0 12px;
}
.kb-empty p {
    margin: 0 0 8px;
}
.kb-empty a {
    color: var(--blue400);
    text-decoration: underline;
    font-weight: 500;
}
.kb-empty a:hover {
    color: var(--blue600);
}

.saby-no-articles,
.saby-no-article {
    text-align: center;
    padding: 80px 20px;
    color: var(--black500);
    font-family: var(--font_inter);
}
.saby-no-article a {
    color: var(--blue400);
    text-decoration: underline;
    font-weight: 500;
}
.saby-no-article a:hover {
    color: var(--blue600);
}

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .kb-layout_with-sidebar {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .kb-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, 90vw);
        max-height: none;
        background: var(--white0);
        z-index: 1000;
        padding: 16px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        border-right: 1px solid var(--black200);
    }
    .kb-layout_sidebar-open .kb-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 6, 26, 0.12);
    }

    /* Подложка под мобильное меню */
    .kb-layout_sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 6, 26, 0.45);
        z-index: 999;
    }

    .kb-sidebar-toggle {
        display: inline-flex;
    }

    .kb-sidebar__close {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .kb-search {
        flex-wrap: wrap;
    }
    .kb-search__submit {
        width: 100%;
        padding: 12px 0;
    }
    .kb-search__dropdown {
        right: 0;
        left: 0;
    }
    .kb-search-results__title {
        font-size: 19px;
    }
    .saby-article-header h1 {
        font-size: 26px;
    }
    .saby-article-header .saby-article-excerpt {
        font-size: 16px;
    }
    .saby-article-content {
        font-size: 15px;
    }
    .saby-article-content h2 {
        font-size: 21px;
        margin-top: 20px;
    }
    .saby-article-content h3 {
        font-size: 17px;
    }
    .saby-article-content table {
        font-size: 14px;
    }
    .saby-article-content th,
    .saby-article-content td {
        padding: 8px 10px;
    }
    .kb-section__title {
        font-size: 19px;
    }
    .kb-section__list {
        grid-template-columns: 1fr;
    }
    .kb-topics__title {
        font-size: 24px;
    }
    .kb-topics__grid {
        grid-template-columns: 1fr;
    }
    .kb-category__title {
        font-size: 24px;
    }
}

@media (max-width: 900px) and (min-width: 641px) {
    .kb-topics__grid {
        grid-template-columns: repeat(2, 270px);
    }
}

@media (max-width: 600px) {
    .kb-toc {
        display: none;
    }
}

/* ===== Верхняя полоса страницы (по макету) ===== */
.kb-topbar {
    background: var(--white0);
    border-bottom: 1px solid var(--black200);
    padding: 16px 0;
    margin-bottom: 48px;
}
.kb-topbar__inner {
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}
.kb-topbar__title {
    font-family: var(--font_golos_text);
    font-weight: 500;
    font-size: 20px;
    line-height: 1.3;
    color: var(--black900);
    margin: 0;
    width: 256px;
    flex-shrink: 0;
}
.kb-topbar__search {
    flex: 1;
    min-width: 0;
}

.kb-topbar__search .kb-search {
    margin: 0;
}
.kb-topbar__search .kb-search__field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white0);
    border: 1px solid var(--black300);
    border-radius: 12px;
    padding: 16px 12px;
}
.kb-topbar__search .kb-search__field:focus-within {
    border-color: var(--blue400);
    box-shadow: none;
}
.kb-topbar__search .kb-search__icon {
    position: static;
    transform: none;
    color: var(--black400);
}
.kb-topbar__search .kb-search__icon svg {
    width: 24px;
    height: 24px;
}
.kb-topbar__search .kb-search__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    font-family: var(--font_inter);
    font-size: 20px;
    line-height: 1.2;
    color: var(--black900);
    outline: none;
}
.kb-topbar__search .kb-search__input::placeholder {
    position: relative;
    top: 2px;
    color: var(--black350);
}
.kb-topbar__search .kb-search__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    background: var(--black50);
    border-radius: 8px;
    color: var(--black900);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.kb-topbar__search .kb-search__clear:hover {
    background: var(--black100);
}
.kb-topbar__search .kb-search__clear[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .kb-topbar {
        margin-bottom: 32px;
    }
    .kb-topbar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .kb-topbar__title {
        width: auto;
    }
}