/**
 * TradeCRM — стили сайта.
 *
 * Строение файла:
 *   1. Токены
 *   2. Сброс и база
 *   3. Раскладка
 *   4. Кнопки и формы
 *   5. Шапка и подвал
 *   6. Главная и маркетинговые секции
 *   7. Интеграции
 *   8. Документация
 *   9. Блог и служебные страницы
 *  10. Модальное окно
 */

/* ------------------------------------------------------------------ *
 * 1. Токены
 * ------------------------------------------------------------------ */

:root {
	--brand: #0b1a6b;
	--brand-dark: #060e3d;
	--brand-light: #2a3fa0;
	/* Фирменный синий старого сайта. Своего акцентного цвета у бренда нет:
	   весь сайт строился на оттенках индиго, и зелёная кнопка в нём выглядит
	   чужеродно. Поэтому «акцент» — это тот же синий, только насыщеннее. */
	--accent: #16297f;
	--accent-dark: #0e1c5e;

	--text: #0e1222;
	--muted: #5b6480;
	--bg: #ffffff;
	--surface: #f5f7fb;
	--border: #e3e8f2;

	--ok: #1ba863;
	--error: #e0333c;

	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: 4rem;
	--space-9: 6rem;

	--radius-s: 8px;
	--radius-m: 12px;
	--radius-l: 20px;

	--shadow-s: 0 1px 2px rgba(6, 14, 61, 0.06), 0 2px 8px rgba(6, 14, 61, 0.04);
	--shadow-m: 0 4px 12px rgba(6, 14, 61, 0.08), 0 12px 32px rgba(6, 14, 61, 0.06);
	--shadow-l: 0 16px 48px rgba(6, 14, 61, 0.14);

	--container: 1200px;
	--gutter: 1rem;

	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

	--header-height: 68px;
	--transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
	:root {
		--gutter: 2rem;
	}
}

/* ------------------------------------------------------------------ *
 * 2. Сброс и база
 * ------------------------------------------------------------------ */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
	margin: 0;
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--brand);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color var(--transition);
}

a:hover {
	color: var(--brand-light);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 var(--space-4);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.015em;
	color: var(--brand-dark);
	text-wrap: balance;
}

h1 {
	font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

h2 {
	font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
}

h3 {
	font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
}

p {
	margin: 0 0 var(--space-4);
	text-wrap: pretty;
}

hr {
	height: 1px;
	margin: var(--space-6) 0;
	border: 0;
	background: var(--border);
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

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

th {
	font-weight: 600;
	color: var(--brand-dark);
	background: var(--surface);
}

code,
pre {
	font-family: var(--font-mono);
	font-size: 0.9em;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: var(--space-3);
	left: var(--space-3);
	z-index: 1000;
	width: auto;
	height: auto;
	padding: var(--space-3) var(--space-4);
	clip-path: none;
	color: #fff;
	background: var(--brand);
	border-radius: var(--radius-s);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ------------------------------------------------------------------ *
 * 3. Раскладка
 * ------------------------------------------------------------------ */

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.site-main {
	min-height: 50vh;
	padding-block: var(--space-6) var(--space-9);
}

.section {
	padding-block: var(--space-8);
}

.section--soft {
	background: var(--surface);
}

.section__title {
	margin-bottom: var(--space-3);
	text-align: center;
}

.section__lead {
	max-width: 46rem;
	margin-inline: auto;
	margin-bottom: var(--space-6);
	color: var(--muted);
	text-align: center;
}

.page-head {
	margin-bottom: var(--space-6);
}

.page-head__title {
	margin-bottom: var(--space-3);
}

.page-head__text {
	max-width: 46rem;
	color: var(--muted);
	font-size: 1.0625rem;
}

.entry-content--narrow {
	max-width: 48rem;
}

.entry-content > * + * {
	margin-top: var(--space-4);
}

.entry-content h2 {
	margin-top: var(--space-7);
}

.entry-content h3 {
	margin-top: var(--space-6);
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.25rem;
}

.entry-content li + li {
	margin-top: var(--space-2);
}

.entry-content img {
	border-radius: var(--radius-m);
}

.entry-content figure {
	margin: var(--space-5) 0;
}

.entry-content figcaption {
	margin-top: var(--space-2);
	font-size: 0.875rem;
	color: var(--muted);
}

.empty {
	padding: var(--space-7) 0;
	color: var(--muted);
	text-align: center;
}

/* ------------------------------------------------------------------ *
 * 4. Кнопки и формы
 * ------------------------------------------------------------------ */

.button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	padding: 0.8rem 1.5rem;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	background: var(--brand);
	border: 1px solid transparent;
	border-radius: var(--radius-m);
	transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.button:hover,
.wp-block-button__link:hover {
	color: #fff;
	background: var(--brand-light);
	transform: translateY(-1px);
	box-shadow: var(--shadow-m);
}

.button:active {
	transform: translateY(0);
}

.button--accent {
	color: var(--brand-dark);
	background: var(--accent);
}

.button--accent:hover {
	color: var(--brand-dark);
	background: var(--accent-dark);
}

.button--ghost {
	color: var(--brand);
	background: transparent;
	border-color: var(--border);
}

.button--ghost:hover {
	color: var(--brand);
	background: var(--surface);
	border-color: var(--brand-light);
}

.button--compact {
	padding: 0.55rem 1.1rem;
	font-size: 0.9375rem;
}

.tcrm-form {
	max-width: 42rem;
	padding: var(--space-6);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-s);
}

.tcrm-form--compact {
	padding: var(--space-5);
	border: 0;
	box-shadow: none;
}

.tcrm-form__title {
	margin-bottom: var(--space-5);
	font-size: 1.5rem;
}

.tcrm-form__grid {
	display: grid;
	gap: var(--space-4);
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.tcrm-form__grid {
		grid-template-columns: 1fr 1fr;
	}

	.tcrm-field--wide {
		grid-column: 1 / -1;
	}
}

.tcrm-field {
	margin: 0;
}

.tcrm-field label {
	display: block;
	margin-bottom: var(--space-1);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--brand-dark);
}

.tcrm-field label small {
	font-weight: 400;
	color: var(--muted);
}

.tcrm-field input[type="text"],
.tcrm-field input[type="tel"],
.tcrm-field input[type="email"],
.tcrm-field textarea,
.search-form__field,
.doc-search__field {
	width: 100%;
	padding: 0.7rem 0.9rem;
	font: inherit;
	color: var(--text);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-s);
	transition: border-color var(--transition), box-shadow var(--transition);
}

