/*
 * AV-Security — «Услуги» page, section 04 «Комплексный подход»
 * ----------------------------------------------------------------------------
 * Interactive 3D demo (patterns/services-system.php,
 * assets/js/services-complex.js). Loaded only on /uslugi/, after
 * services.css. Everything is scoped to .av-cx; the band itself (navy,
 * glow, section padding, eyebrow / title / lead / button) stays in
 * services.css (.av-svc-system, .av-svc-*).
 *
 * Mock-up: av-security-services-section-04-mockup.png (1672×941,
 * /home/aleks/projects/av-security-references/).
 *
 * State on the section (set by the script):
 *   no attribute         — no script: static risk list, no switches
 *   data-av-cx="ui"      — script running, 3D still loading
 *   data-av-cx="3d"      — scene running
 *   data-av-cx="fallback"— no WebGL / import failed: risk list is the visual
 *
 * Layout: one grid in the site container (.av-cx__layout).
 *   Phones / tablets — copy, CTA, scene (full bleed), panel, cards.
 *   ≥1200px — copy + stages on the left with the scene behind them up to
 *   the right edge of the viewport; CTA | status panel in one row; the four
 *   cards joined to the panel underneath.
 *
 * Layer colours (guard amber, camera blue, access teal, pult violet) exist
 * only on the night scene and as small dots tying cards / log lines to it;
 * UI chrome uses the theme blues.
 */

.av-cx {
	--av-cx-h: 24rem;
	--av-cx-glass: rgba(10, 26, 43, 0.88);
	--av-cx-glass-line: rgba(150, 175, 215, 0.22);
	--av-cx-panel: rgba(8, 21, 37, 0.92);
	--av-cx-line: rgba(150, 175, 215, 0.16);
	--av-cx-text: #e6eefb;
	--av-cx-text-2: #9fb1cc;
	--av-cx-risk: var(--av-svc-red-on-navy);
	--av-cx-part: #ffb03b;
	--av-cx-ok: #4fe0c0;
	/* Container edge in viewport units (the scene is wider than the container). */
	--av-cx-edge: var(--wp--preset--spacing--50);
}

@media (min-width: 600px) {
	.av-cx {
		--av-cx-h: 30rem;
	}
}

@media (min-width: 769px) {
	.av-cx {
		--av-cx-edge: max(
			calc(var(--wp--preset--spacing--50) * 3),
			calc((100vw - var(--av-container)) / 2 + var(--wp--preset--spacing--50))
		);
	}
}

@media (min-width: 1200px) {
	.av-cx {
		--av-cx-h: 38rem;
	}
}

/* ------------------------------------------------------------ Layout grid */

.av-cx__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	row-gap: 0;
}

.av-cx__copy {
	position: relative;
	z-index: 3;
	max-width: 40rem;
}

.av-cx .av-svc-system__action {
	position: relative;
	z-index: 3;
	margin: 1.5rem 0 0;
}

.av-cx__scene {
	margin-top: 1.75rem;
}

/* ------------------------------------------------------------ Stages */

.av-cx__steps {
	display: grid;
	gap: 1rem;
	margin: 1.5rem 0 0;
	padding: 0;
	list-style: none;
}

.av-cx__step {
	position: relative;
	margin: 0;
}

/* Dotted connector between the circles (mock-up). */
.av-cx__step + .av-cx__step::before {
	content: "";
	position: absolute;
	bottom: calc(100% - 0.15rem);
	left: calc(1.5rem - 1px);
	height: 1.3rem;
	border-left: 2px dotted rgba(111, 163, 230, 0.55);
}

.av-services-page .av-cx__step-btn {
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr);
	gap: 1rem;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.av-cx__step-num {
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 3rem;
	height: 3rem;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 50%;
	background-color: rgba(10, 26, 43, 0.6);
	font-size: 0.9375rem;
	font-weight: 700;
	color: #fff;
	font-variant-numeric: tabular-nums;
	transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.av-cx__step-body {
	display: grid;
	gap: 0.2rem;
}

.av-cx__step-title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

.av-cx__step-text {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--av-svc-on-navy-text);
}

