:root {
    --kb-black: #000000;
    --kb-white: #ffffff;
    --kb-orange: #ff6a00;
    --kb-orange-soft: rgba(255, 106, 0, 0.15);
    --kb-gray-950: #0a0a0a;
    --kb-gray-900: #111111;
    --kb-gray-800: #1a1a1a;
    --kb-gray-700: #242424;
    --kb-gray-500: #8a8a8a;
    --kb-radius-xl: 24px;
    --kb-radius-lg: 18px;
    --kb-radius-md: 14px;
    --kb-shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
    --kb-shadow-hover: 0 16px 38px rgba(0, 0, 0, 0.45);
}

.kb-page {
    background: radial-gradient(1000px 500px at 85% -80px, rgba(255, 106, 0, 0.25), transparent 60%), var(--kb-black);
    color: var(--kb-white);
}

.kb-main {
    padding-bottom: 64px;
}

.kb-hero {
    padding: 56px 0 34px;
}

.kb-hero-compact {
    padding: 26px 0 20px;
}

.kb-hero-compact .kb-hero-visual {
    grid-template-rows: 1fr;
}

.kb-hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: stretch;
}

.kb-hero-content {
    background: linear-gradient(155deg, #121212, #0b0b0b);
    border: 1px solid #222;
    border-radius: var(--kb-radius-xl);
    padding: 38px;
    box-shadow: var(--kb-shadow-soft);
}

.kb-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #2b2b2b;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d8d8d8;
    margin: 0 0 18px;
}

.kb-kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kb-orange);
    box-shadow: 0 0 0 6px rgba(255, 106, 0, 0.18);
}

.kb-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.kb-hero-subtitle {
    margin: 16px 0 0;
    color: #c9c9c9;
    max-width: 670px;
    font-size: 1.08rem;
    line-height: 1.6;
}

.kb-search-wrap {
    margin-top: 28px;
    position: relative;
}

.kb-search {
    width: 100%;
    border: 1px solid #2b2b2b;
    background: #0d0d0d;
    color: #fff;
    border-radius: 14px;
    padding: 16px 18px 16px 54px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kb-search::placeholder {
    color: #8d8d8d;
}

.kb-search:focus {
    outline: none;
    border-color: var(--kb-orange);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.18);
}

.kb-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.8;
}

.kb-hero-visual {
    background: linear-gradient(140deg, #181818, #0e0e0e);
    border: 1px solid #262626;
    border-radius: var(--kb-radius-xl);
    padding: 22px;
    box-shadow: var(--kb-shadow-soft);
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 18px;
}

.kb-hero-illustration {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: radial-gradient(500px 260px at 20% 20%, rgba(255, 106, 0, 0.2), transparent 65%), #101010;
    border: 1px solid #232323;
    min-height: 260px;
    display: grid;
    place-items: center;
}

.kb-hero-illustration img {
    width: min(85%, 360px);
    object-fit: contain;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45));
}

.kb-hero-illustration img.kb-hero-img-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

.kb-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kb-stat {
    background: #101010;
    border: 1px solid #222;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
}

.kb-stat strong {
    display: block;
    color: var(--kb-orange);
    font-size: 1.15rem;
}

.kb-stat span {
    color: #b9b9b9;
    font-size: 0.85rem;
}

.kb-section {
    padding-top: 24px;
}

.kb-section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.kb-section h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    line-height: 1.2;
}

#kbCategoriesSection .kb-section-head h2 {
    color: var(--kb-orange);
}

.kb-muted {
    color: #a5a5a5;
    margin: 0;
    line-height: 1.5;
}

.kb-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kb-category-card {
    border: 1px solid #242424;
    background: linear-gradient(160deg, #131313, #0b0b0b);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-align: left;
    color: inherit;
    text-decoration: none;
}

.kb-category-card:hover,
.kb-category-card.is-active {
    transform: translateY(-3px);
    border-color: rgba(255, 106, 0, 0.8);
    box-shadow: 0 10px 28px rgba(255, 106, 0, 0.18);
}

.kb-category-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kb-category-icon {
    font-size: 1.25rem;
}

.kb-category-count {
    font-size: 0.85rem;
    border-radius: 999px;
    background: #1d1d1d;
    border: 1px solid #2a2a2a;
    padding: 4px 8px;
    color: #d6d6d6;
}

.kb-category-title {
    margin: 0;
    font-size: 1rem;
}

.kb-category-desc {
    margin: 0;
    color: #a5a5a5;
    font-size: 0.88rem;
    line-height: 1.5;
}

.kb-layout {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
}

.kb-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.kb-card {
    background: linear-gradient(170deg, #141414, #0d0d0d);
    border: 1px solid #232323;
    border-radius: var(--kb-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.kb-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 106, 0, 0.8);
    box-shadow: var(--kb-shadow-hover);
}

.kb-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0b0b0b;
}

.kb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.kb-card:hover .kb-card-image img {
    transform: scale(1.05);
}

.kb-card-image-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(120% 90% at 20% 15%, rgba(96, 116, 148, 0.55), transparent 60%),
        radial-gradient(110% 100% at 85% 80%, rgba(58, 74, 96, 0.5), transparent 65%),
        linear-gradient(135deg, #182028, #232e3a 55%, #1a222c);
    filter: blur(14px);
    transform: scale(1.15);
}

html.light-theme .kb-card-image-placeholder {
    background:
        radial-gradient(120% 90% at 20% 15%, rgba(203, 213, 225, 0.9), transparent 60%),
        radial-gradient(110% 100% at 85% 80%, rgba(148, 163, 184, 0.7), transparent 65%),
        linear-gradient(135deg, #eef1f5, #dde3ea 55%, #e8ecf1);
}

.kb-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.kb-card-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #d8d8d8;
}

.kb-card-category i {
    color: var(--kb-orange);
}

.kb-card-title {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.4;
}

.kb-card-title a {
    color: inherit;
    text-decoration: none;
}

.kb-card-title a:hover {
    color: var(--kb-orange);
    text-decoration: none;
}

.kb-card-excerpt {
    margin: 0;
    color: #b6b6b6;
    line-height: 1.5;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #8d8d8d;
    font-size: 0.8rem;
}

.kb-read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 106, 0, 0.45);
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    font-size: 0.85rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.kb-read-btn:hover {
    background: var(--kb-orange);
    color: #000;
}