.tcrm-field input:focus,
.tcrm-field textarea:focus,
.search-form__field:focus,
.doc-search__field:focus {
	border-color: var(--brand-light);
	outline: none;
	box-shadow: 0 0 0 3px rgba(42, 63, 160, 0.14);
}

.tcrm-field--consent {
	margin-top: var(--space-4);
}

.tcrm-field--consent label {
	display: flex;
	gap: var(--space-2);
	align-items: flex-start;
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--muted);
}

.tcrm-field__error {
	display: block;
	margin-top: var(--space-1);
	font-size: 0.8125rem;
	color: var(--error);
}

.tcrm-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.tcrm-form__submit {
	margin-top: var(--space-5);
	width: 100%;
}

@media (min-width: 640px) {
	.tcrm-form__submit {
		width: auto;
	}
}

.tcrm-form__result {
	margin: var(--space-3) 0 0;
	font-size: 0.9375rem;
}

.tcrm-form__result.is-ok {
	color: var(--ok);
}

.tcrm-form__result.is-error {
	color: var(--error);
}

.tcrm-form.is-sent .tcrm-form__grid,
.tcrm-form.is-sent .tcrm-field--consent,
.tcrm-form.is-sent .tcrm-form__submit {
	display: none;
}

.search-form {
	display: flex;
	gap: var(--space-2);
	max-width: 32rem;
}

/* ------------------------------------------------------------------ *
 * 5. Шапка и подвал
 * ------------------------------------------------------------------ */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--border);
	transition: box-shadow var(--transition);
}

.site-header.is-stuck {
	box-shadow: var(--shadow-s);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--space-5);
	min-height: var(--header-height);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none;
	color: var(--brand-dark);
}

.brand__mark {
	padding: 0.15rem 0.4rem;
	color: #fff;
	background: var(--brand);
	border-radius: 6px;
}

.brand--light,
.brand--light .brand__word {
	color: #fff;
}

.brand--light .brand__mark {
	background: var(--accent);
	color: var(--brand-dark);
}

.site-header__burger {
	position: relative;
	width: 42px;
	height: 42px;
	margin-left: auto;
	cursor: pointer;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-s);
}

