.help-hub-page {
    --help-bg: #f4f6fa;
    --help-surface: #fafbfe;
    --help-surface-muted: #eef1f6;
    --help-text: #151b2b;
    --help-muted: #71809a;
    --help-line: #dfe4ed;
    --help-accent: #ef233c;
    --help-shadow: 0 12px 28px rgba(24, 34, 52, 0.08);
    background: var(--help-bg);
}

.theme-dark .help-hub-page {
    --help-bg: #121620;
    --help-surface: #202635;
    --help-surface-muted: #282f40;
    --help-text: #e8e8e8;
    --help-muted: #a8b1c4;
    --help-line: #363e50;
    --help-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.help-hub-content {
    padding-top: 22px;
    padding-bottom: 64px;
    color: var(--help-text);
}

.help-hub-content *,
.help-hub-content *::before,
.help-hub-content *::after {
    box-sizing: border-box;
    letter-spacing: 0;
}

.help-hub-content a {
    text-decoration: none;
}

.help-hub {
    min-width: 0;
}

.help-hub__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
    padding: 16px 24px;
    border: 0;
    border-radius: 20px;
    background: var(--help-surface);
    color: var(--help-text);
    box-shadow: var(--help-shadow);
}

.help-hub__intro h1 {
    margin: 3px 0 0;
    color: var(--help-text);
    font-size: 29px;
    line-height: 1.15;
}