.kb-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.kb-filter-chip {
    border: 1px solid #2a2a2a;
    background: #101010;
    color: #d7d7d7;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kb-filter-chip:hover,
.kb-filter-chip.is-active {
    border-color: var(--kb-orange);
    color: #fff;
    background: rgba(255, 106, 0, 0.15);
}

.kb-show-more {
    margin-top: 16px;
    border: 1px solid #313131;
    border-radius: 12px;
    background: #121212;
    color: #fff;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kb-show-more:hover {
    border-color: var(--kb-orange);
    background: rgba(255, 106, 0, 0.12);
}

.kb-sidebar {
    display: grid;
    gap: 12px;
    align-content: start;
}

.kb-side-card {
    border: 1px solid #242424;
    background: #0f0f0f;
    border-radius: 16px;
    padding: 14px;
}

.kb-side-card h3 {
    margin: 0 0 12px;
    font-size: 0.98rem;
}

.kb-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.kb-side-list a {
    color: #d8d8d8;
    text-decoration: none;
    line-height: 1.4;
    font-size: 0.9rem;
}

.kb-side-list a:hover {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--kb-orange);
}

.kb-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kb-tag {
    color: #e2e2e2;
    text-decoration: none;
    border: 1px solid #303030;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.kb-tag:hover {
    border-color: var(--kb-orange);
    background: rgba(255, 106, 0, 0.12);
}

.kb-empty {
    border: 1px dashed #323232;
    border-radius: 16px;
    background: #0d0d0d;
    color: #aeaeae;
    padding: 18px;
}

.kb-article-main {
    padding-top: 30px;
}

.kb-breadcrumbs {
    margin-bottom: 14px;
    color: #9d9d9d;
    font-size: 0.88rem;
}

.kb-breadcrumbs a {
    color: #c9c9c9;
    text-decoration: none;
}

.kb-breadcrumbs a:hover {
    color: #fff;
}

.kb-article-hero {
    background: linear-gradient(160deg, #131313, #0a0a0a);
    border: 1px solid #252525;
    border-radius: var(--kb-radius-xl);
    padding: 30px;
    box-shadow: var(--kb-shadow-soft);
}

.kb-article-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.12;
    text-align: left;
}

.kb-article-title-main,
.kb-article-title-sub {
    display: block;
}

.kb-article-title-main {
    color: var(--kb-orange);
}

.kb-article-title-sub {
    margin-top: 8px;
    color: inherit;
}

.kb-article-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #adadad;
    font-size: 0.9rem;
}

.kb-article-cover {
    margin: 20px 0 0;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 8;
}

.kb-article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kb-article-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.kb-toc {
    position: -webkit-sticky;
    position: sticky;
    top: 170px;
    border: 1px solid #252525;
    border-radius: 16px;
    background: #0f0f0f;
    padding: 10px;
    align-self: start;
    max-height: calc(100vh - 190px);
    overflow: auto;
}

.kb-toc h2 {
    margin: 0 0 6px;
    font-size: 0.82rem;
}

.kb-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.kb-toc a {
    color: #c5c5c5;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.35;
}

.kb-toc a:hover {
    color: #fff;
}

.kb-toc .kb-toc-level-h3 {
    padding-left: 12px;
    color: #979797;
}

.kb-article-content {
    border: 1px solid #242424;
    background: #111111;
    border-radius: 16px;
    padding: 28px;
    color: #ececec;
    font-size: 1.05rem;
    line-height: 1.8;
}

.kb-article-content p,
.kb-article-content ul,
.kb-article-content ol,
.kb-article-content table,
.kb-article-content blockquote {
    margin: 0 0 16px;
}

.kb-article-content h2,
.kb-article-content h3 {
    scroll-margin-top: 110px;
}

.kb-article-content h2 {
    margin: 34px 0 14px;
    font-size: 1.45rem;
    line-height: 1.3;
}

.kb-article-content h3 {
    margin: 24px 0 12px;
    font-size: 1.18rem;
    line-height: 1.35;
    color: #e4e4e4;
}

.kb-article-content ul,
.kb-article-content ol {
    padding-left: 24px;
}

.kb-article-content li {
    margin: 7px 0;
}

.kb-article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.kb-article-content th,
.kb-article-content td {
    border: 1px solid #2f2f2f;
    padding: 10px;
    text-align: left;
}

.kb-article-content th {
    background: #181818;
}

.kb-article-content blockquote {
    border-left: 4px solid var(--kb-orange);
    background: #171717;
    border-radius: 0 12px 12px 0;
    padding: 14px 16px;
    color: #dedede;
}

.kb-note {
    border-radius: 14px;
    border: 1px solid #2d2d2d;
    padding: 12px 14px;
    font-size: 0.95rem;
}

.kb-note-tip {
    background: rgba(255, 106, 0, 0.1);
    border-color: rgba(255, 106, 0, 0.4);
}

.kb-note-important {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
}

.kb-faq {
    margin-top: 24px;
    border-top: 1px solid #2a2a2a;
    padding-top: 18px;
}

.kb-faq h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.kb-faq-item {
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    background: #121212;
    margin-bottom: 10px;
    overflow: hidden;
}

.kb-faq-item summary {
    cursor: pointer;
    padding: 12px;
    font-size: 0.94rem;
}

.kb-faq-item p {
    margin: 0;
    padding: 0 12px 12px;
    color: #c7c7c7;
    font-size: 0.92rem;
}