.burger__bar,
.burger__bar::before,
.burger__bar::after {
	position: absolute;
	left: 50%;
	width: 18px;
	height: 2px;
	background: var(--brand-dark);
	border-radius: 2px;
	transform: translateX(-50%);
	transition: transform var(--transition), opacity var(--transition);
}

.burger__bar {
	top: 50%;
	margin-top: -1px;
}

.burger__bar::before,
.burger__bar::after {
	content: "";
	left: 0;
	transform: none;
}

.burger__bar::before {
	top: -6px;
}

.burger__bar::after {
	top: 6px;
}

.site-header__burger[aria-expanded="true"] .burger__bar {
	background: transparent;
}

.site-header__burger[aria-expanded="true"] .burger__bar::before {
	transform: translateY(6px) rotate(45deg);
}

.site-header__burger[aria-expanded="true"] .burger__bar::after {
	transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
	display: none;
}

.site-nav.is-open {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	display: block;
	padding: var(--space-4) var(--gutter) var(--space-6);
	background: #fff;
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow-m);
}

.site-nav__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a {
	display: block;
	padding: var(--space-2) 0;
	font-weight: 600;
	text-decoration: none;
	color: var(--brand-dark);
}

.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
	color: var(--brand);
}

.site-nav__actions {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	margin-top: var(--space-4);
}

@media (min-width: 1024px) {
	.site-header__burger {
		display: none;
	}

	.site-nav {
		display: flex;
		align-items: center;
		gap: var(--space-6);
		margin-left: auto;
	}

	.site-nav__list {
		flex-direction: row;
		align-items: center;
		gap: var(--space-5);
	}

	.site-nav__list a {
		position: relative;
		padding: 0;
		font-size: 0.9375rem;
	}

	.site-nav__list a::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: -6px;
		height: 2px;
		background: var(--accent);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform var(--transition);
	}

	.site-nav__list a:hover::after,
	.site-nav__list .current-menu-item > a::after {
		transform: scaleX(1);
	}

	.site-nav__actions {
		margin-top: 0;
	}
}

.lang {
	display: inline-flex;
	gap: 2px;
	padding: 2px;
	background: var(--surface);
	border-radius: 999px;
}

.lang__item {
	padding: 0.25rem 0.7rem;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--muted);
	border-radius: 999px;
	transition: background var(--transition), color var(--transition);
}

.lang__item.is-current {
	color: #fff;
	background: var(--brand);
}

.site-footer {
	color: rgba(255, 255, 255, 0.78);
	background: var(--brand-dark);
}

.site-footer__inner {
	display: grid;
	gap: var(--space-6);
	padding-block: var(--space-8);
}

@media (min-width: 900px) {
	.site-footer__inner {
		grid-template-columns: 1.3fr 1fr 1fr;
		gap: var(--space-7);
	}
}

.site-footer__tagline {
	margin-top: var(--space-3);
	max-width: 26rem;
	font-size: 0.9375rem;
}

.site-footer__list,
.site-footer__legal {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
}

.site-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer__cta-text {
	font-size: 1.0625rem;
	color: #fff;
}

.site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__bottom-inner {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	align-items: center;
	justify-content: space-between;
	padding-block: var(--space-4);
	font-size: 0.875rem;
}

.site-footer__legal {
	flex-direction: row;
	gap: var(--space-4);
}

.site-footer__copy {
	margin: 0;
}

/* ------------------------------------------------------------------ *
 * 6. Главная и маркетинговые секции
 * ------------------------------------------------------------------ */

.entry-content--full {
	max-width: none;
}

.hero {
	position: relative;
	padding-block: var(--space-8) var(--space-9);
	color: #fff;
	background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
	overflow: hidden;
}

.hero::after {
	content: "";
	position: absolute;
	top: -30%;
	right: -10%;
	width: 60vw;
	height: 60vw;
	background: radial-gradient(circle, rgba(0, 194, 168, 0.22) 0%, transparent 65%);
	pointer-events: none;
}

.hero__inner {
	position: relative;
	display: grid;
	gap: var(--space-7);
	align-items: center;
}

@media (min-width: 1024px) {
	.hero__inner {
		grid-template-columns: 1.05fr 1fr;
	}
}

.hero h1,
.hero h2 {
	color: #fff;
}

.hero__lead {
	max-width: 36rem;
	font-size: 1.125rem;
	color: rgba(255, 255, 255, 0.85);
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-top: var(--space-5);
}

