/*
 * Homepage autonomy calculator («Калькулятор автономності»).
 * Markup: template-parts/autonomy-calculator.php, behaviour:
 * assets/js/autonomy-calculator.js, tokens: design handoff «UI Kit».
 *
 * Layout breakpoints:   ≥1200 desktop (3fr / 2fr, 4 chip columns)
 *                       768–1199 tablet (1fr / .75fr, 3 chip columns)
 *                       <768 phone (stack, chip scroller, bottom dock)
 * Picture breakpoints:  ≥1200 desktop, 600–1199 tablet, <600 mobile
 *
 * Only stroke-dashoffset, opacity and transform are animated in a loop; the
 * loops pause while the section is off screen (.is-paused, set by the
 * script) and are off under prefers-reduced-motion.
 */

.ac {
	--ac-ink: #0b0b0b;
	--ac-section: #f5f5f5;
	--ac-surface: #fff;
	--ac-border: #e4e4e4;
	--ac-text-2: #6b6b6b;
	--ac-text-3: #8a8a8a;
	--ac-accent: #3fcf5a;
	--ac-accent-soft: #eefbf0;
	--ac-low: #f2a93b;
	--ac-warn: #ff9a3c;
	--ac-warn-text: #ffb066;
	--ac-panel-2: #1a1a1a;
	--ac-track: #1d1d1d;
	--ac-pulse: #eaffef;
	--ac-mono: "JetBrains Mono", var(--wp--preset--font-family--ibm-plex-mono, ui-monospace), ui-monospace, "SFMono-Regular", Menlo, monospace;

	max-width: var(--wp--style--global--wide-size, 1320px);
	margin: 0 auto;
	padding: clamp(16px, 3vw, 40px) var(--wp--preset--spacing--5, 20px);
	box-sizing: border-box;
	color: var(--ac-ink);
	font-family: Manrope, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

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

/*
 * Product page: the section sits inside the «Опис» tab, which already has the
 * page gutters and width, so it only keeps the gap to the product text below.
 */
.ac--product {
	max-width: none;
	margin: 0 0 clamp(28px, 4vw, 48px);
	padding: 0;
}

.ac .ac-warn__btn--light {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.ac button {
	font-family: inherit;
}

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

.ac__card {
	background: var(--ac-section);
	border-radius: 24px;
	padding: clamp(20px, 4vw, 56px);
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 3vw, 36px);
}

/* --- Head ------------------------------------------------------------------ */

.ac__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px 40px;
}

.ac__intro {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 760px;
}

.ac__eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: #7a7a7a;
}

.ac__title {
	margin: 0;
	font-size: clamp(24px, calc(14px + 3vw), 48px);
	line-height: 1.08;
	font-weight: 600;
	letter-spacing: -0.025em;
	text-wrap: balance;
	color: var(--ac-ink);
}

.ac__lead {
	margin: 0;
	font-size: clamp(15px, 1.4vw, 18px);
	line-height: 1.5;
	color: var(--ac-text-2);
	text-wrap: pretty;
}

.ac__lead-short {
	display: none;
}

.ac__eff {
	font-family: var(--ac-mono);
	font-size: 12px;
	color: var(--ac-text-3);
	white-space: nowrap;
}

.ac__note {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ac-text-3);
}

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

.ac__layout {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: clamp(16px, 2vw, 28px);
	align-items: start;
}

.ac__main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

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

.ac-scene {
	--pin-font: var(--pin-font-m);
	--cap-font: var(--cap-font-m);
	--wire-w: 0.6;
	--pulse-w: 0.26;
	position: relative;
	width: 100%;
	aspect-ratio: var(--ratio-m);
	border-radius: 18px;
	overflow: hidden;
	background: #e9ecef;
	container-type: inline-size;
}

.ac-scene picture,
.ac-scene__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ac-scene__img {
	display: block;
	object-fit: contain;
}

