/* База знаний: главная плитками и страница статьи */
.kb-page { background: #fff; }

/* --- Главная ----------------------------------------------------------------------- */
.kb-hero { position: relative; overflow: hidden; color: #fff; padding: 46px 0 88px;
  background: radial-gradient(900px 420px at 85% -10%, rgba(185, 166, 255, .35), transparent 60%),
              radial-gradient(700px 380px at 0% 120%, rgba(91, 46, 255, .55), transparent 60%),
              linear-gradient(135deg, #0B0F3A 0%, #1B1466 55%, #3A12C4 100%); }
.kb-hero h1 { font-size: 46px; letter-spacing: -.03em; margin: 18px 0 10px; color: #fff; }
.kb-hero p { font-size: 18px; color: rgba(255, 255, 255, .78); margin: 0 0 26px; max-width: 640px; }
.kb-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.kb-crumbs a { color: var(--muted); text-decoration: none; }
.kb-crumbs a:hover { color: var(--brand); }
.kb-crumbs b { color: var(--ink); font-weight: 600; }
.kb-crumbs-light, .kb-crumbs-light a { color: rgba(255, 255, 255, .7); }
.kb-crumbs-light b { color: #fff; }
.kb-search { position: relative; max-width: 680px; }
.kb-search > .icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 22px; height: 22px; pointer-events: none; }
.kb-search input { width: 100%; height: 62px; border-radius: 18px; border: 0; padding: 0 22px 0 56px; font: inherit; font-size: 17px; color: var(--ink);
  box-shadow: 0 18px 50px rgba(5, 8, 40, .35); outline: none; }
.kb-search input:focus { box-shadow: 0 18px 50px rgba(5, 8, 40, .35), 0 0 0 4px rgba(185, 166, 255, .55); }
.kb-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  max-height: 440px; overflow: auto; padding: 6px; color: var(--ink); }
.kb-results a { display: block; padding: 11px 14px; border-radius: 11px; text-decoration: none; color: inherit; }
.kb-results a:hover, .kb-results a.on { background: var(--brand-50); }
.kb-results b { display: block; font-size: 15px; }
.kb-results small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.kb-results small em { font-style: normal; color: var(--brand); font-weight: 600; }
.kb-results .kb-empty { padding: 14px; color: var(--muted); font-size: 14px; }
.kb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 13.5px; }
.kb-chips span { color: rgba(255, 255, 255, .65); margin-right: 2px; }
.kb-chips a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.kb-chips a:hover { background: rgba(255, 255, 255, .22); }

.kb-start { margin-top: -54px; position: relative; z-index: 2; }
.kb-start-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px 28px 26px; display: grid; gap: 18px; }
.kb-start-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.kb-start-head .kb-eyebrow { flex-basis: 100%; }
.kb-start-head h2 { margin: 0 auto 0 0 !important; }
.kb-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.kb-start-head h2 { font-size: 24px; margin: 6px 0 14px; letter-spacing: -.01em; }
.kb-start-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.kb-start-steps li { counter-increment: s; background: var(--bg); border-radius: 16px; padding: 16px 16px 16px 56px; position: relative; min-height: 86px; }
.kb-start-steps li::before { content: counter(s); position: absolute; left: 14px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.kb-start-steps b { display: block; font-size: 15px; color: var(--ink); }
.kb-start-steps span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }

.kb-sections { padding: 40px 0 10px; }
.kb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.kb-tile { --c: var(--brand); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s; }
.kb-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.kb-tile-head { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.kb-tile-ic { flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff); }
.kb-tile-ic .icon { width: 24px; height: 24px; }
.kb-tile h2 { font-size: 18.5px; margin: 2px 0 4px; letter-spacing: -.01em; color: var(--ink); }
.kb-tile-head small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.kb-tile ul { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 2px; flex: 1; align-content: start; }
.kb-tile li a { display: block; padding: 6px 0 6px 18px; position: relative; color: var(--text); text-decoration: none; font-size: 14.5px; line-height: 1.35; }
.kb-tile li a::before { content: ""; position: absolute; left: 2px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--c) 55%, #fff); }
.kb-tile li a:hover { color: var(--c); }
.kb-tile-more, .kb-tile-count { margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--c); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.kb-tile-count { color: var(--faint); font-weight: 500; }
.kb-tile li small { display: block; padding: 0 0 6px 18px; margin-top: -3px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.kb-support { padding: 30px 0 70px; }
.kb-support-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 28px; border-radius: 20px;
  background: linear-gradient(135deg, var(--brand-50), #fff 70%); border: 1px solid var(--line); }
.kb-support-card h2 { margin: 0 0 4px; font-size: 22px; }
.kb-support-card p { margin: 0; color: var(--muted); }
.kb-support-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Статья ------------------------------------------------------------------------ */
.kb-wrap { max-width: 1340px; display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 40px; padding-top: 30px; padding-bottom: 30px; align-items: start; }
.kb-nav { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 6px; font-size: 14px; }
.kb-nav-home { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand); text-decoration: none; margin-bottom: 14px; }
.kb-nav-toggle { display: none; }
.kb-nav details { --c: var(--brand); border-radius: 12px; }
.kb-nav summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 10px; font-weight: 600; color: var(--ink); }
.kb-nav summary::-webkit-details-marker { display: none; }
.kb-nav summary:hover { background: var(--bg); }
.kb-dot { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.kb-nav ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 20px; border-left: 2px solid var(--line-2); margin-left: 20px; }
.kb-nav li a { display: block; padding: 6px 10px; color: var(--muted); text-decoration: none; border-radius: 8px; line-height: 1.35; }
.kb-nav li a:hover { color: var(--ink); background: var(--bg); }
.kb-nav li a.active { color: var(--brand); background: var(--brand-50); font-weight: 600; }

.kb-main { min-width: 0; }
.kb-crumbs a[style] { color: var(--c); font-weight: 600; }
.kb-head h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.025em; margin: 14px 0 10px; color: var(--ink); }
.kb-lead { font-size: 18px; color: var(--muted); margin: 0 0 22px; }
.kb-toc-mobile { display: none; }
.kb-admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--brand-100); border-radius: 12px; background: var(--brand-50); }
.kb-admin-link { margin: -4px 0 16px; background: rgba(255, 255, 255, .14) !important; color: #fff !important; border-color: rgba(255, 255, 255, .25) !important; }

.kb-body { font-size: 16.5px; line-height: 1.7; color: var(--text); }
.kb-body > *:first-child { margin-top: 0; }
.kb-body h2 { font-size: 25px; letter-spacing: -.015em; color: var(--ink); margin: 42px 0 12px; scroll-margin-top: 90px; line-height: 1.25; }
.kb-body h3 { font-size: 19px; color: var(--ink); margin: 28px 0 8px; }
.kb-body p { margin: 0 0 14px; }
.kb-body a { color: var(--brand); }
.kb-body ul, .kb-body ol { margin: 0 0 16px; padding-left: 24px; }
.kb-body li { margin: 5px 0; }
.kb-body li::marker { color: var(--brand); }
.kb-body b, .kb-body strong { color: var(--ink); }
.kb-body table { width: 100%; border-collapse: collapse; margin: 6px 0 20px; font-size: 15px; }
.kb-body th, .kb-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kb-body th { background: var(--bg); font-weight: 600; color: var(--ink); }
.kb-body code { font-size: .9em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.kb-body kbd { font: 600 13px/1 Inter, sans-serif; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; }

/* Шаги с кружками-номерами */
.kb-body ol.kb-steps { list-style: none; padding: 0; counter-reset: st; margin: 6px 0 22px; }
.kb-body ol.kb-steps > li { counter-increment: st; position: relative; padding: 2px 0 14px 48px; margin: 0; }
.kb-body ol.kb-steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; display: grid; place-items: center; line-height: 1; }
.kb-body ol.kb-steps > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 2px; width: 2px; background: var(--brand-100); }
.kb-body ol.kb-steps > li:last-child::after { display: none; }
.kb-body ol.kb-steps > li > b:first-child { display: block; font-size: 17px; }