.hero__media {
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-l);
	overflow: hidden;
}

.band {
	margin-block: var(--space-8);
	padding: var(--space-7) var(--space-6);
	text-align: center;
	border-radius: var(--radius-l);
}

.band--soft {
	background: var(--surface);
}

.band--brand {
	color: #fff;
	background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.band--brand .band__title {
	color: #fff;
}

.band__text {
	max-width: 42rem;
	margin-inline: auto;
	color: var(--muted);
}

.band--brand .band__text {
	color: rgba(255, 255, 255, 0.85);
}

.features {
	display: grid;
	gap: var(--space-5);
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.feature {
	padding: var(--space-5);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-l);
	transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.feature:hover {
	border-color: var(--brand-light);
	box-shadow: var(--shadow-m);
	transform: translateY(-2px);
}

.feature__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: var(--space-3);
	color: var(--brand);
	background: var(--surface);
	border-radius: var(--radius-m);
}

.feature__title {
	margin-bottom: var(--space-2);
	font-size: 1.125rem;
}

.feature__text {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--muted);
}

.quotes {
	display: grid;
	gap: var(--space-5);
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.quote {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	padding: var(--space-5);
	background: #fff;
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-m);
}

.quote__text {
	margin: 0;
	font-size: 0.9375rem;
}

.quote__author {
	margin-top: auto;
	font-size: 0.875rem;
	color: var(--muted);
}

.quote__name {
	display: block;
	font-weight: 600;
	color: var(--brand-dark);
}

.plans {
	display: grid;
	gap: var(--space-5);
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.plan {
	display: flex;
	flex-direction: column;
	padding: var(--space-6);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-l);
}

.plan--featured {
	border-color: var(--brand);
	box-shadow: var(--shadow-m);
}

.plan__name {
	font-size: 1.125rem;
}

.plan__price {
	margin-bottom: var(--space-4);
	font-size: 2rem;
	font-weight: 700;
	color: var(--brand);
}

.plan__list {
	flex: 1 1 auto;
	margin: 0 0 var(--space-5);
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
}

.plan__list li {
	padding-left: 1.6rem;
	position: relative;
	margin-bottom: var(--space-2);
}

.plan__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 0.9rem;
	height: 0.45rem;
	border-left: 2px solid var(--accent);
	border-bottom: 2px solid var(--accent);
	transform: rotate(-45deg);
}

/* ------------------------------------------------------------------ *
 * 7. Интеграции
 * ------------------------------------------------------------------ */

.integrations {
	display: grid;
	gap: var(--space-3);
	grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}

.integration {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: 8.5rem;
	padding: var(--space-4);
	text-align: center;
	text-decoration: none;
	color: var(--brand-dark);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-m);
	transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.integration:hover {
	color: var(--brand);
	border-color: var(--brand-light);
	box-shadow: var(--shadow-m);
	transform: translateY(-2px);
}

.integration__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 2.75rem;
}

/* Логотипы приходят разного цвета и размера. Приводим к одному виду:
   общий фирменный тон и одинаковая оптическая высота. При наведении
   логотип становится обычным, цветным. */
.integration__img {
	max-height: 100%;
	width: auto;
	object-fit: contain;
	filter: grayscale(1) brightness(0.35) sepia(1) hue-rotate(205deg) saturate(3);
	opacity: 0.85;
	transition: filter var(--transition), opacity var(--transition);
}

.integration:hover .integration__img {
	filter: none;
	opacity: 1;
}

.integration__wordmark {
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--brand);
}

.integration__name {
	font-size: 0.875rem;
	font-weight: 600;
}

.integration--text .integration__name {
	display: none;
}

.integration__hint {
	font-size: 0.75rem;
	color: var(--muted);
	opacity: 0;
	transition: opacity var(--transition);
}

.integration:hover .integration__hint {
	opacity: 1;
}

.integrations-groups {
	display: flex;
	flex-direction: column;
	gap: var(--space-7);
}

.integrations-group__title {
	margin-bottom: var(--space-2);
	font-size: 1.25rem;
}

.integrations-group__note {
	margin-bottom: var(--space-4);
	font-size: 0.9375rem;
	color: var(--muted);
}