.ac-scene__wires {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

/*
 * Layer 1: the live cable. pathLength=1 makes the draw-in length-agnostic.
 * Off, it has no dashoffset transition, so it is back at 1 the moment the
 * fade ends and the next connection draws from the station again.
 */
.ac-wire {
	fill: none;
	stroke: var(--ac-accent);
	stroke-width: var(--wire-w);
	stroke-linejoin: round;
	stroke-linecap: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	opacity: 0;
	transition: opacity 0.3s;
}

/*
 * Layer 2: current pulses. Dash, gap and shift are screen pixels converted to
 * viewBox units by the script (--dash/--gap/--shift on the <svg>), so every
 * route runs at the same speed whatever its length. Routes start at the
 * station, so a falling dashoffset runs station -> appliance. The animation
 * exists only while connected (and during the 0.3s fade-out), so every
 * connection starts it from zero.
 */
.ac-pulse {
	fill: none;
	stroke: var(--ac-pulse);
	stroke-width: var(--pulse-w);
	stroke-linecap: round;
	stroke-dasharray: var(--dash, 0.5) var(--gap, 1.5);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ac-route.is-on .ac-wire,
.ac-route.is-fading .ac-wire {
	stroke-dashoffset: 0;
	filter: drop-shadow(0 0 6px rgba(63, 207, 90, 0.85));
}

.ac-route.is-on .ac-wire {
	opacity: 1;
	transition: stroke-dashoffset 0.6s ease-out, opacity 0.3s;
}

.ac-route.is-on .ac-pulse,
.ac-route.is-fading .ac-pulse {
	animation: ac-flow 1.1s linear 0.55s infinite;
}

.ac-route.is-on .ac-pulse {
	opacity: 0.85;
	transition-delay: 0.55s;
}

.ac-scene.is-overload .ac-route.is-on .ac-pulse {
	stroke: var(--ac-warn-text);
	animation-duration: 0.6s;
}

@keyframes ac-flow {
	from { stroke-dashoffset: 0; }
	to { stroke-dashoffset: var(--shift, -2); }
}

/* One-off energy packet that travels the route when an appliance connects. */
.ac-packet {
	position: absolute;
	left: 0;
	top: 0;
	width: 8px;
	height: 8px;
	margin: -4px 0 0 -4px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 6px 2px rgba(63, 207, 90, 0.9), 0 0 14px 4px rgba(63, 207, 90, 0.45);
	pointer-events: none;
	offset-rotate: 0deg;
	offset-anchor: 50% 50%;
	z-index: 1;
}

.ac-packet--motion {
	margin: 0;
}

/* Wattage pins, covering the badges drawn on the picture. */
.ac-pin {
	position: absolute;
	left: calc(var(--x) * 1%);
	top: calc(var(--y) * 1%);
	width: calc(var(--w) * 1%);
	height: calc(var(--h) * 1%);
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	font-size: var(--pin-font);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1;
	white-space: nowrap;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: rgba(255, 255, 255, 0.94);
	color: var(--ac-ink);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	z-index: 2;
	transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.ac-pin:hover {
	border-color: var(--ac-accent);
}

.ac-pin[aria-pressed="true"] {
	background: var(--ac-accent);
	border-color: var(--ac-accent);
	box-shadow: 0 0 0 3px rgba(63, 207, 90, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Station name capsule over the black capsule drawn on the picture. */
.ac-cap {
	position: absolute;
	left: calc(var(--x) * 1%);
	top: calc(var(--y) * 1%);
	width: calc(var(--w) * 1%);
	height: calc(var(--h) * 1%);
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 999px;
	background: var(--ac-ink);
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	pointer-events: none;
	z-index: 2;
}

.ac-cap.is-live {
	animation: ac-cap-glow 2s ease-in-out infinite;
}

@keyframes ac-cap-glow {
	0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(63, 207, 90, 0.6); }
	50% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(63, 207, 90, 0); }
}

.ac-cap__name {
	display: block;
	font-size: var(--cap-font);
	font-weight: 800;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

/* --- Appliance chips ------------------------------------------------------- */

.ac-chips {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	padding: 4px 2px 6px;
	margin: -4px -2px 0;
}

.ac-chip {
	position: relative;
	min-height: 44px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	padding: 14px 14px 12px;
	text-align: left;
	border-radius: 14px;
	border: 1px solid var(--ac-border);
	background: var(--ac-surface);
	color: var(--ac-ink);
	cursor: pointer;
	scroll-snap-align: start;
	transition: border-color 0.2s, background-color 0.2s;
}

.ac-chip:hover {
	border-color: #c9c9c9;
}

.ac-chip[aria-pressed="true"] {
	border-color: var(--ac-accent);
	background: var(--ac-accent-soft);
}

.ac-chip.is-pop {
	animation: ac-pop 0.3s ease-out;
}

@keyframes ac-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.08); }
	100% { transform: scale(1); }
}

.ac-chip__icon {
	display: block;
	width: 22px;
	height: 22px;
	opacity: 0.9;
}

.ac-chip__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
}