/* Надписи интерфейса */
.kb-ui { display: inline-block; font-size: .88em; font-weight: 600; line-height: 1.35; color: var(--brand-700); background: var(--brand-50);
  border: 1px solid var(--brand-100); border-radius: 7px; padding: 0 7px; white-space: nowrap; }
.kb-path { white-space: normal; }
.kb-sep { color: var(--faint); margin: 0 4px; }

/* Подсказки */
.kb-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; margin: 18px 0; font-size: 15.5px; line-height: 1.6; border: 1px solid; }
.kb-box > div > b:first-child { display: block; margin-bottom: 2px; }
.kb-box p:last-child, .kb-box ul:last-child { margin-bottom: 0; }
.kb-box-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.kb-tip { background: var(--brand-50); border-color: var(--brand-100); }
.kb-tip .kb-box-ic { background: #fff; color: var(--brand); }
.kb-note { background: #EEF6FF; border-color: #D3E6FF; }
.kb-note .kb-box-ic { background: #fff; color: #2F6BFF; }
.kb-warn { background: var(--warning-bg); border-color: #FBDDA6; }
.kb-warn .kb-box-ic { background: #fff; color: var(--warning); }

/* Скриншоты */
.kb-shot { margin: 18px 0 24px; }
.kb-shot a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(16, 20, 60, .08); background: var(--bg); cursor: zoom-in; }
.kb-shot img { display: block; width: 100%; height: auto; }
.kb-shot figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; text-align: center; }
.kb-shot.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.kb-shot.medium { max-width: 600px; margin-left: auto; margin-right: auto; }
.kb-shots2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.kb-shots2 .kb-shot { margin: 18px 0 18px; }

.kb-see { font-weight: 600; }
.kb-related { margin: 40px 0 0; }
.kb-related h3 { font-size: 18px; margin: 0 0 12px; color: var(--ink); }
.kb-related-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kb-related-list a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: border-color .15s, background .15s; }
.kb-related-list a:hover { border-color: var(--brand-100); background: var(--brand-50); }
.kb-related-list b { display: block; color: var(--ink); font-size: 15px; }
.kb-related-list span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; line-height: 1.45; }

.kb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--line); }
.kb-pager a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.kb-pager a:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
.kb-pager small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.kb-pager b { display: block; color: var(--ink); margin-top: 4px; font-size: 15.5px; }
.kb-pager .next { text-align: right; grid-column: 2; }
.kb-pager .next small { justify-content: flex-end; }

