/* ALIMUSAEV — базовые стили и вспомогательные классы для Elementor */

html { background: var(--am-bg); }

body {
	background: var(--am-bg);
	color: var(--am-fg);
	font-family: var(--am-font-sans);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	transition: background-color .2s ease, color .2s ease;
}

a, a:visited { color: inherit; }
a:hover, a:active, a:focus { color: inherit; opacity: .75; } /* Hello Elementor красит наведённые ссылки в синий #336 */

::selection { background: var(--am-inv); color: var(--am-inv-fg); }

:focus-visible {
	outline: 2px solid var(--am-fg);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--am-font-mono);
	color: inherit;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* =========================================================
   Вспомогательные классы (поле «CSS-классы» в Elementor)
   ========================================================= */

/* Сетка на фоне шапок разделов + мягкое «свечение экрана» сверху по центру */
.am-grid-bg {
	background-image:
		linear-gradient(var(--am-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--am-grid) 1px, transparent 1px),
		radial-gradient(ellipse 90% 80% at 50% 0%, var(--am-glow), transparent 70%);
	background-size: 40px 40px, 40px 40px, 100% 100%;
}
.am-grid-bg--fine { background-size: 28px 28px, 28px 28px, 100% 100%; }

/* Мигающий курсор после заголовка: класс am-cursor на виджет «Заголовок» */
.am-cursor .elementor-heading-title::after,
.am-cursor-inline::after {
	content: "_";
	animation: am-blink 1.1s steps(1) infinite;
}
.am-blink { animation: am-blink 1.1s steps(1) infinite; }
@keyframes am-blink { 50% { opacity: 0; } }

/* Моно-подпись над заголовком: «01 / НАПРАВЛЕНИЯ», «C:\> help» */
.am-label,
.am-label .elementor-heading-title {
	font-family: var(--am-font-mono);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	color: var(--am-muted);
}

.am-mono, .am-mono * { font-family: var(--am-font-mono) !important; }
.am-muted { color: var(--am-muted); }

/* Инверсный блок: полоса цифр, «Как я работаю», подвал. Палитра внутри — в tokens.css */
.am-inv {
	background: var(--am-inv);
	color: var(--am-inv-fg);
}

/* ---------- Раскладка колонок (вместо процентов Elementor) ----------
   Родительскому контейнеру: направление «строка», перенос «wrap».
   Дочерним контейнерам — один из классов ниже. На узком экране колонки
   сами переносятся друг под друга. */
body .e-con.am-col,
body .e-con.am-col--wide,
body .e-con.am-cell,
body .e-con.am-step,
body .e-con.am-stat {
	--width: auto;
	width: auto;
	min-width: 0;
}
body .e-con.am-col { flex: 1 1 340px; }
body .e-con.am-col--wide { flex: 999 1 560px; }
body .e-con.am-cell { flex: 1 1 260px; }
body .e-con.am-step { flex: 1 1 190px; }
body .e-con.am-stat { flex: 1 1 200px; }
/* Контейнер по ширине содержимого (группа кнопок, одиночная кнопка в строке) */
body .e-con.am-shrink { --width: auto; width: auto; flex: 0 0 auto; }

/* Карточки с общими рамками («Чем я помогаю») */
body .e-con.am-cells { border-top: 1px solid var(--am-fg); border-left: 1px solid var(--am-fg); }
body .e-con.am-cell { border-right: 1px solid var(--am-fg); border-bottom: 1px solid var(--am-fg); }
/* Ссылка «> подробнее» — всегда у нижнего края карточки, на одной линии с соседними,
   как бы ни отличалась длина текста над ней */
body .e-con.am-cell > .elementor-element:last-child:not(:first-child),
body .e-con.am-cell > .e-con-inner > .elementor-element:last-child:not(:first-child) { margin-top: auto; }

/* Шаги «Как я работаю»: линия сверху */
body .e-con.am-step { border-top: 2px solid var(--am-fg); padding-top: 20px; }

/* Рамка формы */
body .e-con.am-formbox { border: 1px solid var(--am-fg); background: var(--am-bg); }

/* Нижняя строка подвала */
body .e-con.am-footer-bottom { border-top: 1px solid var(--am-line); }
/* Нижняя строка подвала: три блока в одну линию, по центру по высоте; на телефоне — столбиком */
body .e-con.am-footer-bottom,
body .e-con.am-footer-bottom > .e-con-inner { align-items: center !important; }
body .e-con.am-footer-bottom .elementor-widget-text-editor p { margin: 0; }
body .e-con.am-footer-bottom .am-copy { display: inline-block; line-height: 1.5; }
body .e-con.am-footer-bottom .am-copy__note { opacity: .8; }
@media (min-width: 1025px) {
	body .e-con.am-footer-bottom,
	body .e-con.am-footer-bottom > .e-con-inner { flex-wrap: nowrap !important; justify-content: space-between !important; }
	body .e-con.am-footer-bottom .elementor-widget-text-editor { width: auto !important; flex: 0 1 auto; }
	body .e-con.am-footer-bottom .am-links--row,
	body .e-con.am-footer-bottom .elementor-widget-text-editor:last-child p { white-space: nowrap; }
}
@media (max-width: 1024px) {
	body .e-con.am-footer-bottom,
	body .e-con.am-footer-bottom > .e-con-inner { flex-direction: column !important; align-items: flex-start !important; }
}

