/* ====================================================================
   Chotam AI — База знаний (docs)
   Дополнение к style.css лендинга. Использует те же токены/шрифты.
   ==================================================================== */

:root {
	--kb-sidebar-w: 264px;
	--kb-toc-w: 220px;
}

/* Тонкая «docs»-подпись рядом с логотипом в шапке */
.hd__logo-wrap { display: flex; align-items: center; gap: 10px; }
.hd__logo-wrap img { height: 28px; }
.hd__docs-tag {
	font-size: 13px; font-weight: 600; color: var(--muted);
	padding-left: 11px; border-left: 1px solid var(--line);
	letter-spacing: -0.01em;
}

/* ====== Breadcrumbs ====== */
.crumbs {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
	font-size: 13px; color: var(--muted);
	padding: 22px 0 0;
}
.crumbs a { color: var(--muted); transition: color .15s; }
.crumbs a:hover { color: var(--accent-2); }
.crumbs__sep { color: #c4c6cc; font-size: 11px; }
.crumbs__cur { color: var(--ink); font-weight: 600; }

/* ====================================================================
   KB HOME — hero with search
   ==================================================================== */
.kbhero {
	position: relative;
	padding: 64px 0 56px;
	background:
		radial-gradient(60% 60% at 50% 0%, rgba(45,171,249,.10), transparent 62%),
		var(--bg);
	border-bottom: 1px solid var(--line);
}
.kbhero::before {
	content: ''; position: absolute; inset: 0;
	background-image:
		linear-gradient(rgba(15,17,21,.025) 1px, transparent 1px),
		linear-gradient(90deg, rgba(15,17,21,.025) 1px, transparent 1px);
	background-size: 36px 36px;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 72%);
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 72%);
	pointer-events: none;
}
.kbhero__inner { position: relative; max-width: 760px; margin: 0 auto; text-align: center; }
.kbhero h1 {
	font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08;
	letter-spacing: -0.025em; font-weight: 800; margin-bottom: 14px;
}
.kbhero__sub { font-size: 18px; color: var(--muted); margin-bottom: 30px; }

/* Search box */
.kbsearch { position: relative; max-width: 600px; margin: 0 auto; }
.kbsearch__icon {
	position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
	color: var(--muted); font-size: 17px; pointer-events: none;
}
.kbsearch__input {
	width: 100%;
	padding: 17px 20px 17px 52px;
	font-family: inherit; font-size: 16px; color: var(--ink);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 999px;
	box-shadow: var(--shadow);
	transition: border-color .15s, box-shadow .15s;
}
.kbsearch__input::placeholder { color: #9a9ca3; }
.kbsearch__input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(45,171,249,.14), var(--shadow);
}
.kbsearch__clear {
	position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
	width: 30px; height: 30px; border-radius: 50%;
	border: none; background: var(--bg-soft); color: var(--muted);
	cursor: pointer; font-size: 14px; display: none;
	align-items: center; justify-content: center;
}
.kbsearch__clear.is-visible { display: flex; }
.kbsearch__clear:hover { background: #ececec; color: var(--ink); }

/* Live search results dropdown */
.kbsearch__results {
	position: absolute; left: 0; right: 0; top: calc(100% + 10px);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
	text-align: left;
	z-index: 200;
	display: none;
}
.kbsearch__results.is-open { display: block; }
.kbsearch__result {
	display: flex; align-items: flex-start; gap: 12px;
	padding: 13px 18px;
	border-bottom: 1px solid var(--line);
	transition: background .12s;
}
.kbsearch__result:last-child { border-bottom: none; }
.kbsearch__result:hover { background: var(--bg-soft); }
.kbsearch__result i { color: var(--accent); font-size: 14px; margin-top: 3px; flex-shrink: 0; }
.kbsearch__result-t { font-size: 15px; font-weight: 600; color: var(--ink); }
.kbsearch__result-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kbsearch__empty { padding: 18px; font-size: 14px; color: var(--muted); text-align: center; }

/* quick popular links under search */
.kbhero__popular {
	display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
	gap: 8px; margin-top: 20px; font-size: 13px; color: var(--muted);
}
.kbhero__popular a {
	padding: 5px 12px; border-radius: 999px;
	background: #fff; border: 1px solid var(--line); color: var(--ink-2);
	font-weight: 500; transition: border-color .15s, color .15s;
}
.kbhero__popular a:hover { border-color: var(--accent); color: var(--accent-2); }

/* ====================================================================
   Category cards grid
   ==================================================================== */
.kbsec { padding: 64px 0; }
.kbsec--soft { background: var(--bg-soft); }
.kbsec__head { max-width: 720px; margin: 0 auto 36px; }
.kbsec__head--center { text-align: center; }
.kbsec__head h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 8px; }
.kbsec__head p { color: var(--muted); font-size: 16px; }