.kb-toc { position: sticky; top: 84px; font-size: 13.5px; }
.kb-toc-in b { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.kb-toc ol { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line-2); }
.kb-toc li a { display: block; padding: 5px 0 5px 10px; margin-left: -14px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.kb-toc li a:hover { color: var(--ink); }
.kb-toc li a.on { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

.kb-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8, 10, 30, .86); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.kb-lightbox[hidden] { display: none; }
.kb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); background: #fff; }
.kb-lightbox button { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; display: grid; place-items: center; }

@media (max-width: 1180px) {
  .kb-wrap { grid-template-columns: 230px minmax(0, 1fr); }
  .kb-toc { display: none; }
  .kb-toc-mobile { display: block; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
  .kb-toc-mobile summary { cursor: pointer; font-weight: 600; color: var(--ink); }
  .kb-toc-mobile ol { margin: 10px 0 0; padding-left: 20px; font-size: 14.5px; }
  .kb-toc-mobile a { color: var(--text); text-decoration: none; }
}
@media (max-width: 960px) {
  .kb-grid { grid-template-columns: 1fr 1fr; }
  .kb-start-card { grid-template-columns: 1fr; }
  .kb-start-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .kb-wrap { grid-template-columns: 1fr; gap: 0; padding-top: 16px; }
  .kb-nav { position: static; max-height: none; overflow: visible; padding: 0; margin-bottom: 12px; }
  .kb-nav-home { margin: 0 12px 0 0; }
  .kb-nav-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
  .kb-nav-list { display: none; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
  .kb-nav.open .kb-nav-list { display: block; }
}
@media (max-width: 640px) {
  .kb-hero { padding: 30px 0 76px; }
  .kb-hero h1 { font-size: 34px; }
  .kb-hero p { font-size: 16px; }
  .kb-search input { height: 54px; font-size: 16px; }
  .kb-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .kb-chips a, .kb-chips span { flex: none; white-space: nowrap; }
  .kb-grid, .kb-start-steps, .kb-related-list, .kb-shots2 { grid-template-columns: 1fr; }
  .kb-start-card { padding: 20px; }
  .kb-head h1 { font-size: 28px; }
  .kb-body { font-size: 16px; }
  .kb-body h2 { font-size: 22px; }
  .kb-pager { grid-template-columns: 1fr; }
  .kb-pager .next { grid-column: 1; }
  .kb-body table { display: block; overflow-x: auto; }
}