/* Квадрат с иконкой в «Обо мне» */
.am-about-icon {
	aspect-ratio: 1 / 1;
	max-width: 420px;
	border: 1px solid var(--am-fg);
	display: flex;
	align-items: center;
	justify-content: center;
}
.am-about-icon img { width: 55%; height: auto; display: block; }
/* Полный логотип в квадрате: am-about-icon am-about-icon--logo */
.am-about-icon--logo img { width: 86%; }

/* Пара картинок под тему (класс у <img>): am-on-light — тёмная картинка для светлого фона,
   am-on-dark — светлая для тёмного. В инверсных блоках — наоборот. */
body img.am-on-dark { display: none; }
:root[data-theme="dark"] body img.am-on-light { display: none; }
:root[data-theme="dark"] body img.am-on-dark { display: block; }
body .am-inv img.am-on-light { display: none; }
body .am-inv img.am-on-dark { display: block; }
:root[data-theme="dark"] body .am-inv img.am-on-light { display: block; }
:root[data-theme="dark"] body .am-inv img.am-on-dark { display: none; }

/* Список «[✓] …» */
.am-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: var(--am-font-mono);
	font-size: 15px;
}
.am-checklist li::before { content: "[✓] "; }

/* Ссылки-строки в подвале и колонках */
.am-links { display: flex; flex-direction: column; gap: 8px; }
.am-links a { text-decoration: none; }
.am-links--row { flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }

/* =========================================================
   Компоненты шорткодов
   ========================================================= */

/* [am_terminal] */
.am-term {
	border: 1px solid var(--am-fg);
	background: var(--am-bg);
	font-family: var(--am-font-mono);
	font-size: 14px;
}
.am-term__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 14px;
	background: var(--am-inv);
	color: var(--am-inv-fg);
	font-weight: 700;
}
.am-term__body { padding: 20px 20px 24px; line-height: 1.9; }
.am-term__grid {
	display: grid;
	grid-template-columns: max-content max-content minmax(0, 1fr);
	column-gap: 16px;
	margin-top: 8px;
}
.am-term__foot { margin-top: 12px; }
.am-term a { text-decoration: none; font-weight: 700; }

/* [am_latest_posts] */
.am-latest__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px 24px;
	margin: 80px 0 32px;
}
.am-latest__title { margin: 0; font: 800 44px/1.15 var(--am-font-mono); } /* как заголовки разделов главной */
.am-latest__all {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--am-fg);
	font: 700 15px var(--am-font-mono);
	text-decoration: none;
}
.am-latest__all:hover { background: var(--am-inv); color: var(--am-inv-fg) !important; opacity: 1; }
@media (max-width: 1024px) { .am-latest__title { font-size: 36px; } }
@media (max-width: 640px) { .am-latest__title { font-size: 30px; } .am-latest__head { margin-top: 56px; } }

/* Страница 404 */
.am-404 { padding: 72px 0 96px; }
.am-404 .am-term { max-width: 760px; margin-top: 28px; font-size: 15px; }
.am-404__line { margin: 0; white-space: pre-wrap; word-break: break-word; }
.am-404__err { margin: 14px 0 22px; }
.am-404__choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
body .am-404__choice {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--am-fg);
	background: transparent;
	color: var(--am-fg);
	border-radius: 0;
	font: 400 15px var(--am-font-mono);
	text-decoration: none;
	cursor: pointer;
}
body .am-404__choice b { margin-right: 6px; }
body .am-404__choice:hover,
body .am-404__choice:focus-visible { background: var(--am-inv); color: var(--am-inv-fg); opacity: 1; }
.am-404 .am-search { margin-top: 32px; max-width: 760px; }
.am-postlist { border-top: 1px solid var(--am-fg); font-family: var(--am-font-mono); }
.am-postlist__item {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 32px;
	align-items: baseline;
	padding: 22px 0;
	border-bottom: 1px solid var(--am-line);
	text-decoration: none;
}
.am-postlist__date { flex: 0 0 110px; font-size: 14px; color: var(--am-muted); }
.am-postlist__cat { flex: 0 0 150px; font-size: 14px; color: var(--am-muted); }
.am-postlist__title { flex: 1 1 380px; font-size: 18px; font-weight: 700; }
.am-postlist__item:hover { opacity: 1; background: var(--am-surface); }
.am-postlist__empty { font-family: var(--am-font-mono); color: var(--am-muted); border-top: 1px solid var(--am-fg); padding-top: 22px; margin: 0; }