.help-hub__eyebrow {
    color: var(--help-accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.help-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.help-search__icon {
    position: absolute;
    left: 18px;
    width: 16px;
    height: 16px;
    border: 2px solid #8d98ac;
    border-radius: 50%;
    pointer-events: none;
}

.help-search__icon::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 2px;
    background: #8d98ac;
    transform: rotate(45deg);
}

.help-search input {
    width: 100%;
    height: 44px;
    padding: 0 18px 0 48px;
    border: 1px solid var(--help-line);
    border-radius: 12px;
    outline: 0;
    background: var(--help-surface-muted);
    color: var(--help-text);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-search input:focus {
    border-color: var(--help-accent);
    box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.13);
}

.help-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.help-section-heading h2 {
    margin: 3px 0 0;
    color: var(--help-text);
    font-size: 24px;
    line-height: 1.25;
}

.help-search-result {
    flex: 0 0 auto;
    color: var(--help-muted);
    font-size: 13px;
}

.help-search-result b {
    color: var(--help-text);
}

.help-categories {
    margin-bottom: 34px;
}

.help-categories__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.help-category {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    min-height: 76px;
    padding: 13px;
    border: 0;
    border-radius: 16px;
    background: var(--help-surface);
    color: var(--help-text);
    box-shadow: 0 6px 18px rgba(24, 34, 52, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.help-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(24, 34, 52, 0.1);
}

.help-category__image {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: var(--help-surface-muted);
    color: var(--help-accent);
    font-weight: 700;
}

.help-category__image img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.help-category > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.help-category strong {
    overflow: hidden;
    color: var(--help-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.help-category small {
    margin-top: 4px;
    color: var(--help-muted);
}

.help-current-feed {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    margin-bottom: 0;
}

.help-current-feed .knowledge-content__box {
    width: auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    background: var(--help-surface);
    color: var(--help-text);
}

.help-current-feed .knowledge-content__box-envelope {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 1040 / 458;
    overflow: hidden;
}

.help-current-feed .knowledge-content__box-envelope img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .help-current-feed .knowledge-content__box:hover .knowledge-content__box-envelope img {
        transform: scale(1.025);
    }
}

.help-current-feed .knowledge-content__box[hidden] {
    display: none;
}

.knowledge-content__box--category .knowledge-box__down {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--help-line);
}

.knowledge-content__box--category .knowledge-box__info {
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 8px 5px 6px;
    border-radius: 9px;
    background: var(--help-surface-muted);
    color: var(--help-muted);
    font-size: 13px;
    line-height: 18px;
    white-space: nowrap;
}

.knowledge-content__box--category .knowledge-box__meta-label {
    display: none;
}

.knowledge-content__box--category .knowledge-box__info .icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
}

.knowledge-content__box--category .knowledge-box__info--category a {
    color: var(--help-muted);
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .knowledge-content__box--category .knowledge-box__info--category:hover,
    .knowledge-content__box--category .knowledge-box__info--category:hover a {
        color: var(--help-accent);
    }
}

.help-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.help-load-more {
    display: inline-flex;
    align-items: center;
}

.help-load-more[hidden],
.help-load-more-wrap:has(.help-load-more[hidden]) {
    display: none;
}

.help-empty[hidden] {
    display: none !important;
}

.help-empty {
    margin-top: 20px;
    padding: 34px;
    text-align: center;
    border: 1px dashed var(--help-line);
    border-radius: 8px;
    background: var(--help-surface);
}

.help-empty strong,
.help-empty span {
    display: block;
}

.help-empty span {
    margin-top: 5px;
    color: var(--help-muted);
}

.help-hub__header--category {
    margin-bottom: 28px;
}

.help-hub__back {
    display: inline-flex;
    align-items: center;
    color: var(--help-accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.help-hub__back::before {
    content: '';
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(45deg);
}

.help-hub__description {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--help-muted);
    font-size: 14px;
    line-height: 1.55;
}

.help-hub__description > :first-child {
    margin-top: 0;
}

.help-hub__description > :last-child {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .help-hub__header {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
        gap: 24px;
    }

    .help-categories__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .help-current-feed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 820px) {
    .help-hub-content {
        padding-top: 14px;
    }

    .help-hub__header {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 16px;
        padding: 20px;
    }

    .help-categories__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 560px) {
    .help-hub-content {
        padding-bottom: 40px;
    }

    .help-hub__header {
        gap: 14px;
        margin-bottom: 20px;
        padding: 16px;
        border-radius: 16px;
    }

    .help-hub__intro h1 {
        font-size: 25px;
    }

    .help-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .help-section-heading h2 {
        font-size: 21px;
    }

    .help-categories__grid,
    .help-current-feed {
        grid-template-columns: 1fr;
    }

    .knowledge-content__box--category .knowledge-box__down {
        gap: 7px;
    }

    .knowledge-content__box--category .knowledge-box__info {
        padding-right: 7px;
        font-size: 12px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .help-category,
    .help-current-feed .knowledge-content__box-envelope img,
    .help-load-more {
        transition: none;
    }
}

/* Поиск: кнопка сброса */
.help-search input {
    padding-right: 44px;
}

.help-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.help-search__clear {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--help-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.help-search__clear::before,
.help-search__clear::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

.help-search__clear::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.help-search__clear::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.help-search__clear[hidden] {
    display: none;
}

.help-search__clear:focus-visible {
    outline: 2px solid var(--help-accent);
    outline-offset: 1px;
}

/* Поиск: лоадер поверх поля справа (общий паттерн product-load + icon-loader) */
.help-search.product-load.loader {
    background: transparent;
    cursor: auto;
}

.help-search.product-load .icon-loader {
    background: transparent;
    border-radius: 12px;
}

.help-search.product-load .icon-loader::before {
    box-sizing: border-box;
    right: 15px;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-width: 2px;
    border-top-color: var(--help-accent);
}

/* Пока идёт поиск, лоадер занимает место кнопки сброса */
.help-search.loader .help-search__clear {
    visibility: hidden;
}

/* Состояния ленты: загрузка, ошибка */
.help-current-feed[aria-busy='true'] {
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.help-error {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 20px;
    border: 1px solid var(--help-accent);
    border-radius: 8px;
    background: var(--help-surface);
    color: var(--help-text);
}

.help-error[hidden] {
    display: none;
}

.help-error__retry {
    padding: 8px 16px;
    border: 1px solid var(--help-line);
    border-radius: 10px;
    background: var(--help-surface-muted);
    color: var(--help-text);
    cursor: pointer;
}

/* Серверный пагинатор под кнопкой «Показать ещё» */
.help-pagination {
    margin-top: 22px;
}

.help-pagination[hidden] {
    display: none;
}

.help-pagination .paginator {
    justify-content: center;
}