/* The mock-up shows no hint under the stage; it stays for screen readers. */
.av-cx__step-hint {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.av-cx__step:not(.is-on) .av-cx__step-hint {
	display: none;
}

.av-cx__step.is-on .av-cx__step-num {
	border-color: #3d8bff;
	background-color: var(--av-primary);
	box-shadow: 0 0 0 4px rgba(26, 95, 180, 0.28), 0 0 22px rgba(61, 139, 255, 0.55);
}

.av-cx__step.is-done .av-cx__step-num {
	border-color: var(--av-svc-on-navy);
}

.av-services-page .av-cx__step-btn:hover .av-cx__step-num {
	border-color: var(--av-svc-on-navy);
}

.av-cx:not([data-av-cx]) .av-cx__step-btn {
	cursor: default;
}

@media (min-width: 1200px) {
	.av-cx__steps {
		gap: 1.15rem;
		margin-top: 1.75rem;
	}

	.av-services-page .av-cx__step-btn {
		grid-template-columns: 3.25rem minmax(0, 1fr);
		gap: 1.1rem;
	}

	.av-cx__step-num {
		width: 3.25rem;
		height: 3.25rem;
	}

	.av-cx__step + .av-cx__step::before {
		left: calc(1.625rem - 1px);
	}
}

/* ------------------------------------------------------------ Scene */

.av-cx__scene {
	position: relative;
	z-index: 1;
	width: 100vw;
	height: var(--av-cx-h);
	margin-inline: calc(50% - 50vw);
	overflow: hidden;
	background: radial-gradient(70% 60% at 55% 45%, #10284a 0%, var(--av-svc-navy) 65%, #071322 100%);
}

.av-cx__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	cursor: grab;
	touch-action: pan-y;
}

.av-cx__canvas:active {
	cursor: grabbing;
}

/* Edges melt into the band's navy. */
.av-cx__fade {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background:
		linear-gradient(180deg, var(--av-svc-navy) 0%, rgba(10, 26, 43, 0) 12%),
		linear-gradient(0deg, var(--av-svc-navy) 0%, rgba(10, 26, 43, 0) 14%);
}

.av-cx__overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.av-cx__lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

/* Leader lines: thin, in the label's accent. */
.av-cx__lines line {
	stroke: var(--av-cx-a);
	stroke-width: 1.25;
	stroke-linecap: round;
	opacity: 0.85;
}

/* ------------------------------------------------------------ Labels
   Mock-up plates: translucent navy, thin border, accent icon tile, white
   title, muted line. Accent per label (one place for all three parts). */

.av-cx__call--access {
	--av-cx-a: #4fe0c0;
	--av-cx-a-bg: rgba(79, 224, 192, 0.14);
	--av-cx-a-line: rgba(79, 224, 192, 0.45);
}

.av-cx__call--cctv {
	--av-cx-a: #5b9dff;
	--av-cx-a-bg: rgba(91, 157, 255, 0.16);
	--av-cx-a-line: rgba(91, 157, 255, 0.5);
}

.av-cx__call--perimeter {
	--av-cx-a: #f0485c;
	--av-cx-a-bg: rgba(240, 72, 92, 0.15);
	--av-cx-a-line: rgba(240, 72, 92, 0.5);
}

.av-cx__call--guard {
	--av-cx-a: #ffc24b;
	--av-cx-a-bg: rgba(255, 194, 75, 0.15);
	--av-cx-a-line: rgba(255, 194, 75, 0.5);
}

.av-cx__call--pult {
	--av-cx-a: #9a8cff;
	--av-cx-a-bg: rgba(154, 140, 255, 0.16);
	--av-cx-a-line: rgba(154, 140, 255, 0.5);
}

.av-services-page .av-cx__call {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	box-sizing: border-box;
	margin: 0;
	padding: 0.5rem 0.8rem 0.5rem 0.5rem;
	white-space: nowrap;
	border: 1px solid rgba(150, 175, 215, 0.24);
	border-radius: 6px;
	background-color: rgba(9, 22, 40, 0.8);
	box-shadow: 0 12px 28px -20px rgba(0, 0, 0, 0.7);
	color: var(--av-cx-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	pointer-events: auto;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: border-color 0.2s ease, opacity 0.25s ease;
}

.av-cx__call-icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--av-cx-a-line);
	border-radius: 6px;
	background-color: var(--av-cx-a-bg);
	color: var(--av-cx-a);
}