.ac-chip__name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	min-height: 2.4em;
	hyphens: auto;
	overflow-wrap: anywhere;
}

.ac-chip__watts {
	font-family: var(--ac-mono);
	font-size: 12px;
	color: #7a7a7a;
}

.ac-chip__dot {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: transparent;
	transition: background-color 0.2s;
}

.ac-chip[aria-pressed="true"] .ac-chip__dot {
	background: var(--ac-accent);
}

/* --- Station panel --------------------------------------------------------- */

.ac-panel {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: clamp(18px, 2vw, 28px);
	border-radius: 20px;
	border: 1px solid #1f1f1f;
	background: var(--ac-ink);
	color: #fff;
	transition: border-color 0.3s;
}

/* The phone dock scrolls the panel into view: keep its tabs below the fixed header. */
.ac-panel {
	scroll-margin-top: calc(var(--ef-header-h, 56px) + 12px);
}

.ac-panel__body {
	display: flex;
	flex-direction: column;
	gap: 22px;
	min-width: 0;
}

.ac.is-overload .ac-panel {
	border-color: rgba(255, 154, 60, 0.65);
}

.ac-panel.is-pulse {
	animation: ac-overload 1.5s ease-out 3;
}

@keyframes ac-overload {
	0% { box-shadow: 0 0 0 0 rgba(255, 154, 60, 0.55); }
	100% { box-shadow: 0 0 0 8px rgba(255, 154, 60, 0); }
}

.ac-tabs {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding: 4px;
	border-radius: 18px;
	background: var(--ac-panel-2);
}

.ac-tabs__thumb {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 4px;
	width: calc((100% - 8px) / 2);
	border-radius: 14px;
	background: #fff;
	transition: transform 0.25s ease;
}

.ac-tabs[data-index="1"] .ac-tabs__thumb {
	transform: translateX(100%);
}

.ac-tab {
	position: relative;
	z-index: 1;
	min-height: 52px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	margin: 0;
	padding: 10px 8px;
	border: 0;
	border-radius: 14px;
	background: transparent;
	white-space: nowrap;
	cursor: pointer;
}

.ac-tab__name {
	font-size: 15px;
	font-weight: 700;
	color: #d6d6d6;
	transition: color 0.25s;
}

.ac-tab__sub {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	font-family: var(--ac-mono);
	font-size: 11px;
	color: #7a7a7a;
	transition: color 0.25s;
}

.ac-tab[aria-selected="true"] .ac-tab__name {
	color: var(--ac-ink);
}

.ac-tab[aria-selected="true"] .ac-tab__sub {
	color: var(--ac-text-2);
}

.ac-station {
	display: flex;
	align-items: center;
	gap: 16px;
}

.ac-station__photo {
	flex: none;
	width: 84px;
	height: 84px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 14px;
	background: #161616;
}

.ac-station__photo img {
	display: block;
	width: 125%;
	height: 125%;
	max-width: none;
	object-fit: contain;
}

.ac-station__photo img[hidden] {
	display: none;
}

.ac-station__info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.ac-station__name {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.ac-station__specs {
	font-family: var(--ac-mono);
	font-size: 12px;
	color: #9a9a9a;
}

.ac-label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ac-text-3);
}