.integrations--strip {
	grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

.integrations__more {
	margin-top: var(--space-5);
	text-align: center;
}

/* ------------------------------------------------------------------ *
 * 8. Документация
 * ------------------------------------------------------------------ */

.doc {
	display: grid;
	gap: var(--space-6);
	align-items: start;
}

@media (min-width: 900px) {
	.doc {
		grid-template-columns: 17rem minmax(0, 1fr);
	}
}

@media (min-width: 1280px) {
	.doc {
		grid-template-columns: 17rem minmax(0, 1fr) 14rem;
	}
}

.doc__nav-toggle {
	width: 100%;
}

@media (min-width: 900px) {
	.doc__nav-toggle {
		display: none;
	}
}

.doc__sidebar {
	display: none;
}

.doc__sidebar.is-open {
	display: block;
}

@media (min-width: 900px) {
	.doc__sidebar {
		position: sticky;
		top: calc(var(--header-height) + var(--space-4));
		display: block;
		max-height: calc(100vh - var(--header-height) - var(--space-6));
		padding-right: var(--space-2);
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

.doc-search {
	position: relative;
	display: flex;
	margin-bottom: var(--space-4);
}

.doc-search__field {
	padding-right: 2.5rem;
}

.doc-search__submit {
	position: absolute;
	top: 50%;
	right: 0.35rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	color: var(--muted);
	cursor: pointer;
	background: transparent;
	border: 0;
	transform: translateY(-50%);
}

.doc-search__results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 20;
	max-height: 60vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-s);
	box-shadow: var(--shadow-m);
}

.doc-search__results a {
	display: block;
	padding: var(--space-3) var(--space-4);
	font-size: 0.9375rem;
	text-decoration: none;
	color: var(--text);
	border-bottom: 1px solid var(--border);
}

.doc-search__results a:last-child {
	border-bottom: 0;
}

.doc-search__results a:hover,
.doc-search__results a:focus {
	background: var(--surface);
}

.doc-search__empty {
	padding: var(--space-3) var(--space-4);
	font-size: 0.875rem;
	color: var(--muted);
}

.doc-tree__list {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
}

.doc-tree__list--level-1,
.doc-tree__list--level-2 {
	display: none;
	margin-left: var(--space-3);
	padding-left: var(--space-3);
	border-left: 1px solid var(--border);
}

.doc-tree__item.is-open > .doc-tree__list {
	display: block;
}

.doc-tree__row {
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

.doc-tree__link {
	flex: 1 1 auto;
	padding: 0.3rem 0;
	text-decoration: none;
	color: var(--text);
	border-radius: 4px;
}

.doc-tree__link:hover {
	color: var(--brand);
}

.doc-tree__item.is-current > .doc-tree__row > .doc-tree__link {
	font-weight: 600;
	color: var(--brand);
}

.doc-tree__item.is-current > .doc-tree__row {
	position: relative;
}

.doc-tree__item.is-current > .doc-tree__row::before {
	content: "";
	position: absolute;
	left: calc(var(--space-3) * -1 - 1px);
	top: 0.35rem;
	bottom: 0.35rem;
	width: 2px;
	background: var(--accent);
	border-radius: 2px;
}

.doc-tree__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 4px;
}

.doc-tree__toggle span {
	width: 0.45rem;
	height: 0.45rem;
	border-right: 2px solid var(--muted);
	border-bottom: 2px solid var(--muted);
	transform: rotate(-45deg);
	transition: transform var(--transition);
}

.doc-tree__toggle[aria-expanded="true"] span {
	transform: rotate(45deg);
}

.doc__content {
	min-width: 0;
}

.doc__title {
	margin-bottom: var(--space-4);
}

.doc__lead {
	font-size: 1.0625rem;
	color: var(--muted);
}

.doc__body img {
	display: block;
	margin: var(--space-4) auto;
	border: 1px solid var(--border);
	border-radius: var(--radius-m);
	box-shadow: var(--shadow-s);
	cursor: zoom-in;
}

.doc__body img.aligncenter {
	margin-inline: auto;
}

.doc__body h2,
.doc__body h3 {
	scroll-margin-top: calc(var(--header-height) + 1rem);
}

.doc__footer {
	margin-top: var(--space-7);
	padding-top: var(--space-5);
	border-top: 1px solid var(--border);
}

.doc__updated {
	font-size: 0.875rem;
	color: var(--muted);
}

.doc-children {
	margin-top: var(--space-6);
	padding: var(--space-5);
	background: var(--surface);
	border-radius: var(--radius-m);
}

.doc-children__title {
	margin-bottom: var(--space-3);
	font-size: 1.125rem;
}

.doc-children__list {
	display: grid;
	gap: var(--space-2);
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
}

.doc-pager {
	display: grid;
	gap: var(--space-3);
	margin: var(--space-5) 0;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.doc-pager__link {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: var(--space-3) var(--space-4);
	text-decoration: none;
	border: 1px solid var(--border);
	border-radius: var(--radius-m);
	transition: border-color var(--transition), box-shadow var(--transition);
}

.doc-pager__link:hover {
	border-color: var(--brand-light);
	box-shadow: var(--shadow-s);
}

.doc-pager__link--next {
	text-align: right;
}

.doc-pager__label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--muted);
}