.av-cx__call-body {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
}

.av-cx__call-title {
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
	color: #fff;
}

.av-cx__call-text {
	font-size: 0.6875rem;
	line-height: 1.35;
	color: var(--av-cx-text-2);
}

.av-services-page .av-cx__call:hover,
.av-cx__call.is-focus {
	border-color: var(--av-cx-a-line);
}

.av-cx__call.is-focus {
	background-color: rgba(9, 22, 40, 0.92);
	box-shadow: inset 0 0 0 1px var(--av-cx-a-line);
}

/* While one label is chosen the others step back. */
.av-cx__call.is-dim {
	opacity: 0.32;
}

.av-cx__lines line.is-dim,
.av-cx__anchor.is-dim {
	opacity: 0.25;
}

.av-cx__call.is-dim:hover,
.av-cx__call.is-dim:focus-visible {
	opacity: 1;
}

/* Anchor: small accent point on the model. */
.av-cx__anchor {
	position: absolute;
	top: 0;
	left: 0;
	box-sizing: border-box;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border: 2px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	background-color: var(--av-cx-a);
	box-shadow: 0 0 0 4px var(--av-cx-a-bg);
}

/* Narrow screens: one icon button per label above the model. */
.av-cx__chips {
	position: absolute;
	top: 0.75rem;
	left: var(--av-cx-edge);
	z-index: 4;
	display: flex;
	gap: 0.4rem;
}

.av-services-page .av-cx__chip {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(150, 175, 215, 0.24);
	border-radius: 6px;
	background-color: rgba(9, 22, 40, 0.8);
	color: var(--av-cx-a);
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.av-services-page .av-cx__chip[aria-pressed="true"] {
	border-color: var(--av-cx-a-line);
	background-color: var(--av-cx-a-bg);
}

@media (min-width: 1200px) {
	.av-cx__chips {
		display: none;
	}
}

/* Risk markers: «!» open / partial, «✓» closed. 21px (−19% from 26px) so
   they no longer outweigh the model; hover / focus / open tip restore the
   full size. */
.av-services-page .av-cx__marker {
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 21px;
	height: 21px;
	margin: -10.5px 0 0 -10.5px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--av-cx-risk);
	box-shadow: 0 0 0 3px rgba(240, 72, 92, 0.22);
	color: #fff;
	font: 700 0.6875rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	cursor: pointer;
	pointer-events: auto;
	transition: background-color 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease, scale 0.35s ease;
}

.av-cx__marker::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 1.5px solid rgba(240, 72, 92, 0.7);
	border-radius: 50%;
	animation: av-cx-ping 1.9s ease-out infinite;
}

.av-services-page .av-cx__marker.is-partial {
	background-color: var(--av-cx-part);
	box-shadow: 0 0 0 3px rgba(255, 176, 59, 0.22);
	color: #2a1a00;
}

.av-cx__marker.is-partial::after {
	border-color: rgba(255, 176, 59, 0.7);
	border-style: dashed;
}

.av-services-page .av-cx__marker.is-closed {
	background-color: rgba(10, 24, 44, 0.92);
	box-shadow: inset 0 0 0 2px var(--av-cx-ok);
	color: var(--av-cx-ok);
	scale: 0.85;
}

.av-cx__marker.is-closed::after {
	opacity: 0;
	animation: none;
}

