:root {
	--accent: #3858e9;
	--accent-strong: #2a45c9;
	--accent-soft: rgba(56, 88, 233, 0.1);
	--accent-softer: rgba(56, 88, 233, 0.06);
	--accent-line: rgba(56, 88, 233, 0.22);
	--bg: #f4f6fb;
	--surface: #ffffff;
	--text: #141824;
	--muted: #5e677a;
	--line: #e6e9f2;
	--line-strong: #d5dae6;
	--warn: #fff6e4;
	--warn-line: #f0d7a2;
	--sidebar: 268px;
	--rail: 212px;
	--top: 64px;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(20, 24, 36, 0.04), 0 12px 32px rgba(56, 88, 233, 0.06);
	--font: Inter, "Inter Display", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background:
		radial-gradient(900px 420px at 100% -10%, rgba(56, 88, 233, 0.08), transparent 60%),
		var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.65;
}

a {
	color: inherit;
}

img {
	max-width: 100%;
}

.skip {
	position: absolute;
	left: 16px;
	top: -48px;
	background: var(--accent);
	color: #fff;
	padding: 8px 12px;
	border-radius: 8px;
	z-index: 20;
}

.skip:focus {
	top: 12px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.top {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 16px;
	height: var(--top);
	padding: 0 28px;
	background: rgba(255, 255, 255, 0.9);
	color: var(--text);
	border-bottom: 1px solid var(--line);
	backdrop-filter: blur(16px);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--text);
}

.brand__mark {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: var(--accent);
	color: #fff;
	font-size: 15px;
	font-weight: 650;
	letter-spacing: -0.04em;
}

.brand__name {
	font-size: 17px;
	font-weight: 620;
	letter-spacing: -0.03em;
}

.brand__docs {
	font-size: 13px;
	font-weight: 500;
	color: var(--accent);
	background: var(--accent-soft);
	border-radius: 999px;
	padding: 2px 8px;
}

.top__demo {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 560;
	letter-spacing: -0.01em;
	box-shadow: 0 6px 16px rgba(56, 88, 233, 0.28);
}

.top__demo::after {
	content: "";
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3H3.5A1.5 1.5 0 0 0 2 4.5v8A1.5 1.5 0 0 0 3.5 14h8a1.5 1.5 0 0 0 1.5-1.5V10'/%3E%3Cpath d='M9 2h5v5'/%3E%3Cpath d='M14 2 7.5 8.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.top__demo:hover {
	background: var(--accent-strong);
}

.top__menu {
	display: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}

.top__burger,
.top__burger::before,
.top__burger::after {
	display: block;
	width: 14px;
	height: 1.5px;
	background: var(--text);
	border-radius: 2px;
	position: relative;
}

.top__burger::before,
.top__burger::after {
	content: "";
	position: absolute;
	left: 0;
}

.top__burger::before {
	top: -5px;
}

.top__burger::after {
	top: 5px;
}

.shell {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 760px) var(--rail);
	justify-content: center;
	gap: 28px;
	padding: 28px 28px 72px;
	align-items: start;
}

.side {
	position: sticky;
	top: calc(var(--top) + 20px);
	max-height: calc(100vh - var(--top) - 36px);
	overflow: auto;
	padding: 4px 8px 12px 0;
	scrollbar-width: thin;
	scrollbar-color: var(--line-strong) transparent;
}

.side__search {
	display: block;
	position: relative;
	margin-bottom: 18px;
}

.side__search::before {
	content: "";
	position: absolute;
	left: 12px;
	top: 50%;
	width: 14px;
	height: 14px;
	transform: translateY(-50%);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235e677a' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
	pointer-events: none;
}

.side__search input {
	width: 100%;
	border: 1px solid var(--line);
	background: var(--surface);
	font: inherit;
	font-size: 14px;
	color: var(--text);
	padding: 10px 12px 10px 34px;
	border-radius: 10px;
	box-shadow: 0 1px 0 rgba(20, 24, 36, 0.02);
}

.side__search input::placeholder {
	color: #8b93a7;
}