.kb-related,
.kb-article-cta {
    margin-top: 26px;
}

.kb-article-cta-box {
    border: 1px solid #2b2b2b;
    border-radius: 20px;
    background: linear-gradient(140deg, #171717, #0f0f0f);
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.kb-article-cta-box h2 {
    margin: 0;
    font-size: 1.45rem;
}

.kb-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kb-btn-primary,
.kb-btn-outline {
    border-radius: 12px;
    padding: 12px 16px;
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.kb-btn-primary {
    background: var(--kb-orange);
    color: #000;
    border: 1px solid var(--kb-orange);
}

.kb-btn-primary:hover {
    background: #ff7d26;
}

.kb-btn-outline {
    border: 1px solid #3a3a3a;
    color: #fff;
}

.kb-btn-outline:hover {
    border-color: var(--kb-orange);
    background: rgba(255, 106, 0, 0.15);
}

.kb-reveal {
    opacity: 1;
    transform: none;
}

html.kb-js .kb-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

html.kb-js .kb-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.kb-category-main {
    padding-top: 24px;
}

.kb-category-hero {
    border: 1px solid #242424;
    background: linear-gradient(160deg, #151515, #0d0d0d);
    border-radius: var(--kb-radius-xl);
    padding: 28px;
    box-shadow: var(--kb-shadow-soft);
}

.kb-category-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.15;
}

.kb-category-hero-compact {
    padding: 18px 22px;
}

.kb-category-hero-compact h1 {
    font-size: clamp(1.4rem, 2.3vw, 2rem);
}

.kb-category-pill {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 106, 0, 0.45);
    background: rgba(255, 106, 0, 0.08);
    color: #f6f6f6;
    padding: 7px 12px;
    font-size: 0.85rem;
}

.kb-category-list-wrap {
    margin-top: 12px;
}

.kb-category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kb-topic-card {
    border: 1px solid #252525;
    background: linear-gradient(170deg, #131313, #0d0d0d);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: inherit;
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.kb-topic-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 106, 0, 0.75);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.kb-topic-index {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 106, 0, 0.2);
    border: 1px solid rgba(255, 106, 0, 0.55);
    color: #ffd8bf;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.84rem;
}

.kb-topic-body h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
    color: inherit;
    text-decoration: none;
}

.kb-topic-body p {
    margin: 8px 0 0;
    color: #a9a9a9;
    font-size: 0.88rem;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .kb-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .kb-layout,
    .kb-article-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .kb-toc {
        position: static;
    }
}

@media (max-width: 760px) {
    .kb-hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kb-hero-content,
    .kb-hero-visual,
    .kb-article-hero,
    .kb-article-content {
        padding: 20px;
    }

    .kb-categories-grid,
    .kb-cards-grid {
        grid-template-columns: 1fr;
    }

    .kb-hero-stats {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .kb-category-list {
        grid-template-columns: 1fr;
    }
}

html.light-theme .kb-page {
    background: radial-gradient(900px 420px at 90% -120px, rgba(255, 106, 0, 0.2), transparent 62%), #f7f8fa;
    color: #1a1a1a;
}

html.light-theme .kb-kicker,
html.light-theme .kb-hero-content,
html.light-theme .kb-hero-visual,
html.light-theme .kb-stat,
html.light-theme .kb-category-card,
html.light-theme .kb-card,
html.light-theme .kb-filter-chip,
html.light-theme .kb-show-more,
html.light-theme .kb-side-card,
html.light-theme .kb-empty,
html.light-theme .kb-article-hero,
html.light-theme .kb-article-content,
html.light-theme .kb-toc,
html.light-theme .kb-faq-item,
html.light-theme .kb-article-cta-box {
    background: #ffffff;
    border-color: #e4e7ec;
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}

html.light-theme .kb-hero-illustration {
    background: radial-gradient(500px 260px at 20% 20%, rgba(255, 106, 0, 0.14), transparent 65%), #f6f7f9;
    border-color: #e4e7ec;
}

html.light-theme .kb-kicker {
    color: #2f3640;
    border-color: #d7dbe2;
    background: #f7f8fa;
}

html.light-theme .kb-stat strong {
    color: #d64f00;
}

html.light-theme .kb-stat span {
    color: #3e4651;
    font-weight: 600;
}

html.light-theme .kb-card-image,
html.light-theme .kb-search,
html.light-theme .kb-category-count,
html.light-theme .kb-note-important,
html.light-theme .kb-article-content th {
    background: #f7f8fa;
    border-color: #e4e7ec;
}

html.light-theme .kb-search {
    color: #151515;
}

html.light-theme .kb-search::placeholder,
html.light-theme .kb-muted,
html.light-theme .kb-category-desc,
html.light-theme .kb-card-excerpt,
html.light-theme .kb-card-meta,
html.light-theme .kb-side-list a,
html.light-theme .kb-breadcrumbs,
html.light-theme .kb-article-meta,
html.light-theme .kb-faq-item p,
html.light-theme .kb-toc a,
html.light-theme .kb-toc .kb-toc-level-h3,
html.light-theme .kb-stat span {
    color: #5f6368;
}

html.light-theme .kb-category-count {
    color: #4b5563;
    border-color: #cfd5de;
    background: #f3f5f8;
    font-weight: 600;
}

html.light-theme .kb-hero h1,
html.light-theme .kb-section h2,
html.light-theme .kb-category-title,
html.light-theme .kb-card-title a,
html.light-theme .kb-side-card h3,
html.light-theme .kb-article-hero h1,
html.light-theme .kb-article-content,
html.light-theme .kb-faq h2,
html.light-theme .kb-breadcrumbs a,
html.light-theme .kb-toc h2,
html.light-theme .kb-article-cta-box h2 {
    color: #1a1a1a;
}

html.light-theme .kb-card-category,
html.light-theme .kb-tag,
html.light-theme .kb-btn-outline,
html.light-theme .kb-read-btn {
    color: #232323;
}

html.light-theme .kb-filter-chip:hover,
html.light-theme .kb-filter-chip.is-active,
html.light-theme .kb-tag:hover,
html.light-theme .kb-show-more:hover,
html.light-theme .kb-btn-outline:hover {
    background: rgba(255, 106, 0, 0.12);
    border-color: rgba(255, 106, 0, 0.6);
}

html.light-theme .kb-category-hero,
html.light-theme .kb-topic-card {
    background: #ffffff;
    border-color: #e4e7ec;
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}

html.light-theme .kb-category-pill {
    color: #b94a00;
    background: #fff2e9;
    border-color: #f2bf9f;
}

html.light-theme .kb-topic-index {
    color: #b94a00;
    background: #fff2e9;
    border-color: #f2bf9f;
}

html.light-theme .kb-topic-body p {
    color: #5f6368;
}

html.light-theme .kb-note-important {
    background: #fff7f1;
}

html.light-theme .kb-article-content blockquote {
    background: #fff3e8;
    color: #3f3f3f;
    border-left-color: var(--kb-orange);
}

html.light-theme .kb-btn-outline {
    border-color: #cfd4dc;
}

/* Premium article redesign */
.kb-article-main .container {
    max-width: 1320px;
}

.kb-article-main article {
    display: grid;
    gap: 42px;
}

.kb-article-hero {
    padding: 38px;
    border-radius: 24px;
    background: linear-gradient(145deg, #131313, #080808);
    border-color: #242424;
}

.kb-article-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: center;
}

.kb-article-hero-copy h1 {
    font-size: clamp(2.35rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.kb-article-hero-media {
    margin: 0;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    min-height: 0;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    background: radial-gradient(420px 200px at 10% 10%, rgba(255, 106, 0, 0.3), transparent 70%), #111111;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
    justify-self: end;
}

.kb-article-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kb-page.kb-article-hero-contain .kb-article-hero-media {
    background: #f4f5f7;
}

.kb-page.kb-article-hero-contain .kb-article-hero-media img {
    object-fit: contain;
    object-position: center;
    background: #f4f5f7;
}

.kb-author-card {
    border: 1px solid #272727;
    border-radius: 18px;
    background: linear-gradient(160deg, #141414, #0d0d0d);
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kb-author-main {
    display: grid;
    gap: 4px;
}

.kb-author-name {
    font-size: 1.08rem;
    font-weight: 700;
}

.kb-author-role {
    color: #b6b6b6;
    font-size: 0.9rem;
}

.kb-author-meta {
    color: #c4c4c4;
    font-size: 0.9rem;
}

.kb-learn-card,
.kb-checklist-card {
    border: 1px solid #262626;
    border-radius: 20px;
    padding: 24px;
    background: #121212;
}

.kb-learn-card h2,
.kb-checklist-card h2 {
    margin: 0 0 18px;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.kb-learn-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.kb-learn-item {
    border: 1px solid #2b2b2b;
    border-radius: 14px;
    background: #0f0f0f;
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.kb-learn-item i {
    color: var(--kb-orange);
    font-style: normal;
    font-weight: 700;
}

.kb-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kb-checklist li {
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    padding: 12px;
    background: #0f0f0f;
    position: relative;
    padding-left: 40px;
}

.kb-checklist li::before {
    content: "☐";
    position: absolute;
    left: 12px;
    top: 10px;
    color: var(--kb-orange);
}

.kb-article-layout {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 280px minmax(0, 860px);
    justify-content: center;
    gap: 26px;
    align-items: start;
}

.kb-article-flow {
    display: grid;
    gap: 36px;
}

.kb-toc {
    position: -webkit-sticky;
    position: sticky;
    top: 170px;
    border-radius: 18px;
    padding: 10px;
    align-self: start;
    max-height: calc(100vh - 190px);
    overflow: auto;
}

.kb-toc ul {
    counter-reset: toc;
    gap: 4px;
}

.kb-toc li {
    counter-increment: toc;
}

.kb-toc a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    line-height: 1.25;
}

.kb-toc a::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--kb-orange);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.kb-toc a:hover,
.kb-toc a.is-active {
    border-color: rgba(255, 106, 0, 0.45);
    background: rgba(255, 106, 0, 0.12);
    color: #fff;
}

.kb-toc .kb-toc-level-h3 {
    margin-left: 8px;
}

.kb-article-content {
    border-radius: 20px;
    padding: 36px 42px;
    font-size: clamp(1.15rem, 1.65vw, 1.375rem);
    line-height: 1.85;
}

.kb-article-content > * {
    max-width: 44ch;
}

.kb-article-content h2,
.kb-article-content h3,
.kb-article-content .kb-article-media,
.kb-article-content table,
.kb-article-content .kb-note,
.kb-article-content blockquote,
.kb-article-content .kb-fact-card,
.kb-article-content .kb-compare-grid,
.kb-article-content .kb-list-cards {
    max-width: none;
}

.kb-article-content p {
    margin-bottom: 28px;
}

.kb-article-content h2 {
    margin-top: 90px;
    margin-bottom: 32px;
    font-size: clamp(2rem, 2.7vw, 2.25rem);
    line-height: 1.2;
}

.kb-article-content h3 {
    margin-top: 50px;
    margin-bottom: 18px;
    font-size: clamp(1.45rem, 2vw, 1.625rem);
    line-height: 1.3;
}

.kb-article-content ul,
.kb-article-content ol {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 12px;
}

.kb-article-content li {
    margin: 0;
    border: 1px solid #2d2d2d;
    border-radius: 14px;
    background: #101010;
    padding: 14px 14px 14px 44px;
    position: relative;
}

.kb-article-content li::before {
    content: "✔";
    position: absolute;
    left: 14px;
    top: 13px;
    color: var(--kb-orange);
    font-weight: 700;
}

.kb-table-wrap {
    overflow-x: auto;
    border: 1px solid #2b2b2b;
    border-radius: 18px;
    background: #0f0f0f;
    margin-bottom: 26px;
}

.kb-article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 680px;
    margin: 0;
}

.kb-article-content th,
.kb-article-content td {
    border: 0;
    border-bottom: 1px solid #292929;
    padding: 14px 18px;
}

.kb-article-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.kb-article-content tr:hover td {
    background: rgba(255, 106, 0, 0.08);
}

.kb-note {
    border-radius: 16px;
    padding: 18px 18px 18px 20px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.kb-note-tip {
    border-left: 4px solid var(--kb-orange);
    background: #ffffff;
    color: #1b1b1b;
}

.kb-note-important {
    border-color: #f4c96f;
    background: #33280f;
}

.kb-note-error {
    border-color: #ff5d5d;
    background: #2f1212;
}

.kb-fact-card {
    border: 1px solid #2b2b2b;
    border-radius: 18px;
    background: #171717;
    padding: 18px;
    margin-bottom: 26px;
}

.kb-fact-card strong {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--kb-orange);
    line-height: 1;
    margin-bottom: 8px;
}

.kb-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.kb-compare-card {
    border: 1px solid #2e2e2e;
    border-radius: 16px;
    background: #101010;
    padding: 16px;
}

.kb-article-media {
    margin: 26px 0;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #2c2c2c;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
    min-height: 220px;
    background: linear-gradient(140deg, #121212, #0c0c0c);
}

.kb-article-media img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    display: block;
}

.kb-article-media-contain {
    background: #f5f6f8;
}

.kb-article-media-contain img {
    object-fit: contain;
    background: #f5f6f8;
    padding: 10px;
}

.kb-article-media-narrow {
    min-height: 180px;
    max-height: 260px;
}

.kb-article-media-narrow img {
    min-height: 180px;
    max-height: 260px;
    object-fit: cover;
    object-position: center;
}

.kb-figure-placeholder {
    min-height: 220px;
    display: grid;
    place-items: center;
    color: #bdbdbd;
    text-align: center;
    padding: 16px;
}

.article-image-placeholder {
    width: 100%;
    height: 220px;
    border-radius: 24px;
    background: #fafafa;
    border: 1px solid #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdbdbd;
    font-size: 34px;
    font-weight: 600;
    margin: 40px 0;
    text-align: center;
    padding: 16px;
}

.article-image-placeholder.square {
    width: 700px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 40px auto;
}

.article-image-placeholder.wide {
    width: 100%;
    max-width: 860px;
    aspect-ratio: 860 / 180;
    height: auto;
}

.kb-card .article-image-placeholder {
    margin: 0;
    border-radius: 0;
    min-height: 220px;
    height: 100%;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.kb-article-content blockquote {
    font-size: clamp(1.2rem, 2.3vw, 1.8rem);
    line-height: 1.6;
    border-left-width: 5px;
    padding: 20px 24px;
    margin: 34px 0;
}

.kb-related-grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kb-related .kb-card-image {
    aspect-ratio: 16 / 8;
}

.kb-faq {
    margin-top: 6px;
    border-top: 0;
    padding-top: 0;
}

.kb-faq-item {
    border-radius: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.kb-faq-item[open] {
    border-color: rgba(255, 106, 0, 0.45);
    background: rgba(255, 106, 0, 0.08);
}

.kb-faq-item summary {
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
}

.kb-faq-item p {
    padding: 0 16px 16px;
}

.kb-article-cta-box {
    border-radius: 24px;
    padding: 34px;
    background: linear-gradient(150deg, #0a0a0a, #161616);
}

.kb-article-cta-box h2 {
    font-size: clamp(1.8rem, 2.6vw, 2.3rem);
}

/* Compact article mode for long-form pages with reduced hero/intro footprint */
.kb-page.kb-article-compact .kb-article-main article {
    gap: 22px;
}

.kb-page.kb-article-compact .kb-article-hero {
    padding: 14px;
    border-radius: 16px;
}

.kb-page.kb-article-compact .kb-article-hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
    gap: 12px;
}

.kb-page.kb-article-compact .kb-article-hero-copy h1 {
    font-size: clamp(1.35rem, 2vw, 1.78rem);
    line-height: 1.12;
}

.kb-page.kb-article-compact .kb-hero-subtitle {
    margin-top: 8px;
    font-size: 0.86rem;
    line-height: 1.34;
}

.kb-page.kb-article-compact .kb-article-meta {
    margin-top: 8px;
    gap: 6px;
    font-size: 0.76rem;
}

.kb-page.kb-article-compact .kb-article-hero-media {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: none;
    border-radius: 14px;
}

.kb-page.kb-article-compact .kb-article-hero-media img {
    object-position: center;
}

.kb-page.kb-article-compact .kb-learn-card {
    border-radius: 16px;
    padding: 14px;
}

.kb-page.kb-article-compact .kb-learn-card h2 {
    margin: 0 0 10px;
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
}

.kb-page.kb-article-compact .kb-learn-list {
    gap: 8px;
}

.kb-page.kb-article-compact .kb-learn-item {
    border-radius: 10px;
    padding: 10px;
}

@media (max-width: 900px) {
    .kb-page.kb-article-compact .kb-article-hero {
        padding: 14px;
    }

    .kb-page.kb-article-compact .kb-article-hero-media {
        max-width: min(72vw, 260px);
        justify-self: center;
    }

    .kb-page.kb-article-compact .kb-article-main article {
        gap: 16px;
    }
}

@media (max-width: 1200px) {
    .kb-article-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .kb-toc {
        position: static;
    }
}

@media (max-width: 900px) {
    .kb-article-hero-grid,
    .kb-learn-list,
    .kb-checklist,
    .kb-compare-grid {
        grid-template-columns: 1fr;
    }

    .kb-article-content {
        padding: 22px;
        font-size: 1.08rem;
    }

    .kb-article-content h2 {
        margin-top: 58px;
        font-size: 1.7rem;
    }

    .kb-article-content h3 {
        margin-top: 34px;
        font-size: 1.35rem;
    }

    .kb-related-grid-4 {
        grid-template-columns: 1fr;
    }
}

html.light-theme .kb-author-card,
html.light-theme .kb-learn-card,
html.light-theme .kb-checklist-card,
html.light-theme .kb-checklist li,
html.light-theme .kb-learn-item,
html.light-theme .kb-article-media,
html.light-theme .kb-table-wrap,
html.light-theme .kb-fact-card,
html.light-theme .kb-compare-card {
    background: #ffffff;
    border-color: #e4e7ec;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

html.light-theme .kb-article-hero {
    background: linear-gradient(160deg, #ffffff, #f6f8fb);
}

html.light-theme .kb-article-hero-media {
    background: radial-gradient(420px 200px at 10% 10%, rgba(255, 106, 0, 0.18), transparent 70%), #f6f8fb;
    border-color: #dfe5ef;
}

html.light-theme .kb-article-content {
    color: #252525;
}

html.light-theme .kb-article-content li {
    background: #fbfcfd;
    border-color: #e4e7ec;
}

html.light-theme .kb-note-tip {
    background: #ffffff;
    color: #1f1f1f;
    border-color: #ffd2b3;
}

html.light-theme .kb-note-important {
    background: #fff9e8;
    border-color: #ffd974;
    color: #3b2f0d;
}

html.light-theme .kb-note-error {
    background: #ffecec;
    border-color: #ff9f9f;
    color: #4a1717;
}

html.light-theme .article-image-placeholder {
    background: #fafafa;
    border-color: #ececec;
    color: #bdbdbd;
}

html.light-theme .kb-toc a:hover,
html.light-theme .kb-toc a.is-active {
    color: #1a1a1a;
}

.kb-callback-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
}

.kb-callback-modal[hidden] {
    display: none;
}

.kb-callback-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 14, 0.56);
}

.kb-callback-dialog {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    border-radius: 20px;
    border: 1px solid #2b2b2b;
    background: linear-gradient(170deg, #141414, #0d0d0d);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
    padding: 26px;
    color: #f5f5f5;
}

.kb-callback-dialog h2 {
    margin: 0 0 8px;
    font-size: 1.9rem;
    line-height: 1.2;
}

.kb-callback-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 1px solid #353535;
    border-radius: 10px;
    background: #171717;
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.kb-callback-form {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.kb-callback-form input {
    width: 100%;
    border: 1px solid #343434;
    border-radius: 12px;
    background: #111111;
    color: #f4f4f4;
    padding: 14px 15px;
    font-size: 1rem;
}

.kb-callback-form input:focus {
    outline: none;
    border-color: #ff6a00;
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.22);
}

.kb-callback-form button {
    border: 1px solid #ff6a00;
    border-radius: 12px;
    padding: 13px 16px;
    background: #ff6a00;
    color: #101010;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.kb-callback-form button:hover {
    background: #ff7b1f;
}

.kb-callback-note {
    margin: 4px 0 0;
    color: #a9a9a9;
    font-size: 0.9rem;
}

html.light-theme .kb-callback-dialog {
    border-color: #e5e8ef;
    background: #ffffff;
    color: #1f1f1f;
}

html.light-theme .kb-callback-close {
    border-color: #e2e6ee;
    background: #f6f8fb;
    color: #2a2a2a;
}

html.light-theme .kb-callback-form input {
    border-color: #d9dee8;
    background: #f7f9fc;
    color: #1f1f1f;
}

html.light-theme .kb-callback-note {
    color: #606a75;
}

@media (max-width: 640px) {
    .kb-callback-dialog {
        padding: 20px;
        border-radius: 16px;
    }

    .kb-callback-dialog h2 {
        font-size: 1.5rem;
    }
}

/* Minimal long-read style for "Как выбрать умный замок" */
.kb-page.kb-article-minimal .kb-article-layout {
    grid-template-columns: minmax(0, 980px);
    justify-content: center;
    margin-top: 14px;
}

.kb-page.kb-article-minimal .kb-toc {
    display: none;
}

.kb-page.kb-article-minimal .kb-article-flow {
    gap: 30px;
}

.kb-page.kb-article-minimal .kb-article-content {
    border: 1px solid #2a3038;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    background: linear-gradient(180deg, #181c22 0%, #12161c 100%);
    border-radius: 24px;
    max-width: 980px;
    margin: 0 auto;
    padding: 34px 34px 20px;
    color: #e5e8ec;
    font-size: 20px;
    line-height: 1.75;
}

.kb-page.kb-article-minimal .kb-article-content > * {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.kb-page.kb-article-minimal .kb-article-content p {
    margin-bottom: 20px;
    color: #d7dbe1;
}

.kb-page.kb-article-minimal .kb-article-content h2,
.kb-page.kb-article-minimal .kb-article-content h3 {
    color: #f4f6f8;
    letter-spacing: -0.01em;
}

.kb-page.kb-article-minimal .kb-article-content h2 {
    font-size: 38px;
    font-weight: 700;
    margin-top: 72px;
    margin-bottom: 28px;
    line-height: 1.2;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 106, 0, 0.3);
}

.kb-page.kb-article-minimal .kb-article-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 18px;
    line-height: 1.3;
    color: #dbe2ec;
}

.kb-page.kb-article-minimal .kb-article-content ul,
.kb-page.kb-article-minimal .kb-article-content ol {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.kb-page.kb-article-minimal .kb-article-content li {
    border: 1px solid #2b313a;
    background: #171b21;
    border-radius: 16px;
    padding: 18px 18px 18px 56px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    margin: 0;
    position: relative;
    color: #dfe4ea;
}

.kb-page.kb-article-minimal .kb-article-content li::before {
    content: "✔";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6a00;
    font-weight: 700;
}

.kb-page.kb-article-minimal .kb-article-content .kb-errors-list li::before {
    content: "•";
    font-size: 28px;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}

.kb-page.kb-article-minimal .kb-article-content .kb-note {
    max-width: 900px;
    margin: 36px auto;
    border-radius: 14px;
    padding: 24px;
    box-shadow: none;
}

.kb-page.kb-article-minimal .kb-article-content .kb-note strong {
    display: block;
    margin-bottom: 8px;
    color: #f3f5f7;
    font-size: 1.08rem;
    line-height: 1.65;
}

.kb-page.kb-article-minimal .kb-article-content .kb-note p {
    margin: 0;
    color: #dce1e7;
    font-size: 1.08rem;
    line-height: 1.65;
}

.kb-page.kb-article-minimal .kb-article-content .kb-note-tip,
.kb-page.kb-article-minimal .kb-article-content .kb-note-important {
    background: #1e1a16;
    border: 0;
    border-left: 4px solid #ff6a00;
    color: #e6e0d8;
}

.kb-page.kb-article-minimal .kb-article-content blockquote {
    max-width: 900px;
    margin: 34px auto;
    border-left: 4px solid #ff6a00;
    background: #1e1a16;
    border-radius: 12px;
    padding: 24px;
    color: #ece3d7;
    font-size: 20px;
    line-height: 1.9;
}

.kb-page.kb-article-minimal .kb-article-content .kb-conclusion {
    margin-top: 8px;
    font-weight: 700;
    color: #f5f7f9;
}

.kb-page.kb-article-minimal .kb-article-content .kb-article-media,
.kb-page.kb-article-minimal .kb-article-content table,
.kb-page.kb-article-minimal .kb-article-content .kb-compare-grid,
.kb-page.kb-article-minimal .kb-article-content .kb-fact-card,
.kb-page.kb-article-minimal .kb-article-content .article-image-placeholder {
    display: none !important;
}

.kb-page.kb-article-minimal .kb-article-cta-box {
    justify-content: center;
    text-align: center;
}

.kb-page.kb-article-minimal .kb-article-cta-box > div:first-child {
    margin: 0 auto;
}

.kb-page.kb-article-minimal .kb-article-cta-box .kb-cta-buttons {
    width: 100%;
    justify-content: center;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content {
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border-color: #e8ebf0;
    color: #3d3d3d;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content p {
    color: #313841;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content h2 {
    color: #1f2730;
    border-bottom-color: rgba(255, 106, 0, 0.45);
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content h3 {
    color: #2a3440;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content .kb-note strong,
html.light-theme .kb-page.kb-article-minimal .kb-article-content .kb-note p,
html.light-theme .kb-page.kb-article-minimal .kb-article-content blockquote,
html.light-theme .kb-page.kb-article-minimal .kb-article-content .kb-conclusion {
    color: #2b3440;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content .kb-note-tip {
    background: #fff2e9;
    border-left-color: #ff6a00;
    color: #2b3440;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content .kb-note-important {
    background: #fff9e8;
    border-left-color: #e0a800;
    color: #2b3440;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content blockquote {
    background: #fff2e9;
    border-left-color: #ff6a00;
    color: #2b3440;
}

html.light-theme .kb-page.kb-article-minimal .kb-article-content li {
    border-color: #e9edf3;
    background: #ffffff;
    color: #2f3945;
}

@media (max-width: 900px) {
    .kb-page.kb-article-minimal .kb-article-content {
        border-radius: 18px;
        padding: 24px 18px 14px;
        font-size: 18px;
        line-height: 1.65;
    }

    .kb-page.kb-article-minimal .kb-article-content h2 {
        font-size: 31px;
        margin-top: 58px;
        margin-bottom: 22px;
    }

    .kb-page.kb-article-minimal .kb-article-content h3 {
        font-size: 24px;
        margin-top: 40px;
    }

    .kb-page.kb-article-minimal .kb-article-content blockquote {
        font-size: 18px;
        padding: 20px;
    }

    .kb-page.kb-article-minimal .kb-article-content .kb-note {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .kb-main {
        padding-bottom: 40px;
    }

    .kb-breadcrumbs {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .kb-breadcrumbs::-webkit-scrollbar {
        display: none;
    }

    .kb-article-hero,
    .kb-page.kb-article-compact .kb-article-hero {
        padding: 14px;
        border-radius: 16px;
    }

    .kb-article-hero-grid,
    .kb-page.kb-article-compact .kb-article-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .kb-article-hero-copy h1,
    .kb-page.kb-article-compact .kb-article-hero-copy h1 {
        font-size: clamp(1.5rem, 7vw, 2.15rem);
        line-height: 1.12;
    }

    .kb-hero-subtitle {
        font-size: 0.96rem;
        line-height: 1.5;
    }

    .kb-article-meta {
        gap: 8px;
        font-size: 0.84rem;
    }

    .kb-article-hero-media,
    .kb-page.kb-article-compact .kb-article-hero-media {
        width: min(100%, 240px);
        max-width: min(100%, 240px);
        margin: 0 auto;
        justify-self: center;
    }

    .kb-article-layout,
    .kb-page.kb-article-minimal .kb-article-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin-top: 12px;
    }

    .kb-toc {
        position: static;
        top: auto;
        order: -1;
        width: 100%;
        max-height: none;
        overflow: visible;
        padding: 12px 14px;
    }

    .kb-toc ul {
        gap: 6px;
    }

    .kb-toc a,
    .kb-article-content a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .kb-page.kb-article-minimal .kb-article-content {
        max-width: 100%;
        border-radius: 18px;
        padding: 22px 16px 14px;
        font-size: 17px;
        line-height: 1.62;
    }

    .kb-page.kb-article-minimal .kb-article-content > * {
        max-width: 100%;
    }

    .kb-page.kb-article-minimal .kb-article-content h2 {
        font-size: 29px;
        margin-top: 50px;
        margin-bottom: 20px;
    }

    .kb-page.kb-article-minimal .kb-article-content h3 {
        font-size: 22px;
        margin-top: 34px;
    }

    .kb-page.kb-article-minimal .kb-article-content li {
        padding: 16px 16px 16px 50px;
    }
}

@media (max-width: 480px) {
    .kb-article-meta {
        gap: 6px 10px;
    }

    .kb-page.kb-article-minimal .kb-article-content {
        font-size: 16px;
        line-height: 1.58;
    }

    .kb-page.kb-article-minimal .kb-article-content h2 {
        font-size: 26px;
    }

    .kb-page.kb-article-minimal .kb-article-content .kb-note,
    .kb-page.kb-article-minimal .kb-article-content blockquote {
        padding: 18px;
    }
}

/* ===== Мобильная адаптация и полировка статей (Android/iOS, обе темы) ===== */

/* Ссылки в тексте статьи — заметные и кликабельные */
.kb-article-content a:not(.kb-read-btn) {
    color: var(--kb-orange);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}
.kb-article-content a:not(.kb-read-btn):hover { color: #ff8b3d; }
html.light-theme .kb-article-content a:not(.kb-read-btn) { color: #d45500; }
html.light-theme .kb-article-content a:not(.kb-read-btn):hover { color: #ff6a00; }

/* Номера вместо галочек в пошаговых списках */
.kb-article-content ol.kb-steps-list { counter-reset: kb-step; }
.kb-article-content ol.kb-steps-list > li { counter-increment: kb-step; }
.kb-article-content ol.kb-steps-list > li::before {
    content: counter(kb-step);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--kb-orange);
}
.kb-page.kb-article-minimal .kb-article-content ol.kb-steps-list > li::before {
    content: counter(kb-step);
    font-size: 0.95rem;
}

/* Крестики в списках ошибок */
.kb-article-content .kb-errors-list li::before {
    content: "✕";
    color: #ff5d5d;
}

/* Контент не выпирает за экран */
.kb-article-content { overflow-wrap: break-word; }
.kb-article-content img { max-width: 100%; height: auto; }

/* Таблицы: плавный горизонтальный скролл на iOS/Android */
.kb-table-wrap { -webkit-overflow-scrolling: touch; }

/* Таблицы и чётные строки в светлой теме */
html.light-theme .kb-article-content td { border-bottom-color: #e8ebf0; }
html.light-theme .kb-article-content tr:nth-child(even) td { background: #f7f9fb; }
html.light-theme .kb-article-content tr:hover td { background: rgba(255, 106, 0, 0.08); }

/* Карточки сравнения */
.kb-compare-card strong { display: block; margin-bottom: 6px; color: var(--kb-orange); }
.kb-compare-card p { margin: 0; font-size: 0.95rem; line-height: 1.55; }

/* Подсветка касаний в фирменном цвете */
.kb-page a,
.kb-page button,
.kb-page summary { -webkit-tap-highlight-color: rgba(255, 106, 0, 0.18); }

@media (max-width: 768px) {
    /* Таблицы компактнее, скроллятся внутри рамки */
    .kb-article-content table { min-width: 560px; }
    .kb-article-content th,
    .kb-article-content td { padding: 10px 12px; font-size: 0.88rem; }

    /* Удобные тап-цели */
    .kb-faq-item summary { padding: 16px; min-height: 48px; }
    .kb-btn-primary,
    .kb-btn-outline {
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .kb-article-cta-box { padding: 22px; }
    .kb-cta-buttons,
    .kb-cta-buttons .kb-btn-primary { width: 100%; }

    /* Дешевле для GPU слабых телефонов */
    .kb-card-image-placeholder { filter: blur(9px); transform: scale(1.08); }
}

@media (max-width: 480px) {
    .kb-article-content th,
    .kb-article-content td { padding: 9px 10px; font-size: 0.84rem; }
    .kb-compare-card { padding: 14px; }
    .kb-checklist li { padding: 11px 11px 11px 38px; }
    .kb-article-content li { padding: 12px 12px 12px 40px; }
}

/* Уважение к настройке «уменьшить движение» — и меньше работы на скролле */
@media (prefers-reduced-motion: reduce) {
    html.kb-js .kb-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ============================================================
   Статический индекс статей (articles.html) и чипы разделов
   на страницах категорий blog/category-*.html.
   Блок рендерится сборщиком в HTML, а не JS: он даёт поисковым
   роботам ссылку на каждую статью.
   ============================================================ */

.kb-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px 32px;
}

.kb-index-group {
    min-width: 0;
}

.kb-index-title {
    margin: 0 0 2px;
    font-size: 1.05rem;
    line-height: 1.3;
}

.kb-index-title a {
    color: var(--text-primary, #fff);
    text-decoration: none;
}

.kb-index-title a:hover {
    color: #FF6A00;
}

.kb-index-title span {
    margin-left: 4px;
}

.kb-index-count {
    display: block;
    margin-bottom: 10px;
    font-size: 0.82rem;
    opacity: 0.6;
}

.kb-index-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kb-index-list li {
    margin-bottom: 6px;
    line-height: 1.45;
}

.kb-index-list a {
    font-size: 0.92rem;
    color: inherit;
    opacity: 0.82;
    text-decoration: none;
}

.kb-index-list a:hover {
    color: #FF6A00;
    opacity: 1;
    text-decoration: underline;
}

.kb-index-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kb-index-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.kb-index-chip span {
    opacity: 0.55;
    font-size: 0.82rem;
}

.kb-index-chip:hover {
    border-color: #FF6A00;
    color: #FF6A00;
}

html.light-theme .kb-index-chip {
    border-color: rgba(0, 0, 0, 0.14);
}

@media (max-width: 480px) {
    .kb-index-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}