.av-services-page .av-cx__marker:hover,
.av-services-page .av-cx__marker:focus-visible,
.av-services-page .av-cx__marker[aria-expanded="true"] {
	scale: 1.24;
}

.av-services-page .av-cx__marker.is-closed:hover,
.av-services-page .av-cx__marker.is-closed:focus-visible,
.av-services-page .av-cx__marker.is-closed[aria-expanded="true"] {
	scale: 1.05;
}

.av-services-page .av-cx__marker.is-hidden {
	opacity: 0;
	scale: 0.3;
	pointer-events: none;
}

.av-services-page .av-cx__marker:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

@keyframes av-cx-ping {
	0% {
		opacity: 0.9;
		transform: scale(0.7);
	}

	100% {
		opacity: 0;
		transform: scale(1.7);
	}
}

.av-cx__tip {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 5;
	box-sizing: border-box;
	width: 280px;
	padding: 0.9rem 1rem;
	border: 1px solid var(--av-cx-glass-line);
	border-radius: 4px;
	background-color: rgba(6, 17, 31, 0.96);
	box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
	color: var(--av-cx-text);
	pointer-events: none;
}

.av-cx__tip p {
	margin: 0 0 0.6rem;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--av-cx-text-2);
}

.av-cx .av-cx__tip .av-cx__tip-title {
	margin-bottom: 0.35rem;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--av-cx-text);
}

.av-cx .av-cx__tip .av-cx__tip-need {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0;
}

.av-cx__tip-need span {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 1.5rem;
	padding: 0 0.55rem;
	border-radius: 999px;
	background-color: rgba(150, 175, 215, 0.12);
	font-size: 0.75rem;
	color: var(--av-cx-text);
}

.av-cx__tip-need span::before {
	content: "–";
	font-weight: 700;
	color: #7f8ba3;
}

.av-cx__tip-need span.is-on {
	background-color: rgba(79, 224, 192, 0.14);
	color: #c9fff1;
}

.av-cx__tip-need span.is-on::before {
	content: "✓";
	color: var(--av-cx-ok);
}

/* Zoom / reset buttons. */
.av-cx__tools {
	position: absolute;
	right: var(--av-cx-edge);
	bottom: 1rem;
	z-index: 4;
	display: flex;
	gap: 0.4rem;
}

.av-services-page .av-cx__tool {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 1px solid var(--av-cx-glass-line);
	border-radius: 4px;
	background-color: var(--av-cx-glass);
	color: var(--av-cx-text);
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* «Сбросить вид»: icon + label. */
.av-services-page .av-cx__tool--reset {
	display: inline-flex;
	gap: 0.55rem;
	width: auto;
	padding: 0 1rem;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
}

.av-services-page .av-cx__tool:hover {
	border-color: rgba(111, 163, 230, 0.85);
	background-color: rgba(26, 95, 180, 0.35);
}

.av-cx .av-cx__hint {
	position: absolute;
	top: 1rem;
	left: 50%;
	z-index: 4;
	margin: 0;
	padding: 0.4rem 0.75rem;
	border-radius: 4px;
	background-color: rgba(6, 17, 31, 0.9);
	color: #c9d6e8;
	font-size: 0.75rem;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%);
	transition: opacity 0.25s ease;
}

.av-cx .av-cx__hint.is-shown {
	opacity: 1;
}

/* Loading / fallback message. */
.av-cx .av-cx__status {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 1.5rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	text-align: center;
	color: var(--av-cx-text-2);
}

/* ------------------------------------------------------------ Risk list
   The visual without 3D (no script / no WebGL); hidden while the scene
   runs or loads. States are written out, not only coloured. */