.doc-pager__title {
	font-weight: 600;
	color: var(--brand-dark);
}

.doc__help {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	align-items: center;
	justify-content: space-between;
	padding: var(--space-4) var(--space-5);
	background: var(--surface);
	border-radius: var(--radius-m);
}

.doc__help p {
	margin: 0;
	font-weight: 600;
	color: var(--brand-dark);
}

.doc__toc {
	display: none;
}

@media (min-width: 1280px) {
	.doc__toc {
		position: sticky;
		top: calc(var(--header-height) + var(--space-4));
		display: block;
	}
}

.doc-toc__title {
	margin-bottom: var(--space-2);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
}

.doc-toc__list {
	margin: 0;
	padding-left: var(--space-3);
	list-style: none;
	border-left: 1px solid var(--border);
	font-size: 0.875rem;
}

.doc-toc__item--level-3 {
	padding-left: var(--space-3);
}

.doc-toc__list a {
	display: block;
	padding: 0.25rem 0;
	text-decoration: none;
	color: var(--muted);
}

.doc-toc__list a:hover,
.doc-toc__list a.is-active {
	color: var(--brand);
}

.doc-cards {
	display: grid;
	gap: var(--space-4);
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.doc-card {
	display: flex;
	gap: var(--space-4);
	align-items: center;
	padding: var(--space-5);
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-l);
	transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.doc-card:hover {
	border-color: var(--brand-light);
	box-shadow: var(--shadow-m);
	transform: translateY(-2px);
}

.doc-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 3rem;
	height: 3rem;
	background: var(--surface);
	border-radius: var(--radius-m);
	overflow: hidden;
}

.doc-card__title {
	display: block;
	font-weight: 600;
	color: var(--brand-dark);
}

.doc-card__count {
	font-size: 0.8125rem;
	color: var(--muted);
}

.page-head--doc {
	display: grid;
	gap: var(--space-4);
	align-items: center;
}

@media (min-width: 900px) {
	.page-head--doc {
		grid-template-columns: 1fr 22rem;
	}
}

/* ------------------------------------------------------------------ *
 * 9. Блог и служебные страницы
 * ------------------------------------------------------------------ */

.filter {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-bottom: var(--space-6);
}

.filter__item {
	padding: 0.4rem 0.9rem;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--muted);
	background: var(--surface);
	border-radius: 999px;
	transition: background var(--transition), color var(--transition);
}

.filter__item:hover {
	color: var(--brand);
}

.filter__item.is-current {
	color: #fff;
	background: var(--brand);
}

.cards {
	display: grid;
	gap: var(--space-5);
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-l);
	transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
	border-color: var(--brand-light);
	box-shadow: var(--shadow-m);
	transform: translateY(-2px);
}

.card__media img {
	width: 100%;
	aspect-ratio: 12 / 7;
	object-fit: cover;
}

.card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	padding: var(--space-5);
}

.card__label {
	align-self: flex-start;
	padding: 0.15rem 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--brand);
	background: var(--surface);
	border-radius: 999px;
}

.card__title {
	margin: 0;
	font-size: 1.125rem;
}

.card__title a {
	text-decoration: none;
	color: var(--brand-dark);
}

.card__title a:hover {
	color: var(--brand);
}

.card__excerpt {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--muted);
}

.card__date {
	font-size: 0.8125rem;
	color: var(--muted);
}

.post__head {
	max-width: 48rem;
	margin-bottom: var(--space-5);
}

.post__meta {
	color: var(--muted);
	font-size: 0.875rem;
}

.post__media {
	margin: 0 0 var(--space-6);
}

.post__media img {
	width: 100%;
	border-radius: var(--radius-l);
}

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

.results__item {
	padding: var(--space-5) 0;
	border-bottom: 1px solid var(--border);
}