/* [am_soft_preview] */
.am-softtable { overflow-x: auto; border: 1px solid var(--am-fg); }
.am-softtable table {
	width: 100%;
	min-width: 480px;
	margin: 0;
	border-collapse: collapse;
	font-family: var(--am-font-mono);
	font-size: 15px;
}
.am-softtable th {
	background: var(--am-inv);
	color: var(--am-inv-fg);
	text-align: left;
	padding: 12px 16px;
	border: 0;
}
.am-softtable td { padding: 14px 16px; border: 0; border-top: 1px solid var(--am-line); background: transparent; }
.am-softtable tbody tr:nth-child(2n) td { background: transparent; }
.am-softtable tbody tr:hover > td { background: var(--am-surface); }
.am-softtable__name { font-weight: 700; }
.am-softtable__act { text-align: right; white-space: nowrap; }
.am-softtable__act a { font-weight: 700; }

/* =========================================================
   Кнопки Elementor
   ========================================================= */

body .am-btn .elementor-button,
body .am-btn--outline .elementor-button {
	font-family: var(--am-font-mono);
	font-weight: 700;
	font-size: 16px;
	border-radius: 0;
	min-height: 52px;
	display: inline-flex;
	align-items: center;
	padding: 0 28px;
}
body .am-btn .elementor-button {
	background: var(--am-inv);
	color: var(--am-inv-fg);
	border: 1px solid var(--am-inv);
}
body .am-btn--outline .elementor-button {
	background: transparent;
	color: var(--am-fg);
	border: 1px solid var(--am-fg);
}
body .am-btn--sm .elementor-button { min-height: 44px; padding: 0 20px; font-size: 15px; }

/* =========================================================
   Шапка: логотип, меню UAE, переключатель темы
   ========================================================= */

/* Логотип [am_logo]: знак + надпись + подпись. Размеры — от --am-logo-h (атрибут height) */
.am-logo {
	--am-logo-h: 44px;
	display: inline-flex;
	align-items: center;
	gap: calc(var(--am-logo-h) * .26);
	line-height: 1;
	color: var(--am-fg);
	text-decoration: none;
}
/* Логотип ведёт на главную: при наведении чуть гаснет, как ссылки сайта; рамка — для клавиатуры */
.am-logo { transition: opacity .15s ease; }
.am-logo:hover { opacity: .72; }
.am-logo:focus-visible { outline: 1px dashed var(--am-fg); outline-offset: 6px; opacity: 1; }
.am-logo__mark, .am-logo__text { display: flex; }
.am-logo__text { flex-direction: column; align-items: flex-start; gap: calc(var(--am-logo-h) * .09); }
body .am-logo img.am-logo__img { width: auto; max-width: none; display: block; border: 0; }
body .am-logo .am-logo__mark img.am-logo__img { height: var(--am-logo-h); }
body .am-logo--glyph .am-logo__mark img.am-logo__img { height: calc(var(--am-logo-h) * .62); }
body .am-logo .am-logo__text img.am-logo__img { height: calc(var(--am-logo-h) * .5); }
.am-logo__sub {
	font: 500 calc(var(--am-logo-h) * .3)/1 'Montserrat', var(--am-font-sans);
	letter-spacing: .01em;
	white-space: nowrap;
	color: var(--am-fg);
}

/* Какая из пары картинок видна: на светлом фоне — тёмная, на тёмном — светлая */
body .am-logo img.am-logo__img--on-dark { display: none; }
:root[data-theme="dark"] body .am-logo img.am-logo__img--on-light { display: none; }
:root[data-theme="dark"] body .am-logo img.am-logo__img--on-dark { display: block; }
/* В инверсных блоках — наоборот */
body .am-inv .am-logo img.am-logo__img--on-light { display: none; }
body .am-inv .am-logo img.am-logo__img--on-dark { display: block; }
:root[data-theme="dark"] body .am-inv .am-logo img.am-logo__img--on-light { display: block; }
:root[data-theme="dark"] body .am-inv .am-logo img.am-logo__img--on-dark { display: none; }

@media (max-width: 640px) {
	.am-logo { --am-logo-h: 44px !important; }
}

.am-theme-toggle {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	color: var(--am-fg);
	border: 1px solid var(--am-line);
	border-radius: 0;
	cursor: pointer;
}
.am-theme-toggle:hover,
.am-theme-toggle:focus { background: transparent; color: var(--am-fg); border-color: var(--am-fg); }
.am-theme-toggle__sun { display: none; }
:root[data-theme="dark"] .am-theme-toggle__sun { display: block; }
:root[data-theme="dark"] .am-theme-toggle__moon { display: none; }