.av-cx__risks {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.av-cx[data-av-cx="ui"] .av-cx__risks,
.av-cx[data-av-cx="3d"] .av-cx__risks {
	display: none;
}

.av-cx:not([data-av-cx]) .av-cx__status {
	display: none;
}

.av-cx:not([data-av-cx]) .av-cx__scene,
.av-cx[data-av-cx="fallback"] .av-cx__scene {
	width: auto;
	height: auto;
	margin-inline: 0;
	padding-block: 0.5rem;
	background: none;
}

.av-cx[data-av-cx="fallback"] .av-cx__status {
	position: static;
	display: block;
	max-width: 40rem;
	margin: 0 0 1rem;
	padding: 0;
	text-align: left;
}

.av-cx[data-av-cx="fallback"] .av-cx__fade {
	display: none;
}

.av-cx__risk {
	display: flex;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	background-color: rgba(255, 255, 255, 0.03);
}

.av-cx__risk-dot {
	flex: none;
	width: 0.625rem;
	height: 0.625rem;
	margin-top: 0.35rem;
	border-radius: 50%;
	background-color: var(--av-cx-risk);
}

.av-cx__risk.is-partial .av-cx__risk-dot {
	background-color: var(--av-cx-part);
}

.av-cx__risk.is-closed .av-cx__risk-dot {
	background-color: var(--av-cx-ok);
}

.av-cx__risk-body {
	display: grid;
	gap: 0.2rem;
}

.av-cx__risk-title {
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

.av-cx__risk-text {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--av-svc-on-navy-text);
}

.av-cx__risk-state {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--av-cx-risk);
}

.av-cx__risk.is-partial .av-cx__risk-state {
	color: var(--av-cx-part);
}

.av-cx__risk.is-closed .av-cx__risk-state {
	color: var(--av-cx-ok);
}

.av-cx:not([data-av-cx]) .av-cx__risk-state {
	display: none;
}

@media (min-width: 600px) {
	.av-cx__risks {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.av-cx__risks {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}


/* ------------------------------------------------------------ Status panel
   Compact bar: stage + count + cells | text | button. Joined to the cards
   below it (shared edge, same panel colour). */

.av-cx__hud {
	position: relative;
	z-index: 3;
	display: grid;
	gap: 0.85rem;
	margin-top: 1rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--av-cx-line);
	border-radius: 6px 6px 0 0;
	background-color: var(--av-cx-panel);
	color: var(--av-cx-text);
}

.av-cx__hud p {
	margin: 0;
}

.av-cx__hud-main {
	display: grid;
	gap: 0.45rem;
	align-content: start;
}

.av-cx .av-cx__hud-kicker {
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--av-cx-text-2);
}

.av-cx .av-cx__hud-count {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.1rem 0.5rem;
	font-size: 0.8125rem;
	color: var(--av-cx-text-2);
}

.av-cx__hud-count strong {
	font-size: 1.625rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.02em;
	color: #fff;
	font-variant-numeric: tabular-nums;
}

.av-cx__cells {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 6px;
	max-width: 22rem;
}

.av-cx__cells i {
	height: 5px;
	border-radius: 3px;
	background-color: rgba(150, 175, 215, 0.18);
	transition: background-color 0.35s ease;
}

.av-cx__cells i.is-open {
	background-color: var(--av-cx-risk);
}

.av-cx__cells i.is-partial {
	background-color: var(--av-cx-part);
}

.av-cx__cells i.is-closed {
	background-color: var(--av-cx-ok);
}

.av-cx__hud-info {
	display: grid;
	gap: 0.4rem;
	align-content: center;
	min-width: 0;
}

.av-cx .av-cx__hud-text {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--av-cx-text-2);
}

.av-cx .av-cx__hud-systems {
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--av-cx-text);
}

.av-cx .av-cx__feed-title {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--av-cx-text-2);
}

.av-cx__feed-title span {
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: none;
}

.av-cx__feed {
	display: grid;
	gap: 0.3rem;
	margin: 0.35rem 0 0;
	padding: 0;
	list-style: none;
}

.av-cx__feed li {
	display: grid;
	grid-template-columns: 3.25rem 8px minmax(0, 1fr);
	gap: 0.5rem;
	align-items: baseline;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #c9d6ea;
	animation: av-cx-feed 0.4s ease-out;
}