.cat-grid {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.cat-card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 26px;
	display: flex; flex-direction: column;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d8d9dd; }
.cat-card__icon {
	width: 48px; height: 48px; border-radius: 12px;
	background: var(--accent-soft); color: var(--accent);
	display: flex; align-items: center; justify-content: center;
	font-size: 20px; margin-bottom: 18px;
}
.cat-card__t { font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 6px; letter-spacing: -0.01em; }
.cat-card__d { font-size: 14px; color: var(--muted); margin-bottom: 18px; flex: 1; }
.cat-card__links { display: flex; flex-direction: column; gap: 2px; }
.cat-card__links a {
	display: flex; align-items: center; gap: 8px;
	font-size: 14px; color: var(--text); padding: 5px 0;
	transition: color .15s;
}
.cat-card__links a::before {
	content: '\f105'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
	color: #c4c6cc; font-size: 12px; transition: color .15s, transform .15s;
}
.cat-card__links a:hover { color: var(--accent-2); }
.cat-card__links a:hover::before { color: var(--accent); transform: translateX(2px); }
.cat-card__more {
	margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent);
	display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
}
.cat-card__count { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ====================================================================
   ARTICLE / SECTION LAYOUT (sidebar + content + toc)
   ==================================================================== */
.kb-layout {
	display: grid;
	grid-template-columns: var(--kb-sidebar-w) minmax(0, 1fr);
	gap: 48px;
	padding: 12px 0 80px;
	align-items: start;
}
.kb-layout--with-toc {
	grid-template-columns: var(--kb-sidebar-w) minmax(0, 1fr) var(--kb-toc-w);
	gap: 40px;
}

/* ----- Sidebar nav ----- */
.kb-sidebar { position: sticky; top: 88px; }
.kb-sidebar__inner { max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 6px; }
.kb-side-group { margin-bottom: 22px; }
.kb-side-group__title {
	display: flex; align-items: center; gap: 9px;
	font-size: 12px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .06em; color: var(--muted); margin-bottom: 10px;
}
.kb-side-group__title i { color: var(--accent); font-size: 12px; }
.kb-side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.kb-side-list a {
	display: block; padding: 7px 12px; border-radius: 8px;
	font-size: 14px; color: var(--text); line-height: 1.4;
	border-left: 2px solid transparent;
	transition: background .15s, color .15s;
}
.kb-side-list a:hover { background: var(--bg-soft); color: var(--ink); }
.kb-side-list a.is-active {
	background: var(--accent-soft); color: var(--accent-2);
	font-weight: 600; border-left-color: var(--accent);
}

/* ----- Section page: article list ----- */
.sec-head { margin-bottom: 32px; }
.sec-head__icon {
	width: 56px; height: 56px; border-radius: 14px;
	background: var(--accent-soft); color: var(--accent);
	display: flex; align-items: center; justify-content: center;
	font-size: 24px; margin-bottom: 18px;
}
.sec-head h1 { font-size: clamp(28px, 3.6vw, 38px); line-height: 1.1; margin-bottom: 10px; }
.sec-head p { font-size: 17px; color: var(--muted); max-width: 620px; }

.art-list { display: flex; flex-direction: column; gap: 12px; }
.art-row {
	display: flex; align-items: center; gap: 16px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 20px;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.art-row:hover { transform: translateX(3px); box-shadow: var(--shadow); border-color: #d8d9dd; }
.art-row__icon {
	width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
	background: var(--bg-soft); color: var(--accent);
	border: 1px solid var(--line);
	display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.art-row__body { flex: 1; min-width: 0; }
.art-row__t { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.art-row__d { font-size: 13px; color: var(--muted); }
.art-row__arrow { color: #c4c6cc; font-size: 14px; transition: color .15s, transform .15s; }
.art-row:hover .art-row__arrow { color: var(--accent); transform: translateX(3px); }

/* ====================================================================
   ARTICLE PROSE
   ==================================================================== */
.art { max-width: 740px; }
.art__head { margin-bottom: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.art__title { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 14px; }
.art__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.art__meta span { display: inline-flex; align-items: center; gap: 6px; }
.art__meta i { color: var(--accent); font-size: 12px; }

.prose { font-size: 17px; line-height: 1.7; color: var(--text); }
.prose > * + * { margin-top: 20px; }
.prose h2 {
	font-size: 24px; line-height: 1.25; margin-top: 44px; margin-bottom: 0;
	letter-spacing: -0.015em; scroll-margin-top: 96px;
}
.prose h3 {
	font-size: 19px; line-height: 1.3; margin-top: 32px; margin-bottom: 0;
	scroll-margin-top: 96px;
}
.prose p { margin-top: 16px; }
.prose a {
	color: var(--accent-2); font-weight: 500;
	text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(45,171,249,.4);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { margin-top: 16px; padding-left: 24px; }
.prose li { margin-top: 8px; }
.prose li::marker { color: var(--accent); }
.prose img {
	width: 100%; border-radius: var(--radius);
	border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: 24px;
}
.prose video {
	width: 100%; display: block; border-radius: var(--radius);
	border: 1px solid var(--line); box-shadow: var(--shadow);
	margin-top: 24px; background: #000;
}
/* Channels inline list inside prose */
.prose .chan-list { list-style: none; padding: 0 !important; margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.prose .chan-list li { margin: 0 !important; }
.prose .chan-list span {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 7px 13px; border-radius: 999px;
	background: var(--bg-soft); border: 1px solid var(--line);
	font-size: 14px; font-weight: 600; color: var(--ink);
}
.prose .chan-list i { color: var(--accent); font-size: 14px; margin-top: 0; }
.prose .chan-list .i-tg { color: #2aabee; }
.prose .chan-list .i-direct { color: var(--accent); }
.prose .chan-list .chan-ico-max { width: 15px; height: 15px; display: block; flex-shrink: 0; margin-top: 0; }
.prose code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .88em; background: var(--bg-soft);
	border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--ink-2);
}
.prose pre {
	background: var(--ink); color: #e6e7ea;
	border-radius: var(--radius); padding: 18px 20px; overflow-x: auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 14px; line-height: 1.6; margin-top: 22px;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote {
	margin: 24px 0 0; padding: 4px 20px;
	border-left: 3px solid var(--accent);
	color: var(--ink-2); font-size: 17px;
}

/* Callout / note box */
.callout {
	display: flex; gap: 14px;
	padding: 16px 18px; border-radius: var(--radius);
	background: var(--accent-soft); border: 1px solid #cfe7fb;
	font-size: 15px; line-height: 1.55; color: var(--ink-2);
	margin-top: 24px !important;
}
.callout__icon { color: var(--accent-2); font-size: 17px; margin-top: 1px; flex-shrink: 0; }
.callout strong { color: var(--ink); }
.callout--warn { background: #FFF7E6; border-color: #F4D58A; }
.callout--warn .callout__icon { color: #c98a00; }
.callout--tip { background: #ecfdf3; border-color: #bbf0cf; }
.callout--tip .callout__icon { color: #16a34a; }

/* Step list */
.steps { list-style: none; counter-reset: step; padding: 0 !important; margin-top: 24px; }
.steps li {
	position: relative; padding-left: 48px; margin-top: 18px !important;
}
.steps li::before {
	counter-increment: step; content: counter(step);
	position: absolute; left: 0; top: -2px;
	width: 30px; height: 30px; border-radius: 50%;
	background: var(--accent); color: #fff;
	font-size: 14px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
}

/* ----- Right TOC ----- */
.toc { position: sticky; top: 88px; font-size: 13px; }
.toc__title {
	font-size: 12px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .06em; color: var(--muted); margin-bottom: 12px;
}
.toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--line); }
.toc__list a {
	display: block; padding: 6px 0 6px 14px; margin-left: -1px;
	color: var(--muted); border-left: 2px solid transparent;
	line-height: 1.4; transition: color .15s, border-color .15s;
}
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-active { color: var(--accent-2); border-left-color: var(--accent); font-weight: 600; }
.toc__list a.toc__sub { padding-left: 26px; font-size: 12.5px; }

/* ====== Helpful feedback ====== */
.helpful {
	margin-top: 48px; padding: 24px 26px;
	background: var(--bg-soft); border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
}
.helpful__q { font-size: 16px; font-weight: 600; color: var(--ink); margin-right: auto; }
.helpful__btns { display: flex; gap: 10px; }
.helpful__btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 9px 16px; border-radius: 999px;
	border: 1px solid var(--line); background: #fff;
	font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
	cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.helpful__btn:hover { border-color: var(--accent); color: var(--accent-2); }
.helpful__btn i { font-size: 13px; }
.helpful__btn.is-chosen { background: var(--accent); border-color: var(--accent); color: #fff; }
.helpful__thanks { font-size: 15px; color: var(--ink-2); display: none; }
.helpful.is-done .helpful__q,
.helpful.is-done .helpful__btns { display: none; }
.helpful.is-done .helpful__thanks { display: inline-flex; align-items: center; gap: 8px; }
.helpful__thanks i { color: #16a34a; }

/* ====== Prev / next ====== */
.art-nav {
	display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
	margin-top: 28px;
}
.art-nav__item {
	display: flex; flex-direction: column; gap: 4px;
	padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius);
	background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.art-nav__item:hover { border-color: #d8d9dd; box-shadow: var(--shadow); transform: translateY(-2px); }
.art-nav__dir { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.art-nav__dir i { color: var(--accent); }
.art-nav__t { font-size: 15px; font-weight: 600; color: var(--ink); }
.art-nav__item--next { text-align: right; }
.art-nav__item--next .art-nav__dir { justify-content: flex-end; }
.art-nav__placeholder { visibility: hidden; }

/* ====== Bottom support CTA ====== */
.kb-support {
	margin-top: 28px;
	background: var(--ink);
	background-image: radial-gradient(60% 120% at 85% 0%, rgba(45,171,249,.18), transparent 60%);
	border-radius: var(--radius-lg);
	padding: 32px 34px;
	display: flex; align-items: center; flex-wrap: wrap; gap: 20px;
}
.kb-support__body { flex: 1; min-width: 240px; }
.kb-support h3 { color: #fff; font-size: 22px; margin-bottom: 6px; }
.kb-support p { color: rgba(255,255,255,.7); font-size: 15px; }
.kb-support__btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* full-width support band on home/section */
.kb-help-band { padding: 56px 0 72px; }
.kb-help-band .kb-support { margin: 0; }

/* ====================================================================
   Responsive
   ==================================================================== */
@media (max-width: 1100px) {
	.kb-layout--with-toc { grid-template-columns: var(--kb-sidebar-w) minmax(0, 1fr); }
	.toc { display: none; }
}
@media (max-width: 900px) {
	.cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
	.kb-layout, .kb-layout--with-toc { grid-template-columns: 1fr; gap: 0; }
	.kb-sidebar {
		position: static; margin-bottom: 8px;
		border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
	}
	.kb-sidebar__inner { max-height: none; padding: 14px 16px; }
	.kb-sidebar__toggle {
		display: flex; align-items: center; justify-content: space-between;
		width: 100%; padding: 14px 16px; border: 1px solid var(--line);
		border-radius: var(--radius); background: #fff; cursor: pointer;
		font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
		margin-bottom: 20px;
	}
	.kb-sidebar__toggle i { color: var(--accent); transition: transform .2s; }
	.kb-sidebar { display: none; }
	.kb-sidebar.is-open { display: block; }
}
@media (min-width: 821px) { .kb-sidebar__toggle { display: none; } }
@media (max-width: 560px) {
	.cat-grid { grid-template-columns: 1fr; }
	.art-nav { grid-template-columns: 1fr; }
	.kbhero { padding: 44px 0 40px; }
	.helpful { flex-direction: column; align-items: flex-start; }
}