.results__label {
	display: inline-block;
	margin-bottom: var(--space-1);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--muted);
}

.results__title {
	margin: 0 0 var(--space-2);
	font-size: 1.25rem;
}

.results__excerpt {
	margin: 0;
	color: var(--muted);
	font-size: 0.9375rem;
}

.breadcrumbs {
	margin-bottom: var(--space-4);
	font-size: 0.8125rem;
	color: var(--muted);
}

.breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumbs__item + .breadcrumbs__item::before {
	content: "/";
	margin-right: var(--space-2);
	color: var(--border);
}

.breadcrumbs a {
	text-decoration: none;
	color: var(--muted);
}

.breadcrumbs a:hover {
	color: var(--brand);
}

.error-page {
	max-width: 36rem;
	padding-block: var(--space-8);
	text-align: center;
}

.error-page__code {
	margin: 0;
	font-size: clamp(4rem, 12vw, 7rem);
	font-weight: 800;
	line-height: 1;
	color: var(--surface);
}

.error-page__text {
	color: var(--muted);
}

.error-page .search-form {
	margin: var(--space-5) auto;
}

.error-page__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	justify-content: center;
}

.integration-page__head {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	align-items: center;
	margin-bottom: var(--space-5);
}

.integration-page__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 3.5rem;
	padding: var(--space-3);
	background: var(--surface);
	border-radius: var(--radius-m);
}

.integration-page__title {
	margin: 0;
}

.integration-page__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-top: var(--space-6);
}

.pagination {
	margin-top: var(--space-7);
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4rem;
	height: 2.4rem;
	margin-right: var(--space-1);
	padding: 0 0.5rem;
	font-size: 0.9375rem;
	text-decoration: none;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: var(--radius-s);
}

.pagination .page-numbers.current {
	color: #fff;
	background: var(--brand);
	border-color: var(--brand);
}

.icon {
	width: 1.1em;
	height: 1.1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ------------------------------------------------------------------ *
 * 10. Модальное окно
 * ------------------------------------------------------------------ */

.modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--gutter);
}

.modal[hidden] {
	display: none;
}

.modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 14, 61, 0.55);
	backdrop-filter: blur(2px);
}

.modal__dialog {
	position: relative;
	width: 100%;
	max-width: 36rem;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-l);
	animation: modal-in 220ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes modal-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

.modal__close {
	position: absolute;
	top: var(--space-3);
	right: var(--space-3);
	width: 2.25rem;
	height: 2.25rem;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--muted);
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 50%;
}

.modal__close:hover {
	color: var(--brand);
	background: var(--surface);
}

body.is-modal-open {
	overflow: hidden;
}

/* Просмотр скриншота во весь экран. */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-5);
	background: rgba(6, 14, 61, 0.9);
	cursor: zoom-out;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: var(--radius-s);
	box-shadow: var(--shadow-l);
}

/* Описание под названием интеграции — только на странице со списком. */
.integration__note {
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--muted);
}

.integrations--with-notes .integration {
	min-height: 11rem;
	justify-content: flex-start;
	padding-block: var(--space-5);
}

/* Блок «Головний екран»: разметку строит PHP, классы ниже. */
.hero__content {
	min-width: 0;
}

.hero__kicker {
	margin-bottom: var(--space-2);
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent);
}

.hero__title {
	color: #fff;
}

.hero__media img {
	display: block;
	width: 100%;
}

/* Поиск внутри секции инструкций на главной. */
.section__search {
	max-width: 32rem;
	margin: 0 auto var(--space-5);
}

/* Секции, собранные блоками, уже содержат свой контейнер. */
.entry-content--full > .section,
.entry-content--full > .hero {
	margin-block: 0;
}

/* ------------------------------------------------------------------ *
 * 11. Правки по итогам проверки в браузере
 * ------------------------------------------------------------------ */

/* Вторая кнопка в hero была почти не видна: ghost-кнопка рисует тёмно-синий
   текст на тёмно-синем фоне. На тёмных секциях делаем её светлой. */
.hero .button--ghost,
.band--brand .button--ghost {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.45);
}

.hero .button--ghost:hover,
.band--brand .button--ghost:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.8);
}

/* Логотипы интеграций приходят в разном виде: часть на прозрачном фоне,
   часть — картинкой с белой или серой подложкой. Прежний цветовой фильтр
   из-за этого давал пёструю сетку. Умножение убирает белые подложки на
   белой карточке, обесцвечивание приводит всё к одному тону, а при
   наведении логотип показывается как есть. */