.side__search input:focus {
	outline: 2px solid rgba(56, 88, 233, 0.35);
	outline-offset: 1px;
	border-color: var(--accent);
}

.side__group {
	margin: 22px 0 6px;
	padding: 0 10px;
	font-size: 11px;
	font-weight: 620;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8b93a7;
}

.side__group:first-child {
	margin-top: 0;
}

.side__nav a {
	display: block;
	margin: 1px 0;
	padding: 7px 10px;
	border-radius: 8px;
	text-decoration: none;
	color: #2a3142;
	font-size: 14.5px;
	line-height: 1.35;
}

.side__nav a:hover {
	background: var(--accent-softer);
	color: var(--accent-strong);
}

.side__nav a.is-current {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}

.main {
	min-width: 0;
}

.doc {
	background: var(--surface);
	border: 1px solid rgba(56, 88, 233, 0.08);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 44px 48px 32px;
}

.doc h1 {
	margin: 0 0 14px;
	font-size: clamp(34px, 4vw, 46px);
	line-height: 1.05;
	letter-spacing: -0.045em;
	font-weight: 620;
}

.doc .lead {
	margin: 0 0 28px;
	color: var(--muted);
	font-size: 18px;
	line-height: 1.55;
}

.doc h2 {
	margin: 40px 0 12px;
	padding-top: 8px;
	font-size: 22px;
	line-height: 1.25;
	letter-spacing: -0.03em;
	font-weight: 620;
	scroll-margin-top: 88px;
}

.doc h2::before {
	content: "";
	display: block;
	width: 28px;
	height: 3px;
	margin-bottom: 10px;
	border-radius: 99px;
	background: var(--accent);
}

.doc h3 {
	margin: 26px 0 8px;
	font-size: 17px;
	line-height: 1.35;
	letter-spacing: -0.02em;
	font-weight: 620;
	color: #1c2436;
	scroll-margin-top: 88px;
}

.doc p,
.doc li {
	font-size: 16px;
}

.doc ul,
.doc ol {
	padding-left: 1.25em;
}

.doc li + li {
	margin-top: 6px;
}

.doc a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.doc a:hover {
	color: var(--accent-strong);
}

.doc code {
	font-family: var(--mono);
	font-size: 0.88em;
	color: var(--accent-strong);
	background: var(--accent-softer);
	border-radius: 6px;
	padding: 0.12em 0.4em;
}

.steps {
	list-style: none;
	padding: 0;
	margin: 18px 0 0;
	counter-reset: step;
}

.steps > li {
	position: relative;
	padding: 0 0 20px 48px;
	margin: 0;
}

.steps > li::before {
	counter-increment: step;
	content: counter(step);
	position: absolute;
	left: 0;
	top: 0;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--accent);
	color: #fff;
	font-size: 13px;
	font-weight: 620;
	box-shadow: 0 6px 14px rgba(56, 88, 233, 0.28);
}

.steps > li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 14px;
	top: 34px;
	bottom: 4px;
	width: 2px;
	border-radius: 99px;
	background: rgba(56, 88, 233, 0.18);
}

.note {
	position: relative;
	margin: 18px 0;
	padding: 14px 16px 14px 46px;
	border: 1px solid var(--accent-line);
	border-left: 3px solid var(--accent);
	border-radius: 12px;
	background: var(--accent-softer);
}

.note::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 16px;
	width: 18px;
	height: 18px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%233858e9' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='7'/%3E%3Cpath d='M9 8.2V13'/%3E%3Cpath d='M9 5.4h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.note--warn {
	background: var(--warn);
	border-color: var(--warn-line);
	border-left-color: #e0a23a;
}

.note--warn::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%238a5a10' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2.5 16 15.2H2L9 2.5Z'/%3E%3Cpath d='M9 7.2v3.4'/%3E%3Cpath d='M9 13h.01'/%3E%3C/svg%3E");
}

.note p {
	margin: 0;
}

.note p + p {
	margin-top: 8px;
}

.note strong {
	color: var(--accent-strong);
}