.ac-runtime {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ac-runtime__value {
	min-height: 64px;
	display: flex;
	align-items: center;
}

.ac-runtime__idle,
.ac-runtime__run {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
}

.ac-runtime__run,
.ac.is-running .ac-runtime__idle {
	display: none;
}

.ac.is-running .ac-runtime__run {
	display: flex;
}

.ac-runtime__dash {
	font-size: clamp(40px, 4vw, 56px);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1;
	color: #5a5a5a;
}

.ac-runtime__hint {
	align-self: center;
	font-size: 14px;
	color: var(--ac-text-3);
}

.ac-runtime__num {
	font-size: clamp(44px, 4.6vw, 64px);
	font-weight: 600;
	letter-spacing: -0.035em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: #fff;
	transition: color 0.3s;
}

.ac.is-overload .ac-runtime__num {
	color: #6a6a6a;
}

.ac-runtime__unit {
	font-size: 18px;
	color: #9a9a9a;
}

.ac-runtime__unit--h {
	margin-right: 8px;
}

.ac-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ac-meters {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ac-meter {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ac-meter__row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	color: #a8a8a8;
}

.ac-meter__val {
	display: inline-block;
	font-family: var(--ac-mono);
	color: #fff;
	white-space: nowrap;
	transition: color 0.3s;
}

.ac.is-overload .ac-meter__val--load,
.ac.is-overload .ac-dock__load {
	color: var(--ac-warn-text);
}

.ac .is-bump {
	animation: ac-val-in 0.2s ease-out;
}

@keyframes ac-val-in {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: none; }
}

.ac-battery {
	position: relative;
	height: 14px;
	padding: 2px;
	border-radius: 5px;
	background: var(--ac-track);
}

.ac-battery__fill {
	height: 100%;
	border-radius: 3px;
	background: var(--ac-accent);
	box-shadow: 0 0 12px rgba(63, 207, 90, 0.35);
	transition: width 0.4s ease, background-color 0.3s;
}

.ac.is-low .ac-battery__fill {
	background: var(--ac-low);
	box-shadow: 0 0 12px rgba(242, 169, 59, 0.35);
}

.ac-load {
	height: 4px;
	overflow: hidden;
	border-radius: 2px;
	background: var(--ac-track);
}

.ac-load__fill {
	height: 100%;
	background: #e6e6e6;
	transition: width 0.4s ease, background-color 0.3s;
}

.ac.is-overload .ac-load__fill {
	background: var(--ac-warn);
}

/* Overload alert: grid rows 0fr -> 1fr; the negative margin eats the gap. */
.ac-warn {
	display: grid;
	grid-template-rows: 0fr;
	margin-top: -22px;
	opacity: 0;
	transform: translateY(-6px);
	transition: grid-template-rows 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin-top 0.3s ease;
}

.ac.is-overload .ac-warn {
	grid-template-rows: 1fr;
	margin-top: 0;
	opacity: 1;
	transform: none;
}

.ac-warn__clip {
	min-height: 0;
	overflow: hidden;
}

.ac-warn__box {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 16px;
	border-radius: 14px;
	border: 1px solid rgba(255, 154, 60, 0.45);
	background: rgba(255, 154, 60, 0.12);
}

.ac-warn__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--ac-warn-text);
}

.ac-warn__text {
	font-size: 13px;
	line-height: 1.5;
	color: #e6e6e6;
	text-wrap: pretty;
}

.ac-warn__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ac-warn__btn {
	margin: 0;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: transparent;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.ac-warn__btn[hidden] {
	display: none;
}

.ac-warn__btn--light {
	border-color: #fff;
	background: #fff;
	color: var(--ac-ink);
}

.ac-connected {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 18px;
	border-top: 1px solid #222;
}

.ac-connected__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.ac-connected__count {
	font-family: var(--ac-mono);
	font-size: 12px;
	color: var(--ac-text-3);
}

.ac-connected__list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ac-connected__empty {
	padding: 8px 0;
	font-size: 14px;
	color: #6a6a6a;
}

.ac-connected__item {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 6px 0;
	border-bottom: 1px solid #1c1c1c;
}

.ac-connected__item::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--ac-accent);
}

.ac-connected__name {
	flex: 1;
	min-width: 0;
	font-size: 14px;
}

.ac-connected__watts {
	font-family: var(--ac-mono);
	font-size: 12px;
	color: #9a9a9a;
}