/* Меню Ultimate Addons (виджет «Navigation Menu» с классом am-nav) */
body .am-nav .hfe-nav-menu a.hfe-menu-item,
body .am-nav .hfe-nav-menu a.hfe-sub-menu-item {
	font-family: var(--am-font-mono);
	font-size: 15px;
	font-weight: 500;
	color: var(--am-fg);
}
body .am-nav .hfe-nav-menu .current-menu-item > a.hfe-menu-item {
	box-shadow: inset 0 -2px 0 var(--am-fg);
}
body .am-nav .hfe-nav-menu__toggle { color: var(--am-fg); }
body .am-nav .hfe-nav-menu-icon {
	color: var(--am-fg);
	border: 1px solid var(--am-line);
	border-radius: 0;
	padding: 10px;
}
body .am-nav .hfe-nav-menu-icon svg { fill: currentColor; }
body .am-nav nav.hfe-dropdown,
body .am-nav .hfe-dropdown .hfe-nav-menu,
body .am-nav .hfe-dropdown .menu-item { background-color: var(--am-bg) !important; }
body .am-nav nav.hfe-dropdown { border: 1px solid var(--am-fg); }
body .am-nav .hfe-dropdown a.hfe-menu-item,
body .am-nav .hfe-dropdown a.hfe-sub-menu-item {
	border-bottom: 1px solid var(--am-line);
	background-color: var(--am-bg) !important;
	color: var(--am-fg) !important;
}
body .am-nav .hfe-dropdown .current-menu-item > a.hfe-menu-item {
	background-color: var(--am-inv) !important;
	color: var(--am-inv-fg) !important;
	box-shadow: none;
}

/* =========================================================
   Формы (Contact Form 7)
   ========================================================= */

.wpcf7 form > p { margin: 0 0 18px; }
.wpcf7 label { font-family: var(--am-font-mono); font-size: 14px; font-weight: 700; display: block; }
.wpcf7 label .wpcf7-form-control-wrap { display: block; margin-top: 6px; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--am-fg);
	border-radius: 0;
	background: transparent;
	color: var(--am-fg);
	font: 400 16px/1.5 var(--am-font-sans);
	box-sizing: border-box;
}
.wpcf7 textarea { resize: vertical; }
.wpcf7 .wpcf7-acceptance label,
.wpcf7 .wpcf7-list-item-label { font-family: var(--am-font-sans); font-size: 14px; font-weight: 400; color: var(--am-muted); }
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-acceptance label { display: flex; gap: 12px; align-items: flex-start; }
.wpcf7 .wpcf7-acceptance a { color: var(--am-fg); }
.wpcf7 input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--am-fg); }
.wpcf7 .wpcf7-submit {
	min-height: 52px;
	padding: 0 28px;
	border: 0;
	border-radius: 0;
	background: var(--am-inv);
	color: var(--am-inv-fg);
	font: 700 16px var(--am-font-mono);
	cursor: pointer;
}
/* Пока не отмечено согласие, CF7 выключает кнопку — показываем контур, а не «серую поломку» */
.wpcf7 .wpcf7-submit:disabled {
	opacity: 1;
	background: transparent;
	color: var(--am-muted);
	box-shadow: inset 0 0 0 1px var(--am-muted);
	cursor: not-allowed;
}
.wpcf7 .wpcf7-not-valid-tip { font: 13px var(--am-font-mono); color: var(--am-fg); margin-top: 4px; }
.wpcf7 .wpcf7-not-valid-tip::before { content: "! "; font-weight: 700; }
.wpcf7 form .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 12px 16px;
	border: 1px dashed var(--am-fg);
	font: 14px var(--am-font-mono);
}

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

/* =========================================================
   Список инструкций (home.php, archive.php, search.php)
   ========================================================= */

.am-archive__wrap {
	max-width: var(--am-wrap);
	margin-inline: auto;
	padding-inline: var(--am-gutter);
	box-sizing: border-box;
}
.am-archive__head { padding: 72px 0 40px; border-bottom: 1px solid var(--am-line); }
.am-archive__head .am-label { margin: 0 0 16px; }
.am-archive__title {
	margin: 0 0 16px;
	font-family: var(--am-font-mono);
	font-weight: 800;
	font-size: clamp(36px, 5vw, 60px);
	line-height: 1.08;
	letter-spacing: -0.02em;
}
.am-archive__title::after { content: "_"; animation: am-blink 1.1s steps(1) infinite; }
.am-archive__lead { margin: 0 0 28px; max-width: 680px; font-size: 19px; color: var(--am-muted); }
.am-archive__body { padding: 40px 0 96px; }