.integration__img {
	filter: grayscale(1) contrast(1.05);
	opacity: 0.72;
	mix-blend-mode: multiply;
}

.integration:hover .integration__img {
	filter: none;
	opacity: 1;
	mix-blend-mode: normal;
}

/* Карточка раздела инструкций без обложки не должна проваливаться по высоте. */
.doc-card {
	min-height: 5.5rem;
}

/* Шапка с фотографией во всю ширину — как было на прежнем сайте.
   Фото светлое, поэтому слева кладём мягкий синий градиент: без него
   белый заголовок на светло-сером фоне почти не читается. */
.hero--photo {
	position: relative;
	background-color: #eef1f6;
	background-repeat: no-repeat;
	background-position: right center;
	background-size: cover;
	padding-block: var(--space-9);
	overflow: hidden;
}

.hero--photo::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		100deg,
		rgba(6, 14, 61, 0.92) 0%,
		rgba(11, 26, 107, 0.82) 34%,
		rgba(11, 26, 107, 0.35) 56%,
		rgba(11, 26, 107, 0.05) 72%,
		rgba(11, 26, 107, 0) 85%
	);
}

.hero--photo::after {
	display: none;
}

.hero--photo .hero__inner {
	position: relative;
	grid-template-columns: 1fr;
	max-width: var(--container);
}

.hero--photo .hero__content {
	max-width: 36rem;
}

@media (min-width: 1024px) {
	.hero--photo .hero__inner {
		grid-template-columns: minmax(0, 0.62fr) minmax(0, 0.38fr);
	}

	.hero--photo {
		min-height: 34rem;
		display: flex;
		align-items: center;
	}
}

/* На узком экране фото уходит в фон целиком, текст перекрывает его полностью. */
@media (max-width: 767px) {
	.hero--photo::before {
		background: linear-gradient(
			160deg,
			rgba(6, 14, 61, 0.94) 0%,
			rgba(11, 26, 107, 0.86) 60%,
			rgba(11, 26, 107, 0.78) 100%
		);
	}
}

/* ------------------------------------------------------------------ *
 * 12. Корпоративный стиль: только фирменный синий
 * ------------------------------------------------------------------ */

/* Главная кнопка на светлом фоне — синяя с белым текстом, как на прежнем сайте. */
.button--accent {
	color: #fff;
	background: var(--accent);
}

.button--accent:hover {
	color: #fff;
	background: var(--accent-dark);
}

/* На тёмных секциях синяя кнопка сливается с фоном, поэтому там она белая
   с синим текстом — классическое корпоративное решение, контраст максимальный. */
.hero--photo .button--accent,
.band--brand .button--accent,
.hero .button--accent {
	color: var(--brand-dark);
	background: #fff;
}

.hero--photo .button--accent:hover,
.band--brand .button--accent:hover,
.hero .button--accent:hover {
	color: var(--brand-dark);
	background: #e8ecf7;
}

/* Мелкие акценты: вместо зелёного — фирменный синий. */
.quote {
	border-left-color: var(--brand);
}

.plan__list li::before {
	border-left-color: var(--brand);
	border-bottom-color: var(--brand);
}

.site-nav__list a::after {
	background: var(--brand);
}

.doc-tree__item.is-current > .doc-tree__row::before {
	background: var(--brand);
}

.hero__kicker {
	color: rgba(255, 255, 255, 0.72);
}

.brand--light .brand__mark {
	color: var(--brand-dark);
	background: #fff;
}

:focus-visible {
	outline-color: var(--brand-light);
}

.wp-block-quote {
	border-left-color: var(--brand) !important;
}

/* Пункт меню закрытого раздела: виден, но серый и не кликается. */
.menu-item--disabled > a,
.site-nav__list .menu-item--disabled > a,
.site-footer__list .menu-item--disabled > a {
	color: var(--muted);
	cursor: default;
	pointer-events: none;
	opacity: 0.65;
}

.site-nav__list .menu-item--disabled > a::after {
	display: none;
}

.menu-item--disabled > a::before {
	content: "";
}

/* Заглушка «раздел в разработке». */
.in-progress img {
	max-width: 480px;
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-s);
}

.entry-content .in-progress {
	margin-block: var(--space-7) var(--space-5);
}