.note--warn strong {
	color: #8a5a10;
}

.table-wrap {
	overflow-x: auto;
	margin: 18px 0;
	border: 1px solid var(--line);
	border-radius: 12px;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

th,
td {
	text-align: left;
	vertical-align: top;
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
}

tr:last-child td {
	border-bottom: 0;
}

th {
	font-weight: 620;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--accent);
	background: #f6f8fe;
}

.cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 8px 0 0;
}

.card__icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin-bottom: 12px;
	border-radius: 9px;
	background: var(--accent-soft);
	color: var(--accent);
}

.card__icon svg {
	width: 16px;
	height: 16px;
}

.card {
	display: block;
	padding: 18px 18px 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
	border-color: var(--accent-line);
	box-shadow: 0 10px 24px rgba(56, 88, 233, 0.1);
	transform: translateY(-1px);
}

.card strong {
	display: block;
	font-weight: 620;
	letter-spacing: -0.02em;
	margin-bottom: 4px;
	color: var(--text);
}

.card:hover strong {
	color: var(--accent);
}

.card span {
	color: var(--muted);
	font-size: 14px;
	line-height: 1.45;
}

.rail {
	position: sticky;
	top: calc(var(--top) + 20px);
}

.toc {
	padding: 4px 0 0 14px;
	border-left: 1px solid var(--line);
}

.toc__label {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 620;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8b93a7;
}

.toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.toc li {
	margin: 0;
}

.toc a {
	display: block;
	padding: 5px 0 5px 10px;
	margin-left: -15px;
	border-left: 2px solid transparent;
	text-decoration: none;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.4;
}

.toc a:hover {
	color: var(--accent-strong);
}

.toc a.is-active {
	color: var(--accent);
	border-left-color: var(--accent);
	font-weight: 600;
}

.toc ol ol {
	padding-left: 12px;
}

.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 44px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.pager__link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
	letter-spacing: -0.02em;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pager__link:hover {
	border-color: var(--accent-line);
	box-shadow: 0 8px 20px rgba(56, 88, 233, 0.08);
	color: var(--accent-strong);
}

.pager__link span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 600;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

.pager__link span::before,
.pager__link--next span::after {
	content: "";
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%233858e9' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3 5 8l5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pager__link--next span::before {
	content: none;
}

.pager__link--next span::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%233858e9' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 3 5 5-5 5'/%3E%3C/svg%3E");
}

.pager__link--next span {
	justify-content: flex-end;
}

.pager__link--next {
	text-align: right;
	grid-column: 2;
}

.foot {
	padding: 0 28px 36px;
	text-align: center;
	color: #8b93a7;
	font-size: 13px;
}

.backdrop {
	display: none;
}

@media (max-width: 1100px) {
	.shell {
		grid-template-columns: var(--sidebar) minmax(0, 1fr);
	}

	.rail {
		display: none;
	}
}

@media (max-width: 800px) {
	.top {
		padding: 0 16px;
	}

	.top__menu {
		display: inline-flex;
	}

	.brand__docs {
		display: none;
	}

	.shell {
		grid-template-columns: 1fr;
		padding: 16px 16px 48px;
	}

	.side {
		position: fixed;
		z-index: 6;
		top: var(--top);
		left: 0;
		bottom: 0;
		width: min(320px, 88vw);
		max-height: none;
		background: #fff;
		padding: 18px 16px 24px;
		box-shadow: 16px 0 40px rgba(20, 24, 36, 0.12);
		transform: translateX(-105%);
		transition: transform 0.2s ease;
	}

	body.is-nav-open .side {
		transform: none;
	}

	.backdrop {
		display: block;
		position: fixed;
		inset: var(--top) 0 0 0;
		background: rgba(20, 24, 36, 0.38);
		z-index: 4;
	}

	.backdrop[hidden] {
		display: none;
	}

	.doc {
		padding: 28px 20px 18px;
	}

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

	.pager__link--next {
		grid-column: auto;
		text-align: left;
	}

	.pager__link--next span {
		justify-content: flex-start;
	}
}