.am-search {
	display: flex;
	align-items: stretch;
	max-width: 680px;
	margin: 0 0 24px;
	border: 1px solid var(--am-fg);
	background: var(--am-bg);
	font-family: var(--am-font-mono);
}
.am-search__prompt { display: flex; align-items: center; padding: 0 0 0 14px; font-weight: 700; }
.am-search__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 48px;
	padding: 0 12px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--am-fg);
	font: 400 16px var(--am-font-mono);
}
/* Hello Elementor рисует у полей ввода свою рамку и скругление — убираем внутри нашего поиска */
body .am-search input.am-search__input,
body .am-search input.am-search__input:focus {
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	background: transparent;
	padding: 0 12px;
	height: 48px;
}
.am-search:focus-within { outline: 2px solid var(--am-fg); outline-offset: 2px; }
.am-search__btn {
	padding: 0 20px;
	border: 0;
	border-radius: 0;
	background: var(--am-inv);
	color: var(--am-inv-fg);
	font: 700 15px var(--am-font-mono);
	cursor: pointer;
}
.am-search__btn:hover, .am-search__btn:focus { background: var(--am-inv); color: var(--am-inv-fg); opacity: .85; }

.am-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.am-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 0 12px;
	border: 1px solid var(--am-line);
	font: 500 14px var(--am-font-mono);
	text-decoration: none;
}
.am-chip:hover { opacity: 1; border-color: var(--am-fg); }
.am-chip.is-active { background: var(--am-inv); color: var(--am-inv-fg); border-color: var(--am-inv); }
.am-chip__n { color: var(--am-muted); }
.am-chip.is-active .am-chip__n { color: inherit; opacity: .7; }

.am-pagination { margin-top: 40px; font-family: var(--am-font-mono); }
.am-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.am-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--am-line);
	text-decoration: none;
}
.am-pagination .page-numbers.current { background: var(--am-inv); color: var(--am-inv-fg); border-color: var(--am-inv); }
.am-pagination .page-numbers.dots { border: 0; }

/* =========================================================
   Телефон и планшет
   ========================================================= */

/* Якоря разделов (/uslugi/#1c) не прилипают к краю */
/* Якоря разделов (/uslugi/#1c) не прячутся под закреплённую шапку */
.e-con[id] { scroll-margin-top: calc(var(--am-sticky-h, 0px) + 16px); }

/* Закреплённая шапка (ALIMUSAEV_STICKY_HEADER в functions.php).
   Липнет весь #masthead, но со сдвигом вверх на высоту верхней полосы:
   полоса уезжает при прокрутке, основная строка остаётся. Сдвиг и высоту
   считает theme.js (--am-sticky-top, --am-sticky-h) с учётом панели WordPress. */
body.am-sticky #masthead {
	position: sticky;
	top: var(--am-sticky-top, 0px);
	z-index: 990;
}
body.am-sticky #masthead header.e-con { transition: box-shadow .2s ease; }
html.am-is-stuck body.am-sticky #masthead header.e-con { box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .55); }

@media (max-width: 1024px) {
	/* Шапка в одну строку: логотип | тема | меню. «Обратиться» есть в верхней полосе.
	   Сетка вместо flex: иначе Elementor сжимает логотип до нуля, а меню растягивает. */
	#masthead header.e-con { position: relative; }
	#masthead header.e-con > .e-con-inner,
	#masthead header.e-con.e-con-full {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) auto auto;
		align-items: center;
		column-gap: 10px;
	}
	#masthead header.e-con .elementor-widget-shortcode { grid-column: 1; grid-row: 1; min-width: 0; width: auto !important; }
	#masthead header.e-con .e-con.am-shrink { grid-column: 2; grid-row: 1; margin: 0; }
	#masthead header.e-con .am-shrink .am-btn--sm { display: none; }
	#masthead header.e-con .am-nav { grid-column: 3; grid-row: 1; width: auto !important; max-width: none; }

	/* Выпадающее меню — от края до края под шапкой */
	#masthead header.e-con .am-nav,
	#masthead header.e-con .am-nav .elementor-widget-container,
	#masthead .am-nav .hfe-nav-menu { position: static; }
	#masthead .am-nav nav.hfe-dropdown {
		position: absolute !important;
		top: 100% !important;
		left: 0 !important;
		right: 0 !important;
		width: auto !important;
		z-index: 1000;
		/* длинное меню прокручивается, а не уходит за экран */
		max-height: calc(100vh - var(--am-sticky-h, 0px));
		max-height: calc(100dvh - var(--am-sticky-h, 0px));
		overflow-y: auto;
	}
	#masthead .am-nav .hfe-nav-menu__toggle { display: inline-flex; width: auto; margin: 0; }
}

@media (max-width: 640px) {
	/* Верхняя полоса — одна строка: Telegram и «Оставить заявку» */
	#masthead .e-con.am-inv .am-links--row { gap: 4px 16px; font-size: 12px; }
	#masthead .e-con.am-inv .am-links--row a:nth-child(2) { display: none; }

	/* Цифры 2×2 */
	body .e-con.am-stat { flex: 1 1 40%; }
	body .e-con.am-stat .elementor-heading-title { font-size: 32px; }
}