.av-cx__feed-time {
	font: 400 0.75rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: var(--av-cx-text-2);
	font-variant-numeric: tabular-nums;
}

.av-cx__feed li i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: var(--av-cx-c);
}

@keyframes av-cx-feed {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

.av-cx__hud-actions {
	display: flex;
	align-items: center;
}

/* = .av-svc-btn, compact. */
.av-services-page .av-cx__hud-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	box-sizing: border-box;
	min-height: 2.75rem;
	margin: 0;
	padding: 0.65rem 1.25rem;
	border: 0;
	border-radius: 2px;
	background-color: var(--av-primary);
	color: #fff;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.18s ease;
}

.av-services-page .av-cx__hud-btn:hover,
.av-services-page .av-cx__hud-btn:focus-visible {
	background-color: var(--av-primary-hover);
	color: #fff;
	text-decoration: none;
}

@media (max-width: 599px) {
	.av-cx__feed li:nth-child(n + 4) {
		display: none;
	}
}

@media (min-width: 769px) {
	.av-cx__hud {
		grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr) auto;
		gap: 1.5rem;
		align-items: center;
		padding: 0.9rem 1.5rem;
	}

	/* Divider between the count and the text (mock-up). */
	.av-cx__hud-info {
		align-self: stretch;
		padding-left: 1.5rem;
		border-left: 1px solid var(--av-cx-line);
	}
}

/* ------------------------------------------------------------ Service cards
   Dark, equal height: icon | title + switch / text / «Закрывает N». */

.av-cx__cards {
	display: grid;
	gap: 0.5rem;
	margin: 0.25rem 0 0;
	padding: 0;
	list-style: none;
}

.av-cx__card {
	--av-cx-icon: var(--av-svc-on-navy);
	position: relative;
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr) auto;
	grid-template-rows: auto 1fr auto;
	gap: 0.35rem 0.75rem;
	margin: 0;
	padding: 1.1rem 1.15rem;
	border: 1px solid var(--av-cx-line);
	border-radius: 6px;
	background-color: var(--av-cx-panel);
	transition: border-color 0.25s ease, background-color 0.25s ease;
}

.av-cx__card--access {
	--av-cx-icon: var(--av-cx-ok);
}

.av-cx[data-av-cx] .av-cx__card {
	cursor: pointer;
}

.av-cx__card:hover {
	border-color: rgba(111, 163, 230, 0.45);
}

.av-cx__card.is-on {
	border-color: rgba(111, 163, 230, 0.8);
	background-color: rgba(18, 52, 98, 0.55);
}

.av-cx__card-icon {
	grid-column: 1;
	grid-row: 1 / span 2;
	align-self: start;
	color: var(--av-cx-icon);
	opacity: 0.75;
	transition: opacity 0.25s ease;
}

.av-cx__card-icon .av-svc-icon {
	width: 2rem;
	height: 2rem;
}

.av-cx__card.is-on .av-cx__card-icon {
	opacity: 1;
}

.av-cx .av-cx__card-title {
	grid-column: 2;
	grid-row: 1;
	align-self: center;
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	overflow-wrap: anywhere;
}

.av-cx__switch {
	grid-column: 3;
	grid-row: 1;
	align-self: center;
}

.av-cx .av-cx__card-text {
	grid-column: 2 / -1;
	grid-row: 2;
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--av-svc-on-navy-text);
}

.av-cx .av-cx__card-closes {
	grid-column: 2 / -1;
	grid-row: 3;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.3rem 0 0;
	font-size: 0.8125rem;
	color: var(--av-cx-text-2);
}

.av-cx__card-closes i {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--av-cx-c, var(--av-svc-on-navy));
}

