/* База знаний: страницы документации (оглавление слева, текст, код, плашки). */

.kb-page { background: #fff; }

.kb-hero {
    background: radial-gradient(50rem 18rem at 15% -20%, rgba(139, 92, 246, .12), transparent 60%), linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e8eaf2;
    padding: 40px 0 32px;
}
.kb-hero .kb-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.kb-crumbs { font-size: 14px; line-height: 20px; color: #6b7280; margin-bottom: 12px; }
.kb-crumbs a { color: var(--brand-500, #7c3aed); text-decoration: none; }
.kb-crumbs a:hover { text-decoration: underline; }
.kb-hero h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; font-weight: 600; color: var(--ink, #0f172a); margin: 0 0 8px; letter-spacing: -.5px; }
.kb-hero p { font-size: 18px; line-height: 1.5; color: #4b5563; margin: 0; max-width: 720px; }
.kb-meta { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

.kb-layout {
    max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px;
    display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px;
}
@media (max-width: 960px) { .kb-layout { grid-template-columns: 1fr; gap: 16px; } .kb-toc { position: static !important; } }

.kb-toc { position: sticky; top: 24px; align-self: start; font-size: 14px; }
.kb-toc-title { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; margin-bottom: 8px; }
.kb-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid #e5e7eb; }
.kb-toc li { margin: 0; }
.kb-toc a { display: block; padding: 6px 16px; margin-left: -1px; border-left: 2px solid transparent; color: #4b5563; text-decoration: none; line-height: 20px; }
.kb-toc a:hover { color: #111827; }
.kb-toc a.active { color: var(--brand-500, #7c3aed); border-left-color: var(--brand-500, #7c3aed); font-weight: 500; }
.kb-toc .kb-toc-sub a { padding-left: 28px; font-size: 14px; }

.kb-article { max-width: 780px; color: #374151; font-size: 16px; line-height: 1.6; }
.kb-article section { scroll-margin-top: 24px; padding-bottom: 24px; }
.kb-article section + section { border-top: 1px solid #eceef3; padding-top: 32px; }
.kb-article h2 { font-size: 24px; line-height: 30px; font-weight: 600; color: var(--ink, #0f172a); margin: 0 0 12px; letter-spacing: -.1px; }
.kb-article h3 { font-size: 18px; line-height: 24px; font-weight: 600; color: var(--ink, #0f172a); margin: 24px 0 8px; scroll-margin-top: 24px; letter-spacing: 0; }
.kb-article p { margin: 0 0 16px; color: #374151; }
.kb-article ul, .kb-article ol { margin: 0 0 16px; padding-left: 24px; }
.kb-article li { margin-bottom: 8px; color: #374151; }
.kb-article a { color: var(--brand-500, #7c3aed); }
.kb-article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: #eef0f6; color: #1f2937; padding: .1em .35em; border-radius: 4px; }

.kb-field { display: grid; grid-template-columns: 200px 1fr; gap: 4px 16px; padding: 12px 0; border-bottom: 1px dashed #e5e7eb; }
.kb-field:last-child { border-bottom: 0; }
.kb-field dt { font-weight: 600; color: #111827; }
.kb-field dd { margin: 0; color: #4b5563; }
@media (max-width: 640px) { .kb-field { grid-template-columns: 1fr; } }

.kb-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--brand-50, #f5f3ff); color: var(--brand, #6d28d9); }
.kb-badge.green { background: #ecfdf5; color: #047857; }
.kb-badge.gray { background: #f3f4f6; color: #4b5563; }
.kb-badge.amber { background: #fffbeb; color: #b45309; }

.kb-note { display: flex; gap: 12px; padding: 16px; border-radius: 8px; margin: 0 0 24px; border: 1px solid; font-size: 14px; line-height: 20px; }
.kb-note p:last-child, .kb-note ul:last-child { margin-bottom: 0; }
.kb-note-icon { flex: 0 0 auto; font-size: 1.1rem; line-height: 1.5; }
.kb-note.info { background: #eff6ff; border-color: #bfdbfe; }
.kb-note.tip { background: #ecfdf5; border-color: #a7f3d0; }
.kb-note.warn { background: #fffbeb; border-color: #fde68a; }

.kb-code { position: relative; margin: 0 0 24px; border-radius: 8px; overflow: hidden; background: #0f172a; border: 1px solid #1e293b; }
.kb-code-head { display: flex; justify-content: space-between; align-items: center; padding: .45rem .9rem; background: #111c33; color: #94a3b8; font-size: .78rem; border-bottom: 1px solid #1e293b; }
.kb-copy { background: transparent; border: 1px solid #334155; color: #cbd5e1; font-size: .75rem; padding: .15rem .55rem; border-radius: 6px; cursor: pointer; }
.kb-copy:hover { background: #1e293b; }
.kb-code pre { margin: 0; padding: 16px; overflow-x: auto; }
.kb-code code { background: none; color: #e2e8f0; padding: 0; font-size: .84rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

.kb-table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.kb-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.kb-table th { text-align: left; font-weight: 600; color: #6b7280; font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: .05em; padding: 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.kb-table td { padding: 12px; border-bottom: 1px solid #f1f2f6; vertical-align: top; color: #374151; }
.kb-table tr:last-child td { border-bottom: 0; }
.kb-table td.num, .kb-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb-table tr.legacy td { color: #6b7280; }

.kb-steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.kb-steps li { position: relative; padding-left: 36px; margin-bottom: 12px; }
.kb-steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50, #f5f3ff); color: var(--brand, #6d28d9); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

[dir="rtl"] .kb-toc ol { border-left: 0; border-right: 1px solid #e5e7eb; }
[dir="rtl"] .kb-toc a { border-left: 0; border-right: 2px solid transparent; margin-left: 0; margin-right: -1px; }
[dir="rtl"] .kb-toc a.active { border-right-color: var(--brand-500, #7c3aed); }