.ac-connected__remove {
	flex: none;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	border: 1px solid #2a2a2a;
	background: transparent;
	color: #bdbdbd;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.ac-connected__remove:hover {
	border-color: #555;
	color: #fff;
}

.ac-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ac-reset {
	flex: 1 1 140px;
	margin: 0;
	padding: 14px 18px;
	border-radius: 999px;
	border: 1px solid #333;
	background: transparent;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.2s;
}

.ac-reset:disabled {
	color: #555;
	cursor: default;
}

.ac .ac-cta {
	flex: 2 1 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 18px;
	border-radius: 999px;
	background: #fff;
	color: var(--ac-ink);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
}

.ac .ac-cta:hover,
.ac .ac-dock__buy:hover {
	opacity: 0.85;
}

/* --- Phone dock ------------------------------------------------------------ */

.ac-dock {
	display: none;
}

/* --- Tablet: 768–1199 ------------------------------------------------------ */

@media (max-width: 1199px) {
	.ac__layout {
		grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
	}

	.ac-chips {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ac-chip__name {
		font-size: 13px;
	}
}

/*
 * 768–1023: next to the 320px panel the left column is ~330–450px, so three
 * chips would break names mid-word ("Холодильн-ик"); two fit them whole.
 */
@media (min-width: 768px) and (max-width: 1023px) {
	.ac-chips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ac-chip__name {
		overflow-wrap: normal;
	}
}

/*
 * Compact chips from 768px: icon on the left, name over wattage on the right -
 * about half the height of the stacked phone chip. Most names take one line;
 * the few that cannot fit a ~105px column («Варочная поверхность»,
 * «Стиральная машина») wrap between words onto a second line instead of
 * being cut with an ellipsis. States (hover, pressed, focus ring, dot) are the
 * same rules as above.
 */
@media (min-width: 768px) {
	.ac-chip {
		flex-direction: row;
		align-items: center;
		gap: 8px;
		padding: 12px 16px 12px 10px;
	}

	.ac-chip__icon {
		flex: none;
		width: 20px;
		height: 20px;
	}

	.ac-chip__text {
		min-width: 0;
		gap: 2px;
	}

	.ac-chip__name {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		min-height: 0;
		overflow: hidden;
		font-size: 13px;
		line-height: 1.25;
		overflow-wrap: break-word;
		hyphens: manual;
	}

	/* #6b6b6b: 5.3:1 on white, 4.9:1 on the pressed green - AA for small text. */
	.ac-chip__watts {
		font-size: 11px;
		line-height: 1.3;
		color: var(--ac-text-2);
	}

	.ac-chip__dot {
		top: 50%;
		right: 6px;
		width: 6px;
		height: 6px;
		transform: translateY(-50%);
	}
}

/* --- Phones: <768 ---------------------------------------------------------- */

@media (max-width: 767px) {
	.ac {
		padding-inline: 16px;
	}

	.ac__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.ac__lead-long {
		display: none;
	}

	.ac__lead-short {
		display: inline;
	}

	.ac-chips {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: calc((100% - 20px) / 2.1);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding: 0 20px;
		padding: 4px 20px 6px;
		margin: -4px -20px 0;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		overscroll-behavior-x: contain;
	}

	.ac-chips::-webkit-scrollbar {
		display: none;
	}

	.ac-chip {
		gap: 10px;
	}

	.ac-chip__name {
		font-size: 14px;
	}

	.ac-actions {
		flex-direction: column-reverse;
	}

	.ac-reset,
	.ac .ac-cta {
		flex: 0 0 auto;
	}

	.ac-dock {
		position: fixed;
		left: 16px;
		right: 16px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 70;
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 8px 8px 8px 14px;
		border-radius: 999px;
		border: 1px solid #1f1f1f;
		background: var(--ac-ink);
		color: #fff;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
		opacity: 0;
		transform: translateY(12px);
		pointer-events: none;
		visibility: hidden;
		transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.3s, visibility 0s 0.25s;
	}

	.ac-dock.is-shown {
		opacity: 1;
		transform: none;
		pointer-events: auto;
		visibility: visible;
		transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.3s, visibility 0s;
	}

	.ac.is-overload .ac-dock {
		border-color: rgba(255, 154, 60, 0.65);
	}

	/* Floating contact buttons and the promo pill stand on the dock. */
	body:has(.ac-dock.is-shown) {
		--ec-bar-h: calc(74px + env(safe-area-inset-bottom, 0px));
	}

	body:has(.ac-dock.is-shown) .ec-fab {
		--ec-safe: 0px;
		bottom: 16px;
	}
}

@media (min-width: 600px) and (max-width: 767px) {
	.ac-chips {
		grid-auto-columns: calc((100% - 30px) / 3.25);
	}
}

@media (max-width: 599px) {
	.ac-chip__name {
		font-size: 13px;
	}

	.ac-meter__row {
		flex-wrap: wrap;
	}

	/* Charge row: the long label wraps inside itself, the % stays top right. */
	.ac-meter:first-child .ac-meter__row {
		flex-wrap: nowrap;
	}

	.ac-meter:first-child .ac-meter__row > span:first-child {
		flex: 1 1 0;
		min-width: 0;
	}

	.ac-tab__name {
		font-size: 14px;
	}
}

/* Narrow phones (320–374): keep «Холодильник» whole in a 2.1-chip row. */
@media (max-width: 374px) {
	.ac-chip {
		padding-inline: 12px;
	}

	.ac-chip__name {
		font-size: 12px;
		overflow-wrap: normal;
	}
}

.ac-dock__main {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	text-align: left;
	cursor: pointer;
}

.ac-dock__info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.ac-dock__top {
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

.ac-dock__name {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.ac-dock__load {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-family: var(--ac-mono);
	font-size: 11px;
	color: #fff;
}

.ac-dock__bar {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ac-dock__track {
	flex: 1;
	height: 4px;
	overflow: hidden;
	border-radius: 2px;
	background: #262626;
}

.ac-dock__fill {
	display: block;
	height: 100%;
	background: var(--ac-accent);
	transition: width 0.4s ease, background-color 0.3s;
}

.ac.is-low .ac-dock__fill {
	background: var(--ac-low);
}

.ac-dock__pct {
	display: inline-block;
	font-family: var(--ac-mono);
	font-size: 11px;
	color: #cfcfcf;
}

.ac-dock__arrow {
	font-size: 14px;
	color: var(--ac-text-3);
}

.ac .ac-dock__buy {
	flex: none;
	min-height: 44px;
	display: flex;
	align-items: center;
	padding: 0 16px;
	border-radius: 999px;
	background: #fff;
	color: var(--ac-ink);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
}

/* --- Picture geometry ------------------------------------------------------ */

@media (min-width: 600px) {
	.ac-scene {
		--pin-font: var(--pin-font-t);
		--cap-font: var(--cap-font-t);
		aspect-ratio: var(--ratio-t);
	}
}

@media (min-width: 1200px) {
	.ac-scene {
		--pin-font: var(--pin-font-d);
		--cap-font: var(--cap-font-d);
		--wire-w: 0.32;
		--pulse-w: 0.16;
		aspect-ratio: var(--ratio-d);
	}
}

/*
 * Pin and capsule boxes: each element carries its own --x?/--y?/--w?/--h?
 * for the three pictures (inline, from the data file); pick the set here.
 */
.ac-pin,
.ac-cap {
	--x: var(--xm);
	--y: var(--ym);
	--w: var(--wm);
	--h: var(--hm);
}

@media (min-width: 600px) {
	.ac-pin,
	.ac-cap {
		--x: var(--xt);
		--y: var(--yt);
		--w: var(--wt);
		--h: var(--ht);
	}
}

@media (min-width: 1200px) {
	.ac-pin,
	.ac-cap {
		--x: var(--xd);
		--y: var(--yd);
		--w: var(--wd);
		--h: var(--hd);
	}
}

/* --- Off screen / reduced motion ------------------------------------------- */

.ac.is-paused .ac-route .ac-pulse,
.ac.is-paused .ac-cap.is-live {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	.ac *,
	.ac *::before,
	.ac *::after {
		transition: none !important;
		animation: none !important;
	}

	.ac-pulse,
	.ac-packet {
		display: none;
	}
}