/* Switch: track + knob (position, not only colour, shows the state). */
.av-services-page .av-cx__switch {
	position: relative;
	flex: none;
	width: 2.75rem;
	height: 1.5rem;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	background-color: rgba(255, 255, 255, 0.1);
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* Bigger hit area without a bigger switch. */
.av-cx__switch::before {
	content: "";
	position: absolute;
	inset: -0.65rem;
}

.av-cx__switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 1.125rem;
	height: 1.125rem;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.8);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.av-services-page .av-cx__switch[aria-checked="true"] {
	border-color: var(--av-primary);
	background-color: var(--av-primary);
}

.av-cx__switch[aria-checked="true"]::after {
	background-color: #fff;
	transform: translateX(1.25rem);
}

.av-cx .av-cx__note {
	max-width: 52rem;
	margin: 1rem 0 0;
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--av-cx-text-2);
}

@media (min-width: 600px) {
	.av-cx__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.av-cx__cards {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.av-cx__card {
		padding: 1.1rem 1.1rem 1.1rem 1rem;
	}
}

/* ------------------------------------------------------------ Wide layout */

@media (min-width: 1200px) {
	.av-services-page .av-section.av-cx {
		--av-section-pt: 3rem;
		--av-section-pb: 2.5rem;
	}

	/* Row 1: copy (scene behind) · row 2: CTA | panel · row 3: cards. */
	.av-cx__layout {
		grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
		column-gap: 1.75rem;
	}

	.av-cx__copy {
		grid-column: 1 / -1;
		max-width: 25.5rem;
		/* Keeps the panel row at the scene's lower edge. */
		min-height: calc(var(--av-cx-h) - var(--av-section-pt) - 2rem);
		pointer-events: auto;
	}

	.av-cx .av-svc-system__action {
		grid-column: 1;
		align-self: center;
		margin: 1rem 0 0;
	}

	.av-cx__hud {
		grid-column: 2;
	}

	.av-cx__cards,
	.av-cx .av-cx__note {
		grid-column: 1 / -1;
	}

	/* The scene sits behind the copy, from the copy's middle to the edge. */
	.av-cx__scene {
		position: absolute;
		top: 0;
		right: 0;
		left: calc(var(--av-cx-edge) + 13rem);
		width: auto;
		margin: 0;
	}

	.av-cx__fade {
		background:
			linear-gradient(90deg, var(--av-svc-navy) 0%, var(--av-svc-navy) 6%, rgba(10, 26, 43, 0.8) 13%, rgba(10, 26, 43, 0.35) 21%, rgba(10, 26, 43, 0) 30%),
			linear-gradient(180deg, var(--av-svc-navy) 0%, rgba(10, 26, 43, 0) 9%),
			linear-gradient(0deg, var(--av-svc-navy) 0%, rgba(10, 26, 43, 0) 16%);
	}

	.av-cx__tools {
		bottom: 2.75rem;
	}

	.av-cx .av-cx__hint {
		left: 60%;
	}

	/* Fallback / no script: the list goes back into the flow. */
	.av-cx:not([data-av-cx]) .av-cx__scene,
	.av-cx[data-av-cx="fallback"] .av-cx__scene {
		position: relative;
		left: auto;
		grid-column: 1 / -1;
		margin-top: 1rem;
	}

	.av-cx:not([data-av-cx]) .av-cx__copy,
	.av-cx[data-av-cx="fallback"] .av-cx__copy {
		min-height: 0;
	}
}

/* ------------------------------------------------------------ Focus / motion */

.av-cx button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
	border-radius: 2px;
}

.av-cx .av-cx__switch:focus-visible {
	border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
	.av-cx__marker::after,
	.av-cx__feed li {
		animation: none;
	}

	.av-cx__step-num,
	.av-cx__step-hint,
	.av-cx__card,
	.av-cx__card::before,
	.av-cx__card-icon,
	.av-cx__switch,
	.av-cx__switch::after,
	.av-cx__cells i,
	.av-services-page .av-cx__marker,
	.av-services-page .av-cx__call,
	.av-services-page .av-cx__chip,
	.av-services-page .av-cx__hud-btn,
	.av-cx .av-cx__hint {
		transition: none;
	}
}