/* =========================================================
   Кнопки для редактора (видит только тот, кто может править)
   ========================================================= */

.am-admin-btn {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 10px;
	border: 1px dashed var(--am-fg);
	font: 500 13px var(--am-font-mono);
	text-decoration: none;
	white-space: nowrap;
}
.am-admin-btn:hover { opacity: 1; background: var(--am-surface); }

.am-archive__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 24px; }
.am-archive__bar .am-search { flex: 1 1 360px; margin: 0; }

.am-postlist__row { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--am-line); }
.am-postlist__row .am-postlist__item { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
.am-postlist__row .am-postlist__edit { flex: 0 0 auto; }
@media (max-width: 640px) {
	.am-postlist__row { flex-wrap: wrap; gap: 0 16px; padding-bottom: 14px; }
}

/* =========================================================
   [am_soft_preview]: две таблицы на главной
   ========================================================= */

.am-softpreview { display: flex; flex-direction: column; gap: 28px; }
.am-softpreview__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 4px 16px;
	margin-bottom: 10px;
	font-family: var(--am-font-mono);
	font-size: 15px;
}
.am-softpreview__cmd { font-weight: 700; }
.am-softpreview__head a { font-size: 14px; text-decoration: none; color: var(--am-muted); }
.am-softpreview__head a:hover { color: var(--am-fg); opacity: 1; }
.am-softpreview__empty {
	margin: 0;
	padding: 14px 16px;
	border: 1px dashed var(--am-line);
	font: 14px var(--am-font-mono);
	color: var(--am-muted);
}

/* Меню UAE при узком окне (или масштабе >125 %) ставит себе ширину в атрибуте style
   и не убирает её, когда окно снова широкое, — меню выталкивает кнопки на новую строку. */
@media (min-width: 1025px) {
	#masthead .am-nav nav.hfe-nav-menu__layout-horizontal {
		width: auto !important;
		left: auto !important;
		position: static !important;
	}
	#masthead header.e-con > .e-con-inner { flex-wrap: nowrap; }
	#masthead header.e-con .am-nav { min-width: 0; }
}

/* Путь-«хлебные крошки» в подписи раздела: C:\> dir \solutions\windows */
.am-label a { text-decoration: none; border-bottom: 1px dotted currentColor; }
.am-label a:hover { opacity: 1; border-bottom-style: solid; }

