:root {
	--primary: #0d9488;
	--primary-hover: #0f766e;
	--primary-light: #f0fdfa;
	--accent: #ea580c;
	--accent-light: #fff7ed;
	--indigo: #4f46e5;
	--bg-color: #f8fafc;
	--text-main: #0f172a;
	--text-muted: #475569;
	--border: #e2e8f0;
	--code-bg: #0f172a;
	--sidebar-w: 290px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 84px;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--text-main);
	background-color: var(--bg-color);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

/* === Верхняя шапка === */
header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 64px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 28px;
}

.header-left {
	display: flex;
	align-items: center;
	gap: 16px;
}

.logo {
	font-size: 22px;
	font-weight: 800;
	text-decoration: none;
	color: var(--text-main);
	display: flex;
	align-items: center;
	gap: 8px;
}

.logo span {
	color: var(--indigo);
	font-size: 16px;
}

.doc-badge {
	background: var(--primary-light);
	color: var(--primary-hover);
	border: 1px solid #99f6e4;
	font-size: 12px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 14px;
}

.btn-link {
	text-decoration: none;
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 600;
	transition: color 0.2s;
}

.btn-link:hover {
	color: var(--primary);
}

.btn-primary {
	background-color: var(--primary);
	color: white;
	padding: 8px 18px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	font-size: 13.5px;
	transition: background-color 0.2s;
}

.btn-primary:hover {
	background-color: var(--primary-hover);
}

/* === Макет страницы: Сайдбар + Контент === */
.docs-layout {
	display: flex;
	max-width: 1440px;
	margin: 64px auto 0;
	min-height: calc(100vh - 64px);
}

/* === Левое оглавление === */
.sidebar {
	width: var(--sidebar-w);
	flex-shrink: 0;
	background: #ffffff;
	border-right: 1px solid var(--border);
	position: sticky;
	top: 64px;
	height: calc(100vh - 64px);
	overflow-y: auto;
	padding: 20px 16px 40px;
}

.search-box {
	margin-bottom: 18px;
}

.search-box input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font-size: 13px;
	outline: none;
	background: var(--bg-color);
	transition: border-color 0.2s, background 0.2s;
}

.search-box input:focus {
	border-color: var(--primary);
	background: #ffffff;
}

.nav-group-title {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	padding: 12px 10px 6px;
}

.nav-list {
	list-style: none;
}

.nav-list a {
	display: block;
	padding: 7px 10px;
	border-radius: 7px;
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--text-muted);
	transition: all 0.15s;
	margin-bottom: 2px;
}

.nav-list a:hover {
	background: #f1f5f9;
	color: var(--text-main);
}

.nav-list a.active {
	background: var(--primary-light);
	color: var(--primary-hover);
	font-weight: 700;
}

/* === Основной контент === */
.content {
	flex: 1;
	min-width: 0;
	padding: 48px 56px 96px;
	max-width: 980px;
}

.doc-section {
	margin-bottom: 72px;
	padding-bottom: 48px;
	border-bottom: 1px solid var(--border);
}

.doc-section:last-child {
	border-bottom: none;
}

.section-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--primary);
	background: var(--primary-light);
	padding: 4px 10px;
	border-radius: 6px;
	margin-bottom: 12px;
}

h1 {
	font-size: 38px;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 16px;
}

h2 {
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.015em;
	margin-bottom: 16px;
	color: var(--text-main);
}

h3 {
	font-size: 20px;
	font-weight: 700;
	margin: 28px 0 12px;
	color: var(--text-main);
}

h4 {
	font-size: 16px;
	font-weight: 700;
	margin: 18px 0 8px;
	color: var(--text-main);
}

p {
	font-size: 15.5px;
	color: var(--text-muted);
	margin-bottom: 16px;
}

ul, ol {
	padding-left: 24px;
	margin-bottom: 18px;
	color: var(--text-muted);
	font-size: 15px;
}

li {
	margin-bottom: 8px;
}

li strong {
	color: var(--text-main);
}

/* === Информационные плашки (Callouts) === */
.callout {
	border-radius: 12px;
	padding: 16px 20px;
	margin: 20px 0;
	font-size: 14.5px;
	border-left: 4px solid var(--primary);
	background: #ffffff;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.callout-title {
	font-weight: 700;
	color: var(--text-main);
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.callout.warn {
	border-left-color: var(--accent);
	background: var(--accent-light);
}

.callout.tip {
	border-left-color: var(--primary);
	background: var(--primary-light);
}

/* === Карточки и таблицы === */
.cards-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	margin: 20px 0;
}

.info-card {
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 20px;
}

.info-card h4 {
	margin-top: 0;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.tag {
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 700;
	background: #f1f5f9;
	color: #475569;
}

.doc-table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
	background: #ffffff;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--border);
	font-size: 14px;
}

.doc-table th {
	background: #f1f5f9;
	text-align: left;
	padding: 12px 16px;
	font-weight: 700;
	color: var(--text-main);
	border-bottom: 1px solid var(--border);
}

.doc-table td {
	padding: 12px 16px;
	border-bottom: 1px solid #f1f5f9;
	color: var(--text-muted);
	vertical-align: top;
}

.doc-table tr:last-child td {
	border-bottom: none;
}

/* === Код и формулы === */
code {
	font-family: 'JetBrains Mono', Consolas, monospace;
	font-size: 13px;
	background: #e2e8f0;
	color: #0f172a;
	padding: 2px 6px;
	border-radius: 5px;
}

pre {
	background: var(--code-bg);
	color: #6ee7b7;
	padding: 16px 20px;
	border-radius: 10px;
	overflow-x: auto;
	font-family: 'JetBrains Mono', Consolas, monospace;
	font-size: 13.5px;
	margin: 14px 0 20px;
	line-height: 1.55;
}

/* === Блоки для скриншотов === */
.doc-figure {
	margin: 28px auto;
	width: fit-content;
	max-width: 100%;
	height: fit-content;
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 10px;
	box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.doc-figure img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.doc-figure figcaption {
	width: 0;
	min-width: 100%; /* Не даёт длинному тексту подписи растягивать рамку шире картинки */
	font-size: 13px;
	color: #64748b;
	text-align: center;
	margin-top: 10px;
}

.screenshot-todo {
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border: 2px dashed #94a3b8;
	border-radius: 10px;
	padding: 28px 24px;
	text-align: center;
	color: #334155;
	font-size: 13.5px;
}

.screenshot-todo strong {
	display: block;
	color: #0f172a;
	font-size: 15px;
	margin-bottom: 6px;
}

.feature-image {
	flex: 1.25;
	display: flex;
	justify-content: center;
	align-items: center;
	align-self: center;      /* Не дает flex-контейнеру растягивать блок по высоте */
	height: fit-content;
}

.feature-image img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;            /* Высота рамки (border + padding на самом img) равна высоте картинки */
	border-radius: 14px;
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.05);
	border: 1px solid var(--border);
	background-color: white;
	padding: 8px;
	cursor: zoom-in;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
}
.lang-switcher a {
    padding: 6px 10px;
    color: #64748b;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.lang-switcher a:hover { background: #f1f5f9; color: #0f172a; }
.lang-switcher a.active { background: var(--primary, #0d9488); color: #fff; }

@media (max-width: 992px) {
	.sidebar {
		display: none;
	}
	.content {
		padding: 32px 20px 64px;
	}
	.cards-grid {
		grid-template-columns: 1fr;
	}
}