/* [am_counter] — цифры на главной (как прежние заголовки 44 px) */
.am-counter { display: flex; flex-direction: column; gap: 4px; font-family: var(--am-font-mono); color: var(--am-fg); }
.am-counter__value { font: 800 44px/1.1 var(--am-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.am-counter__label { font-size: 14px; line-height: 1.6; }
@media (max-width: 640px) { .am-counter__value { font-size: 32px; } }

/* Плашка cookie — окно терминала внизу слева */
.am-cookie {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 9999;
	width: min(420px, calc(100vw - 32px));
	border: 1px solid var(--am-fg);
	background: var(--am-bg);
	color: var(--am-fg);
	font: 14px/1.55 var(--am-font-mono);
	box-shadow: 6px 6px 0 rgba(0, 0, 0, .18);
}
.am-cookie[hidden] { display: none; }
.am-cookie__bar { display: flex; justify-content: space-between; padding: 6px 12px; background: var(--am-inv); color: var(--am-inv-fg); font-weight: 700; }
.am-cookie__body { padding: 14px 16px 16px; }
.am-cookie__body p { margin: 0 0 12px; font-family: var(--am-font-sans); font-size: 14px; }
.am-cookie__body a { text-decoration: underline; }
.am-cookie__btns { display: flex; flex-wrap: wrap; gap: 8px; }
body .am-cookie__btn {
	min-height: 38px;
	padding: 0 14px;
	border: 1px solid var(--am-fg);
	border-radius: 0;
	background: transparent;
	color: var(--am-fg);
	font: 700 14px var(--am-font-mono);
	cursor: pointer;
}
body .am-cookie__btn--main { background: var(--am-inv); color: var(--am-inv-fg); border-color: var(--am-inv); }
body .am-cookie__btn:hover, body .am-cookie__btn:focus-visible { background: var(--am-inv); color: var(--am-inv-fg); opacity: .9; }
@media print { .am-cookie { display: none !important; } }

/* Выделение текста — инверсия, как в DOS-редакторах */
::selection { background: var(--am-fg); color: var(--am-bg); }

/* Заголовок первого экрана на телефоне: без принудительных переносов строк,
   иначе «софт» остаётся одно на строке */
@media (max-width: 640px) {
	.am-cursor .elementor-heading-title br { display: none; }
}

/* =========================================================
   Ретро: живой терминал, прогресс чтения, справка F1, ver
   ========================================================= */

/* Командная строка в [am_terminal] */
.am-term__out { margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.am-term__out:empty { display: none; }
.am-term__line { line-height: 1.6; }
.am-term__echo { color: var(--am-muted); margin-top: 6px; }
.am-term__prompt { display: flex; align-items: center; gap: .6ch; margin: 0; }
.am-term__prompt label { white-space: nowrap; cursor: text; }
body .am-term .am-term__prompt input {
	flex: 1 1 auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0;
	outline: none;
	box-shadow: none !important;
	background: transparent !important;
	color: var(--am-fg);
	font: inherit;
	caret-color: var(--am-fg);
	caret-shape: block;
}
body .am-term .am-term__prompt input::placeholder { color: var(--am-muted); opacity: .55; }
.am-term:focus-within { outline: 1px dashed var(--am-muted); outline-offset: 4px; }

/* Прогресс чтения: полоса из ▓░ под закреплённой шапкой */
.am-progress {
	position: fixed;
	left: 0;
	right: 0;
	top: var(--am-sticky-h, 0px);
	z-index: 980;
	height: 22px;
	padding: 0 16px;
	overflow: hidden;
	background: var(--am-bg);
	border-bottom: 1px solid var(--am-line);
	color: var(--am-muted);
	font: 12px/22px var(--am-font-mono);
	white-space: pre;
	text-align: center;
	opacity: 0;
	transform: translateY(-4px);
	pointer-events: none;
	transition: opacity .2s, transform .2s;
}
.am-progress.is-on { opacity: 1; transform: none; }
@media print { .am-progress { display: none !important; } }

/* Справка F1 — окно в стиле Norton Commander */
.am-help {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(0, 0, 0, .55);
}
.am-help[hidden] { display: none; }
.am-help__win {
	width: min(560px, 100%);
	border: 1px solid var(--am-fg);
	background: var(--am-bg);
	color: var(--am-fg);
	font: 14px/1.6 var(--am-font-mono);
	box-shadow: 8px 8px 0 rgba(0, 0, 0, .35);
}
.am-help__bar { display: flex; justify-content: space-between; padding: 6px 14px; background: var(--am-inv); color: var(--am-inv-fg); font-weight: 700; }
.am-help__body { padding: 16px 18px 10px; }
.am-help__keys { width: 100%; border-collapse: collapse; }
.am-help__keys th, .am-help__keys td { padding: 5px 0; border-bottom: 1px dashed var(--am-line); text-align: left; vertical-align: top; }
.am-help__keys th { width: 38%; font-weight: 400; }
.am-help__keys kbd { display: inline-block; min-width: 2.2em; padding: 0 6px; border: 1px solid var(--am-fg); font: inherit; text-align: center; }
.am-help__note { margin: 12px 0 6px; color: var(--am-muted); font-size: 13px; }
.am-help__keysbar { display: flex; flex-wrap: wrap; border-top: 1px solid var(--am-fg); }
.am-help__keysbar span,
body .am-help__keysbar button {
	flex: 1 1 auto;
	padding: 4px 8px;
	border: 0;
	border-right: 1px solid var(--am-line);
	border-radius: 0;
	background: transparent;
	color: var(--am-fg);
	font: 13px var(--am-font-mono);
	text-align: left;
}
.am-help__keysbar b { margin-right: 4px; padding: 0 3px; background: var(--am-inv); color: var(--am-inv-fg); }
body .am-help__keysbar button { cursor: pointer; border-right: 0; }
body .am-help__keysbar button:hover, body .am-help__keysbar button:focus-visible { background: var(--am-surface); outline: none; }

/* Страница «Версия» (/ver/) */
.am-ver__term { max-width: 860px; }
.am-ver__body h2, .am-ver__body h3 { margin: 22px 0 6px; font: 700 16px/1.4 var(--am-font-mono); text-transform: none; }
.am-ver__body h2::before, .am-ver__body h3::before { content: none !important; }
.am-ver__body > :first-child { margin-top: 0; }
.am-ver__body ul { margin: 0 0 4px; padding-left: 0; list-style: none; }
.am-ver__body li { padding-left: 2.2ch; text-indent: -2.2ch; font-family: var(--am-font-sans); font-size: 15px; }
.am-ver__body li::before { content: "- "; color: var(--am-muted); }
.am-ver__edit { margin-top: 16px; font: 14px var(--am-font-mono); }

/* Окно терминала на главной: фиксированная высота, вывод прокручивается внутри */
.am-term__body.is-used { max-height: 440px; overflow-y: auto; scrollbar-width: thin; }
.am-term__body.is-clear > :not(.am-term__out):not(.am-term__prompt) { display: none; }

/* Кнопки темы не красятся в розовый от Hello Elementor (button:focus / [type=button]:focus) */
body .am-help .am-help__keysbar button,
body .am-help .am-help__keysbar button:focus { background: transparent; color: var(--am-fg); outline: none; }
body .am-help .am-help__keysbar button:hover,
body .am-help .am-help__keysbar button:focus-visible { background: var(--am-surface); color: var(--am-fg); }
body .am-tools .am-tools__btn:focus:not(:focus-visible) { background: transparent; color: var(--am-fg); }
body .am-404 .am-404__choice:focus:not(:focus-visible) { background: transparent; color: var(--am-fg); }
body .am-cookie .am-cookie__btn:focus:not(:focus-visible) { background: transparent; color: var(--am-fg); }
body .am-cookie .am-cookie__btn--main:focus:not(:focus-visible) { background: var(--am-inv); color: var(--am-inv-fg); }
body .am-code .am-code__copy:focus:not(:focus-visible) { background: transparent; color: inherit; }
.am-term__block { margin-top: 2px; }
.am-term__block .am-term__grid { margin-top: 4px; }

/* Форма пароля («Защищено паролем») в стиле сайта */
.post-password-form { max-width: 560px; margin-top: 8px; font-family: var(--am-font-sans); }
.post-password-form p { margin: 0 0 14px; color: var(--am-muted); }
.post-password-form p:last-child { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; color: var(--am-fg); }
.post-password-form label { display: flex; flex-direction: column; gap: 8px; flex: 1 1 260px; font: 14px var(--am-font-mono); }
body .post-password-form input[type="password"] {
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--am-fg) !important;
	border-radius: 0 !important;
	background: var(--am-bg) !important;
	color: var(--am-fg);
	font: 16px var(--am-font-mono);
	box-shadow: none !important;
	outline: none;
}
body .post-password-form input[type="password"]:focus { outline: 1px dashed var(--am-fg); outline-offset: 3px; }
body .post-password-form input[type="submit"],
body .post-password-form input[type="submit"]:hover,
body .post-password-form input[type="submit"]:focus {
	height: 48px;
	padding: 0 24px;
	border: 1px solid var(--am-inv) !important;
	border-radius: 0 !important;
	background: var(--am-inv) !important;
	color: var(--am-inv-fg) !important;
	font: 700 15px var(--am-font-mono);
	cursor: pointer;
}
body .post-password-form input[type="submit"]:hover { opacity: .85; }

/* Окно заявки поверх страницы */
html.am-modal-open { overflow: hidden; }
.am-modal {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(0, 0, 0, .6);
	overflow-y: auto;
}
.am-modal[hidden] { display: none; }
.am-modal__win {
	width: min(640px, 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	border: 1px solid var(--am-fg);
	background: var(--am-bg);
	color: var(--am-fg);
	box-shadow: 8px 8px 0 rgba(0, 0, 0, .35);
}
.am-modal__bar {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 8px 6px 14px;
	background: var(--am-inv);
	color: var(--am-inv-fg);
	font: 700 14px var(--am-font-mono);
}
body .am-modal .am-modal__close,
body .am-modal .am-modal__close:focus {
	padding: 2px 8px;
	border: 1px solid transparent;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: 700 14px var(--am-font-mono);
	cursor: pointer;
}
body .am-modal .am-modal__close:hover,
body .am-modal .am-modal__close:focus-visible { border-color: currentColor; outline: none; }
.am-modal__body { padding: 22px 24px 8px; }
.am-modal__title { margin: 0 0 6px; font: 800 26px/1.2 var(--am-font-mono); }
.am-modal__lead { margin: 0 0 20px; color: var(--am-muted); font-size: 15px; }
.am-modal__lead a { color: var(--am-fg); }
@media (max-width: 640px) { .am-modal__body { padding: 18px 16px 4px; } .am-modal__title { font-size: 22px; } }

/* C:\> exit — экран «Теперь питание компьютера можно отключить» */
.am-shutdown {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: grid;
	place-items: center;
	padding: 24px;
	background: #000;
	color: #E2E2E2;
	cursor: pointer;
	animation: am-shut-in .6s steps(6);
}
.am-shutdown__msg { text-align: center; font: 700 clamp(20px, 3vw, 34px)/1.4 var(--am-font-mono); }
.am-shutdown__hint { margin-top: 28px; font: 400 14px var(--am-font-mono); color: #777; }
@keyframes am-shut-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .am-shutdown { animation: none; } }
.am-footer-bottom a[data-am-exit] { text-decoration: none; }

/* «Оставить заявку» в верхней полосе дублирует кнопку «Обратиться» — на компьютере прячем.
   На телефоне кнопки «Обратиться» в шапке нет, поэтому там ссылка остаётся. */
@media (min-width: 1025px) {
	#masthead .e-con.am-inv .am-links--row a[href*="#zayavka"] { display: none; }
}
