/* Терра Электро — общие стили сайта.
   Светлая тема по умолчанию, тёмная включается кнопкой (data-theme="dark" на <html>).
   Только жёлтый, чёрный, белый и нейтральные серые (без синего оттенка).
   --accent — жёлтая заливка (кнопки, метки), текстом жёлтый идёт только на тёмном фоне;
   на светлом ссылки и активные пункты — цветом текста с жёлтой чертой (--accent-text). */
:root {
  --bg: #ffffff;
  --surface: #f5f5f3;
  --surface-2: #ebebe8;
  --ink: #1b1b1a;
  --muted: #5f5f5a;
  --line: #e0e0dc;
  --accent: #f5b818;
  --accent-hover: #e4a800;
  --accent-ink: #1b1b1a;
  --accent-text: #1b1b1a;
  --accent-soft: #fdf1cc;
  --copper: #a85b24;
  --logo-bg: #ffffff;
  --shade: rgba(20, 20, 18, .10);
  /* тёмные блоки (главный экран, страницы товаров) одинаковы в обеих темах */
  --dark: #181817; --dark-2: #232321; --dark-line: #3a3a37; --on-dark: #f3f3ef; --on-dark-muted: #b4b4ad;
  --plate-a: #dfdfdc; --plate-b: #c6c6c2; --plate-ink: #1b1b1a; --plate-edge: #a6a6a1; --plate-line: rgba(27,27,26,.22);
  /* шрифт как на terra-electro.ru */
  --font-display: "Libre Franklin", Helvetica, Arial, sans-serif;
  --font-body: "Libre Franklin", Helvetica, Arial, sans-serif;
  --radius: 8px;
  --header-h: 68px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #131312; --surface: #1b1b1a; --surface-2: #242422; --ink: #ecece8; --muted: #a5a59f; --line: #31312e;
  --accent: #f5b818; --accent-hover: #ffc93d; --accent-ink: #1b1b1a; --accent-text: #f5b818; --accent-soft: #3a3016;
  --copper: #d68b51; --logo-bg: #f4f4f2;
  --shade: rgba(0,0,0,.45);
  --dark: #0e0e0d; --dark-2: #1b1b1a; --dark-line: #34342f;
  --plate-a: #55554f; --plate-b: #3c3c38; --plate-ink: #ececea; --plate-edge: #6a6a64; --plate-line: rgba(236,236,232,.2);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }
[hidden] { display: none !important; }
p, ul, ol, dl { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: 1240px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 .9375rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost-light { border-color: rgba(255,255,255,.35); color: var(--on-dark); background: transparent; }
.btn-ghost-light:hover { border-color: var(--on-dark); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--accent); color: var(--accent-ink); }
.btn .ic { width: 18px; height: 18px; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .875rem; }

/* ---------- Верхняя строка ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.topbar .wrap { display: flex; align-items: center; gap: 8px 24px; min-height: 44px; flex-wrap: wrap; }
.topbar .tagline { margin-right: auto; }
.topbar a { text-decoration: none; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.topbar a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--ink); font: 500 .8125rem/1.4 var(--font-body); cursor: pointer; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
.top-search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.top-search:focus-within { border-color: var(--ink); }
.top-search input { width: 150px; border: 0; background: none; padding: 4px 0 4px 12px; color: var(--ink); font: 400 .8125rem/1.4 var(--font-body); outline: none; }
.top-search button { display: grid; place-items: center; background: none; border: 0; padding: 4px 10px 4px 6px; color: var(--muted); cursor: pointer; }
.top-search button:hover { color: var(--ink); }
@media (max-width: 860px) { .topbar .tagline, .topbar .email { display: none; } }
@media (max-width: 480px) { .top-search input { width: 110px; } }
@media (max-width: 480px) { .topbar .phone-top { display: none; } .topbar .wrap { justify-content: space-between; } }

/* ---------- Шапка ---------- */
/* без backdrop-filter: он делает шапку контейнером для position:fixed и обрезает мобильное меню */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { height: 40px; width: auto; display: block; }
:root[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
.brand-text { font: 600 1.0625rem/1 var(--font-display); white-space: nowrap; }

.nav { margin-left: auto; }
.nav > ul { display: flex; gap: 0; list-style: none; padding: 0; }
.nav li { position: relative; }
.nav a { display: block; padding: 10px 8px; border-radius: 6px; text-decoration: none; font-weight: 500; font-size: .9063rem; color: var(--ink); white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav .sub a:hover, .nav .sub a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
.btn-cta { flex: none; }
@media (max-width: 1260px) and (min-width: 1181px) { .btn-cta { display: none; } }
@media (max-width: 1180px) { .btn-cta { margin-left: auto; } .btn-cta + .burger { margin-left: 0; } }
@media (max-width: 640px) { .btn-cta { display: none; } .btn-cta + .burger { margin-left: auto; } }
.nav .has-sub > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.nav .sub { position: absolute; top: 100%; left: 0; min-width: 260px; padding: 8px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px var(--shade); visibility: hidden; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; }
.nav .sub a { white-space: normal; }
.nav .sub a:hover { background: var(--surface); }
.nav .has-sub:hover > .sub, .nav .has-sub:focus-within > .sub { visibility: visible; opacity: 1; transform: none; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: none; color: var(--ink); cursor: pointer; }
.burger span { display: block; width: 18px; height: 2px; margin: 4px auto; background: currentColor; }

@media (max-width: 1180px) {
  .burger { display: block; }
  .nav { position: fixed; inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 0 0; background: var(--bg); overflow-y: auto; padding: 8px max(16px, env(safe-area-inset-left, 0px)) 32px; display: none; border-top: 1px solid var(--line); }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; gap: 0; }
  .nav > ul > li { border-bottom: 1px solid var(--line); }
  .nav a { padding: 14px 4px; font-size: 1.0625rem; }
  .nav .sub { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; border: 0; padding: 0 0 8px 16px; min-width: 0; }
  .nav .sub a { padding: 8px 4px; font-size: 1rem; color: var(--muted); }
  .nav .has-sub > a::after { display: none; }
}

/* ---------- Заголовок внутренней страницы ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-block: clamp(28px, 5vw, 56px); display: grid; gap: 14px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .875rem; color: var(--muted); list-style: none; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent); }
.page-head h1 { font: 500 clamp(1.75rem, 1.1rem + 2.4vw, 2.75rem)/1.12 var(--font-display); letter-spacing: -.015em; max-width: 24ch; hyphens: auto; }
.page-head .lead { color: var(--muted); font-size: 1.125rem; max-width: 64ch; }

/* ---------- Секции ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); }
.section.tight { padding-block: clamp(32px, 5vw, 64px); }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; max-width: 760px; margin-bottom: clamp(24px, 4vw, 44px); }
.section-head h2 { font: 500 clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem)/1.15 var(--font-display); letter-spacing: -.01em; }
.section-head p { color: var(--muted); font-size: 1.0625rem; max-width: 64ch; }
.section-head .more { justify-self: start; }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.prose { display: grid; gap: 14px; max-width: 72ch; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose h3 { font: 600 1.25rem/1.3 var(--font-body); margin-top: 12px; }

/* Картинка, которой может не быть (до запуска fetch-images.sh) */
.ph { position: relative; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.ph img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ph img.missing { visibility: hidden; }
.ph.cover img { object-fit: cover; }

/* ---------- Плитки категорий ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; list-style: none; padding: 0; }
.tile { display: grid; grid-template-rows: auto auto 1fr; gap: 8px; height: 100%; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--ink); box-shadow: 0 8px 24px var(--shade); }
.tile .ph { aspect-ratio: 4 / 3; background: var(--surface); }
.tile h3 { font: 600 1.0625rem/1.3 var(--font-body); margin-top: 6px; }
.tile p { color: var(--muted); font-size: .9375rem; line-height: 1.5; }

/* ---------- Три направления ---------- */
.dirs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; padding: 0; }
@media (max-width: 860px) { .dirs { grid-template-columns: minmax(0, 1fr); } }
.dir-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; height: 100%; padding: 20px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); text-decoration: none; }
.dir-card .ph { aspect-ratio: 16 / 9; }
.dir-card h3 { font: 500 1.25rem/1.25 var(--font-display); }
.dir-card p { color: var(--muted); }
.dir-card .go { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.dir-card:hover { border-color: var(--ink); }

/* ---------- Преимущества ---------- */
.adv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; list-style: none; padding: 0; }
@media (max-width: 860px) { .adv { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .adv { grid-template-columns: minmax(0, 1fr); } }
.adv li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; }
.adv .ph { width: 56px; height: 56px; background: transparent; }
.adv.text li { grid-template-columns: minmax(0, 1fr); }
.adv b { display: block; font-weight: 600; margin-bottom: 2px; }
.adv span { color: var(--muted); font-size: .9375rem; }

/* ---------- Логотипы ---------- */
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; list-style: none; padding: 0; }
.logo-card { display: grid; grid-template-rows: 88px auto; gap: 10px; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; text-align: center; }
.logo-card .ph { background: var(--logo-bg); }
.logo-card .ph img { padding: 10px; }
.logo-card span { font-size: .875rem; font-weight: 500; line-height: 1.35; }
.logo-card small { display: block; color: var(--muted); font-weight: 400; }
a.logo-card:hover { border-color: var(--ink); }

/* ---------- Партнёры ---------- */
.partner-logo { background: transparent; }
.partner-logo img { object-fit: contain; }
.partner-logo .on-dark { display: none; }
:root[data-theme="dark"] .partner-logo .on-light { display: none; }
:root[data-theme="dark"] .partner-logo .on-dark { display: block; }
.partners { display: grid; gap: 16px; list-style: none; padding: 0; }
.partner-card { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px; align-items: center; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; }
.partner-card .partner-logo { aspect-ratio: 16 / 5; }
.partner-card > div:last-child { display: grid; gap: 8px; }
.partner-card small { color: var(--muted); font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.partner-card h3 { font: 500 1.375rem/1.25 var(--font-display); }
.partner-card p { color: var(--muted); }
.partner-card .go { justify-self: start; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.partner-card:hover { border-color: var(--ink); }
@media (max-width: 760px) { .partner-card { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px; } }
.partner-intro { align-items: start; }
.partner-intro .partner-logo { aspect-ratio: 2285 / 580; }
.partner-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; }
.partner-facts b { display: block; font: 500 clamp(2rem, 1.4rem + 2vw, 2.75rem)/1.1 var(--font-display); box-shadow: inset 0 -.18em 0 var(--accent); justify-self: start; width: fit-content; margin-bottom: 8px; }
.partner-facts span { color: var(--muted); }
@media (max-width: 640px) { .partner-facts { grid-template-columns: minmax(0, 1fr); } }
.partner-sub { margin-top: 40px; }
.partner-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.partner-tags li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9375rem; }

/* ---------- Новости ---------- */
.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 20px; list-style: none; padding: 0; }
.news-card { display: grid; grid-template-rows: auto auto auto 1fr; gap: 10px; height: 100%; }
.news-card .ph { aspect-ratio: 16 / 10; }
.news-card time { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.news-card h3 { font: 600 1.0625rem/1.35 var(--font-body); }
.news-card p { color: var(--muted); font-size: .9375rem; }
a.news-card { color: inherit; text-decoration: none; }
a.news-card .ph img { transition: transform .3s; }
a.news-card:hover .ph img { transform: scale(1.03); }
a.news-card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Страница новости */
.article { display: grid; gap: 24px; max-width: 840px; }
.article-date { color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.article-cover { max-width: 560px; aspect-ratio: 16 / 10; }
.article .prose { font-size: 1.0625rem; line-height: 1.65; }
.article .prose a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article-img { margin: 8px 0; }
.article-img .ph { background: transparent; }
.article-img img, .article-gallery img { cursor: zoom-in; }
.article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; list-style: none; padding: 0 !important; margin: 8px 0; }
.article-gallery .ph { aspect-ratio: 4 / 3; }
.article-video { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; margin: 8px 0; }
.article-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-nav a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; color: inherit; text-decoration: none; }
.article-nav a:hover { border-color: var(--ink); }
.article-nav small { color: var(--muted); font-size: .8125rem; }
.article-nav span { font-weight: 600; line-height: 1.35; }
.article-nav-next { text-align: right; }
@media (max-width: 560px) { .article-nav { grid-template-columns: 1fr; } }

/* Поиск */
.search-page { display: grid; gap: 20px; max-width: 840px; }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; }
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-status { color: var(--muted); }
.search-results { list-style: none; padding: 0; display: grid; gap: 22px; }
.search-results a { font-weight: 600; font-size: 1.125rem; color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.search-results p { color: var(--muted); margin-top: 4px; }
.search-results mark { background: var(--accent-soft); color: var(--ink); padding: 0 1px; border-radius: 2px; }

/* ---------- Карточки товаров ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; list-style: none; padding: 0; }
.product { display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; height: 100%; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.product .ph { aspect-ratio: 4 / 3; background: var(--surface); }
.product h3 { font: 600 1.125rem/1.3 var(--font-body); }
.specs { display: grid; grid-template-columns: minmax(0, 11ch) minmax(0, 1fr); border-top: 1px solid var(--line); font-size: .875rem; }
.specs dt, .specs dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); padding-right: 12px; }
.specs dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.product-foot .price { color: var(--muted); font-size: .9375rem; }
.product.text-only { grid-template-rows: auto 1fr auto; }

/* ---------- Блоки «картинка + текст» ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding-block: 32px; border-top: 1px solid var(--line); }
.feature:first-child { border-top: 0; padding-top: 0; }
.feature .ph { aspect-ratio: 4 / 3; }
.feature h3 { font: 500 1.375rem/1.25 var(--font-display); margin-bottom: 12px; }
.feature p { color: var(--muted); }
.feature ul { margin-top: 12px; padding-left: 1.2em; display: grid; gap: 4px; }
.feature .more { margin-top: 14px; }
@media (max-width: 760px) { .feature { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* ---------- Этапы работ (настоящая последовательность) ---------- */
.stages { counter-reset: st; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; list-style: none; padding: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
@media (max-width: 860px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stages { grid-template-columns: minmax(0, 1fr); } }
.stages li { counter-increment: st; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.stages li::before { content: counter(st); font: 500 1.75rem/1 var(--font-display); color: var(--accent-text); padding-bottom: 8px; border-bottom: 3px solid var(--accent); justify-self: start; }
.stages b { font-weight: 600; }
.stages span { color: var(--muted); font-size: .9375rem; }

/* ---------- Таблица характеристик ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.spec-table th, .spec-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--muted); width: 55%; }
.spec-table td { font-weight: 600; font-variant-numeric: tabular-nums; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; border-top: 1px solid var(--line); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 36px 18px 0; font-weight: 600; font-size: 1.0625rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 1.5rem/1 var(--font-body); color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; color: var(--muted); max-width: 70ch; }

/* ---------- Контакты ---------- */
.offices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .offices { grid-template-columns: minmax(0, 1fr); } }
.office { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 16px; align-content: start; }
.office h3 { font: 500 1.25rem/1.25 var(--font-display); }
.office dl { display: grid; gap: 12px; }
.office dt { font-size: .8125rem; color: var(--muted); }
.office dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.office dd a { text-decoration: none; }
.office dd a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.map { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.map iframe { display: block; width: 100%; height: 420px; border: 0; }
.map-link { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Заявка ---------- */
.request .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
@media (max-width: 860px) { .request .wrap { grid-template-columns: minmax(0, 1fr); } }
.request h2 { font: 500 clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem)/1.15 var(--font-display); }
.request .intro { display: grid; gap: 14px; align-content: start; }
.request .intro p { color: var(--muted); }
.request .intro .contact-line { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.request .intro .contact-line a { text-decoration: none; }
.form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.form .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .875rem; font-weight: 500; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--ink); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-note { font-size: .8125rem; color: var(--muted); }
.form-status { grid-column: 1 / -1; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--surface); }

/* ---------- Подвал ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 40px 32px; font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 4fr); gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.footer-grid p { color: var(--muted); margin-top: 10px; max-width: 36ch; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; list-style: none; padding: 0; }
.footer-nav a, .footer-contacts a { text-decoration: none; }
.footer-nav a:hover, .footer-contacts a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.footer-contacts { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* =================== ИКОНКИ =================== */
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic .ac { stroke: var(--accent); }
.ic-arrow { width: 18px; height: 18px; stroke-width: 2; }
.ic-big { width: 56px; height: 56px; stroke-width: 1.2; }

/* Заголовок блока со ссылкой справа, как в макете */
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: clamp(20px, 3vw, 32px); }
.row-head h2, .h2 { font: 600 clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem)/1.15 var(--font-body); letter-spacing: -.01em; }
.h2 { margin-bottom: 20px; }

/* =================== ГЛАВНАЯ =================== */
/* Тёмный экран с жёлтой диагональю: текст слева, справа фото контейнеров без фона,
   прижато к правому нижнему углу (левый край мостовой растворён прямо в картинке) */
.hero { position: relative; overflow: hidden; background: var(--dark); color: var(--on-dark); isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 0 46%, var(--accent) 46% 53%, var(--dark-2) 53% 100%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 0 60%, rgba(255,255,255,.04) 60% 62%, transparent 62%),
              radial-gradient(60% 70% at 78% 80%, rgba(245,184,24,.18), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: center; min-height: clamp(420px, 44vw, 560px); padding-block: clamp(40px, 6vw, 72px); }
.hero h1 { font: 700 clamp(2rem, 1.1rem + 3.2vw, 3.5rem)/1.06 var(--font-body); letter-spacing: -.02em; max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-top: 18px; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); color: var(--on-dark-muted); max-width: 34ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-photo { position: absolute; inset: 4% 0 0 36%; z-index: -1; background: url(../../img/hero-bess.webp) right bottom / auto 100% no-repeat; }
@media (max-width: 860px) {
  .hero::before { background: linear-gradient(160deg, transparent 0 63%, var(--accent) 63% 66%, var(--dark-2) 66% 100%); }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero .wrap { padding-bottom: 0; }
  .hero-visual { height: 60vw; }
  .hero-photo { inset: auto 0 0 0; height: 60vw; background-size: 100% auto; background-position: center bottom; }
}

/* Полоса преимуществ */
.feat-strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.feat-strip ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; padding: 0; }
.feat-strip li { display: flex; align-items: center; gap: 14px; padding: 22px 20px; font-weight: 500; line-height: 1.35; }
.feat-strip li + li { border-left: 1px solid var(--line); }
.feat-strip .ic { width: 36px; height: 36px; }
@media (max-width: 960px) {
  .feat-strip ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat-strip li:nth-child(3) { border-left: 0; }
  .feat-strip li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .feat-strip ul { grid-template-columns: minmax(0, 1fr); }
  .feat-strip li + li { border-left: 0; border-top: 1px solid var(--line); }
  .feat-strip li { padding-inline: 0; }
}

/* Что такое СНЭ: текст + схема */
.what-section { background: var(--surface); }
.what { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 40px; align-items: center; }
.what h2 { font: 700 clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem)/1.1 var(--font-body); letter-spacing: -.015em; }
.what .lead { margin: 16px 0 26px; font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem); color: var(--muted); max-width: 30ch; }
@media (max-width: 860px) { .what { grid-template-columns: minmax(0, 1fr); } }
.sne-diagram { width: 100%; height: auto; font: 500 14px/1 var(--font-body); }
.sne-diagram text { fill: var(--ink); }
.sne-diagram .dg-ic { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sne-diagram .dg-ic .ac { stroke: var(--accent); }
.sne-diagram .dg-line { fill: none; stroke: var(--ink); stroke-width: 2; }
.sne-diagram .dg-flow { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sne-diagram .dg-dash { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; }
.sne-diagram .dg-box { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
@media (max-width: 520px) { .sne-diagram { font-size: 17px; } }

/* Наши решения */
.solutions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; padding: 0; }
@media (max-width: 1000px) { .solutions { grid-template-columns: minmax(0, 1fr); } }
.sol-card { display: grid; grid-template-columns: minmax(0, 45%) minmax(0, 1fr); height: 100%; min-height: 168px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; overflow: hidden; box-shadow: 0 6px 20px var(--shade); transition: border-color .15s; }
.sol-card .ph { border-radius: 0; background: var(--surface); transition: background-color .2s; }
.sol-card .ph img { padding: 12px; }
.sol-card:hover .ph { background: var(--accent); }
.sol-card:hover { border-color: var(--ink); }
.sol-body { display: grid; grid-template-rows: auto auto 1fr; gap: 8px; padding: 18px; }
.sol-body h3 { font: 600 1.0625rem/1.3 var(--font-body); }
.sol-body p { color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.round { justify-self: end; align-self: end; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); transition: background-color .15s, border-color .15s; }
.round .ic { width: 18px; height: 18px; stroke-width: 2; }
.sol-card:hover .round, .m-card:hover .round { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Ключевые возможности */
.abilities { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; padding: 0; }
.abilities li { display: flex; align-items: center; gap: 14px; padding: 8px 18px; font-weight: 500; line-height: 1.35; }
.abilities li:first-child { padding-left: 0; }
.abilities li + li { border-left: 1px solid var(--line); }
.abilities .ic { width: 40px; height: 40px; stroke-width: 1.4; }
@media (max-width: 1000px) {
  .abilities { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
  .abilities li, .abilities li:first-child { padding: 8px 16px 8px 0; }
  .abilities li + li { border-left: 0; }
}
@media (max-width: 520px) { .abilities { grid-template-columns: minmax(0, 1fr); } }
.abilities.full { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.abilities.full li { align-items: flex-start; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 0; }
.abilities.full b { display: block; font-weight: 600; margin-bottom: 4px; }
.abilities.full span { color: var(--muted); font-weight: 400; font-size: .9375rem; }
@media (max-width: 860px) { .abilities.full { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .abilities.full { grid-template-columns: minmax(0, 1fr); } }

/* Области применения */
.areas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; }
@media (max-width: 1000px) { .areas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.area { display: grid; grid-template-rows: auto 1fr; border-radius: var(--radius); overflow: hidden; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 6px 20px var(--shade); }
.area-top { display: grid; place-items: center; aspect-ratio: 16 / 10; color: var(--on-dark);
  background: linear-gradient(135deg, var(--dark-2), var(--dark) 70%); position: relative; overflow: hidden; }
.area-top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 0 70%, rgba(245,184,24,.85) 70% 74%, transparent 74%); }
.area-top .ic { position: relative; }
.area-label { display: flex; align-items: center; gap: 10px; padding: 14px; font-size: .9375rem; font-weight: 500; line-height: 1.3; }
.area-label .ic { width: 32px; height: 32px; padding: 5px; border-radius: 6px; background: var(--accent-soft); }

/* Тёмная полоса «Инженерные решения» */
.cta-band { position: relative; overflow: hidden; background: var(--dark); color: var(--on-dark); isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 0 62%, var(--accent) 62% 66%, var(--dark-2) 66%); opacity: .9; }
.cta-band .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: end; padding-block: clamp(40px, 6vw, 64px); }
.cta-text h2 { font: 700 clamp(1.625rem, 1.1rem + 1.8vw, 2.5rem)/1.1 var(--font-body); letter-spacing: -.015em; max-width: 20ch; }
.cta-text p { margin: 10px 0 24px; color: var(--on-dark-muted); font-size: 1.125rem; }
.cta-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: 18px 8px; border: 1px solid var(--dark-line); border-radius: var(--radius); background: rgba(14,14,13,.88); }
.cta-points li { display: flex; align-items: center; gap: 12px; padding: 4px 16px; font-weight: 500; line-height: 1.3; }
.cta-points li + li { border-left: 1px solid var(--dark-line); }
.cta-points .ic { width: 36px; height: 36px; color: var(--accent); }
@media (max-width: 860px) {
  .cta-band .wrap { grid-template-columns: minmax(0, 1fr); }
  .cta-band::before { background: linear-gradient(160deg, transparent 0 80%, var(--accent) 80% 82%, var(--dark-2) 82%); }
}
@media (max-width: 560px) {
  .cta-points { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cta-points li { padding: 0; }
  .cta-points li + li { border-left: 0; }
}

/* =================== КАТАЛОГ СНЭ =================== */
/* Тонкая «чертёжная» сетка на фоне */
.blueprint { background-color: var(--surface);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 120px 120px; background-position: center top; }
.cat-head .wrap { display: grid; justify-items: center; text-align: center; gap: 14px; padding-block: clamp(28px, 5vw, 56px) 8px; }
.cat-head .crumbs { justify-self: start; }
.cat-head h1 { font: 700 clamp(1.75rem, 1.1rem + 2.4vw, 3rem)/1.1 var(--font-body); letter-spacing: -.02em; }
.cat-head .lead { color: var(--muted); font-size: clamp(1.0625rem, 1rem + .4vw, 1.3125rem); }
.cat-body { padding-top: 28px; border-bottom: 1px solid var(--line); }

/* Сегментный переключатель групп */
.seg-tabs { display: flex; max-width: 100%; margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); scrollbar-width: thin; }
.seg-tabs button { flex: none; min-height: 48px; padding: 0 20px; border: 0; background: none; color: var(--ink); font: 500 .9375rem/1.2 var(--font-body); cursor: pointer; white-space: nowrap; }
.seg-tabs button + button { border-left: 1px solid var(--line); }
.seg-tabs button:hover { background: var(--surface); }
.seg-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 24px; list-style: none; padding: 0; }
.p-card { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 6px; height: 100%; padding: 10px 10px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); box-shadow: 0 4px 16px var(--shade); transition: border-color .15s, box-shadow .15s; }
.p-card:hover { border-color: var(--ink); box-shadow: 0 10px 28px var(--shade); }
.p-card .ph { aspect-ratio: 16 / 10; margin-bottom: 12px; background: var(--surface); }
.p-card .ph img { padding: 14px; }
.p-card h3, .p-card .p-type, .p-card .p-points, .p-card .p-foot { margin-inline: 10px; }
.p-card h3 { font: 700 1.3125rem/1.2 var(--font-body); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.p-type { color: var(--muted); font-size: 1rem; }
.p-points { margin-top: 8px; padding-left: 1.1em; display: grid; gap: 3px; align-content: start; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.p-points li::marker { color: var(--accent); }
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.p-foot .price { color: var(--muted); font-size: .875rem; }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cat-empty { color: var(--muted); }

.about-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: 40px; }
.band .about-cols:first-child { margin-top: 0; }
@media (max-width: 860px) { .about-cols { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.sub-h { font: 600 1.25rem/1.3 var(--font-body); margin-bottom: 14px; }
.parts { list-style: none; padding: 0; display: grid; border-top: 1px solid var(--line); }
.parts li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.parts b { font-weight: 600; }
.parts span { color: var(--muted); font-size: .9375rem; }
@media (max-width: 520px) { .parts li { grid-template-columns: minmax(0, 1fr); } }
.prose .btn { margin-top: 8px; }

/* =================== СТРАНИЦА ТОВАРА =================== */
.p-hero { position: relative; overflow: hidden; background: var(--dark); color: var(--on-dark); isolation: isolate; }
.p-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--dark-line) 1px, transparent 1px), linear-gradient(90deg, var(--dark-line) 1px, transparent 1px);
  background-size: 64px 64px; -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%); mask-image: linear-gradient(90deg, #000, transparent 70%); }
.p-hero .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: center; padding-block: clamp(28px, 4vw, 48px) clamp(36px, 5vw, 64px); }
.p-hero .crumbs { color: var(--on-dark-muted); margin-bottom: 18px; }
.p-hero h1 { font: 700 clamp(1.75rem, 1.1rem + 2.4vw, 3rem)/1.1 var(--font-body); letter-spacing: -.02em; max-width: 22ch; }
.p-accent { margin-top: 8px; font: 700 clamp(1.25rem, 1rem + 1.2vw, 2rem)/1.2 var(--font-body); color: var(--accent); font-variant-numeric: tabular-nums; }
.p-hero .lead { margin-top: 16px; color: var(--on-dark-muted); font-size: 1.0625rem; max-width: 62ch; }
.p-hero .actions { margin-top: 28px; }
.p-visual { position: relative; display: grid; place-items: center; min-height: 280px; }
.p-visual::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 2%; height: 22%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(245,184,24,.35), transparent); }
.p-visual img { position: relative; max-height: 440px; width: auto; max-width: 100%; filter: drop-shadow(0 20px 26px rgba(0,0,0,.6)); }
.pv-tag { position: absolute; right: 0; top: 4%; padding: 6px 4px 6px 14px; background: var(--dark); font: 600 1.125rem/1 var(--font-body); color: var(--on-dark); border-bottom: 2px solid var(--accent); }
@media (max-width: 860px) {
  .p-hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .p-visual { order: -1; min-height: 0; }
  .p-hero .crumbs { order: -2; }
  .p-visual img { max-height: 260px; }
}

/* Табло с ключевой цифрой, рядом — график переключения у БАВР */
.p-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: 26px; }
.stat { display: grid; gap: 6px; padding: 18px 26px; border: 1px solid var(--dark-line); border-radius: 10px; background: rgba(255,255,255,.03); position: relative; }
.stat::before, .stat::after { content: ""; position: absolute; left: 22px; right: 22px; height: 6px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 9px); opacity: .8; }
.stat::before { top: 6px; } .stat::after { bottom: 6px; }
.stat b { font: 700 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.stat span { color: var(--on-dark-muted); font-size: .875rem; max-width: 24ch; }
.bavr-wave { width: min(100%, 320px); height: auto; font: 600 13px/1 var(--font-body); }
.bavr-wave path { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.bavr-wave .w1 { stroke: var(--on-dark); }
.bavr-wave .w2 { stroke: var(--accent); }
.bavr-wave .wx { stroke: var(--on-dark-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.bavr-wave text { fill: var(--accent); }

/* Таблица моделей + структура обозначения справа */
.spec-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 1100px) { .spec-grid { grid-template-columns: minmax(0, 1fr); } }
.mt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.mt { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.mt th, .mt td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.mt thead th { background: var(--dark); color: var(--on-dark); font-weight: 500; line-height: 1.3; border-color: rgba(127,127,127,.35); }
.mt thead th + th, .mt thead tr + tr th { border-left: 1px solid rgba(127,127,127,.35); }
.mt thead th[scope="colgroup"] { background: var(--dark-2); color: var(--on-dark); font-size: .8125rem; letter-spacing: .02em; border-bottom: 2px solid var(--accent); }
.mt td { white-space: nowrap; }
.mt td.wrap { white-space: normal; min-width: 22ch; }
.mt td + td { border-left: 1px solid var(--line); }
.mt tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.mt tbody tr:last-child > * { border-bottom: 0; }
.mt tbody tr:hover > * { background: var(--surface); }
.mt tbody tr:target > * { background: var(--accent-soft); }
.mt tbody tr:target > th { box-shadow: inset 4px 0 0 var(--accent); }
.mt .sticky { position: sticky; left: 0; z-index: 1; background: var(--bg); border-right: 1px solid var(--line); }
.mt thead .sticky { background: var(--dark); }
.mt-pairs th, .mt-pairs td { text-align: left; white-space: normal; }
.mt-pairs tbody th { width: 40%; color: var(--muted); font-weight: 500; }
.mt-pairs td { font-weight: 600; }
.spec-note { margin-top: 16px; color: var(--muted); }

.code-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.code-card h2 { font: 600 1.0625rem/1.3 var(--font-body); margin-bottom: 14px; }
.code-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; font: 700 1.125rem/1.6 var(--font-body); letter-spacing: .02em; margin-bottom: 16px; }
.code-line .seg { padding-bottom: 2px; border-bottom: 2px solid var(--accent); }
.code-line sup { margin-left: 1px; font-size: .6875rem; font-weight: 600; color: var(--muted); }
.code-line .sep { color: var(--muted); padding-inline: 1px; }
.legend { list-style: none; padding: 0; display: grid; gap: 10px; font-size: .9375rem; }
.legend li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; }
.legend .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; }
.legend small { display: block; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.legend .climate { list-style: none; padding: 0; margin-top: 4px; display: grid; gap: 2px; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.legend .climate b { color: var(--ink); font-weight: 600; }
.code-ex { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.code-ex b { color: var(--ink); white-space: nowrap; }
.others { list-style: none; padding: 0; display: grid; }
.others a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: .9375rem; line-height: 1.35; }
.others li:last-child a { border-bottom: 0; }
.others a:hover { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }

.adv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; list-style: none; padding: 0; }
.adv-list li { display: grid; gap: 6px; align-content: start; padding: 18px; border-top: 3px solid var(--accent); background: var(--bg); border-radius: 0 0 var(--radius) var(--radius); }
.adv-list b { font-weight: 600; }
.adv-list span { color: var(--muted); font-size: .9375rem; }

.mini-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; }
@media (max-width: 760px) { .mini-cards { grid-template-columns: minmax(0, 1fr); } }
.mini-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; height: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; line-height: 1.3; }
.mini-card .ph { aspect-ratio: 1; }
.mini-card .ph img { padding: 6px; }
.mini-card:hover { border-color: var(--ink); }
.mini-card:hover .ph { background: var(--accent); }

/* =================== ЭЛЕКТРОДВИГАТЕЛИ =================== */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 20px; list-style: none; padding: 0; }
.m-card { display: grid; grid-template-rows: auto 1fr; height: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-decoration: none; overflow: hidden; transition: border-color .15s, box-shadow .15s; position: relative; }
.m-card .ph { aspect-ratio: 16 / 10; border-radius: 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.m-card .ph img { padding: 18px; }
.m-card h3 { padding: 18px 70px 20px 18px; font: 600 1.0625rem/1.35 var(--font-body); }
.m-card .round { position: absolute; right: 16px; bottom: 16px; }
.m-card:hover { border-color: var(--ink); box-shadow: 0 10px 28px var(--shade); }

/* =================== ЛЕНДИНГ =================== */
.l-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: clamp(32px, 5vw, 64px) clamp(40px, 6vw, 80px); }
.l-hero-text { display: grid; gap: 24px; min-width: 0; }
.l-hero h1 { font: 500 clamp(1.75rem, 1rem + 2.2vw, 2.75rem)/1.12 var(--font-display); letter-spacing: -.015em; overflow-wrap: break-word; }
.l-hero .lead { font-size: 1.25rem; line-height: 1.5; color: var(--muted); max-width: 34ch; }
.l-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.l-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: .9375rem; padding-top: 8px; border-top: 1px solid var(--line); }
.l-facts b { color: var(--ink); font-weight: 600; }
.l-visual { position: relative; min-width: 0; }
@media (max-width: 860px) { .l-hero .wrap { grid-template-columns: minmax(0, 1fr); } }

.gl { position: relative; width: 100%; }
.gl canvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; touch-action: pan-y; }
.gl-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .4s; }
.gl.gl-ready .gl-poster { opacity: 0; }
.no-webgl .gl canvas { display: none; }
.l-hero .gl { aspect-ratio: 16 / 11; cursor: grab; }
.l-hero .gl:active { cursor: grabbing; }
@media (max-width: 860px) { .l-hero .gl { aspect-ratio: 5 / 4; } }
.drag-hint { position: absolute; top: 8px; right: 0; z-index: 2; font-size: .8125rem; color: var(--muted); opacity: 0; transition: opacity .3s; }
.gl-ready .drag-hint { opacity: 1; }

.plate-holder { display: flex; align-items: flex-end; justify-content: flex-end; gap: 20px; margin-top: 4px; }
.plate-holder .plate { flex: 0 1 300px; min-width: 0; }
.plate { position: relative; padding: 14px 18px 12px; border-radius: 5px; color: var(--plate-ink);
  background: repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.05) 2px 3px), linear-gradient(135deg, var(--plate-a), var(--plate-b) 55%, var(--plate-a));
  box-shadow: inset 0 0 0 1px var(--plate-edge), inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px var(--shade); font-variant-numeric: tabular-nums; }
.rivet { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--plate-a), var(--plate-edge) 70%); box-shadow: 0 0 0 1px var(--plate-line); }
.rivet:nth-child(1) { top: 7px; left: 7px; } .rivet:nth-child(2) { top: 7px; right: 7px; }
.rivet:nth-child(3) { bottom: 7px; left: 7px; } .rivet:nth-child(4) { bottom: 7px; right: 7px; }
.plate-head { text-align: center; font: 600 .6875rem/1.3 var(--font-body); letter-spacing: .06em; padding-inline: 12px; }
.plate-type { text-align: center; font: 600 1.0625rem/1.2 var(--font-display); letter-spacing: .04em; margin: 4px 0 8px; }
.plate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--plate-line); border-left: 1px solid var(--plate-line); }
.plate-grid > div { padding: 3px 6px; border-right: 1px solid var(--plate-line); border-bottom: 1px solid var(--plate-line); min-width: 0; }
.plate-grid dt { font-size: .625rem; line-height: 1.2; opacity: .75; }
.plate-grid dd { margin: 0; font-weight: 600; font-size: .8125rem; line-height: 1.3; white-space: nowrap; }
.plate-grid .w2 { grid-column: span 2; }
.plate-caption { flex: 0 1 22ch; font-size: .875rem; line-height: 1.5; color: var(--muted); padding-bottom: 4px; }
.plate-caption a { color: var(--ink); text-decoration-color: var(--accent); }
@media (max-width: 560px) {
  .plate-holder { flex-direction: column-reverse; align-items: stretch; }
  .plate-holder .plate, .plate-caption { flex-basis: auto; }
}

.explode-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 48px; }
.steps { list-style: none; margin: 0; padding: 0; grid-column: 1; grid-row: 1; }
.step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding-block: 24px; max-width: 46ch; }
.step:first-child { min-height: 52vh; justify-content: flex-start; }
.step-no { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.step h3 { font: 500 1.25rem/1.25 var(--font-display); color: var(--muted); transition: color .25s; }
.step p { color: var(--muted); }
.step.is-active h3 { color: var(--ink); }
.step.is-active .step-no { color: var(--copper); }
.stage { grid-column: 2; grid-row: 1; }
.stage-sticky { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 4vh); height: calc(88vh - var(--header-h)); display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.stage .gl { height: 100%; }
.stage-meter { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding-top: 12px; }
.stage-meter span { height: 3px; background: var(--line); border-radius: 2px; transition: background-color .25s; }
.stage-meter span.on { background: var(--accent); }
@media (max-width: 860px) {
  .explode-grid { grid-template-columns: minmax(0, 1fr); }
  .stage { grid-column: 1; grid-row: 1; position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 2; background: var(--surface); align-self: start; }
  .stage-sticky { position: static; height: 42vh; padding-bottom: 10px; }
  .steps { grid-row: 2; }
  .step, .step:first-child { min-height: 56vh; justify-content: flex-start; padding-top: 32px; }
}
.l-to-site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.l-to-site h2 { font: 500 clamp(1.375rem, 1rem + 1.4vw, 2rem)/1.2 var(--font-display); max-width: 28ch; }

/* ---- 3D-модели СНЭ ---- */
.mt-name { display: inline-flex; align-items: center; gap: 10px; }
.mt-3d { flex: none; min-width: 34px; min-height: 26px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: 700 .6875rem/1 var(--font-body); letter-spacing: .04em; cursor: pointer; transition: background-color .15s, border-color .15s; }
.mt-3d:hover, .mt-3d:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.p-acts { display: flex; gap: 8px; }
.btn-3d { position: relative; z-index: 1; gap: 6px; padding-inline: 10px; }
.v3d { width: min(1120px, calc(100vw - 32px)); max-width: none; height: min(780px, calc(100dvh - 32px)); max-height: none; padding: 0; border: 0; border-radius: 10px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .4); overflow: hidden; }
.v3d[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.v3d::backdrop { background: rgba(14, 14, 13, .74); }
.v3d-head { display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.v3d-head h2 { font: 600 clamp(1rem, .9rem + .4vw, 1.25rem)/1.25 var(--font-display); }
.v3d-kicker { margin: 0 0 2px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.v3d-close { flex: none; margin-left: auto; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: none; color: var(--ink); cursor: pointer; }
.v3d-close:hover { border-color: var(--ink); }
.v3d-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.v3d-stage { position: relative; min-height: 0; background: radial-gradient(ellipse 70% 70% at 50% 42%, #fdfdfc, #e4e5e1); }
.v3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d-load { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: #5d625f; }
.v3d-stage.gl-ready .v3d-load { display: none; }
.v3d-hint { position: absolute; left: 16px; bottom: 12px; margin: 0; font-size: .8125rem; color: #6a6f6c; pointer-events: none; }
.v3d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px 6px; border-top: 1px solid var(--line); }
.v3d-pick { min-height: 36px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; font-size: .875rem; font-weight: 600; }
.v3d-bar .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.v3d-dims { margin-left: auto; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.v3d-note { margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: .8125rem; }
:root[data-theme="dark"] .v3d-stage { background: radial-gradient(ellipse 70% 70% at 50% 42%, #3a3b38, #20201e); }
:root[data-theme="dark"] .v3d-load, :root[data-theme="dark"] .v3d-hint { color: #b5b8b3; }
@media (max-width: 640px) {
  .v3d { width: 100vw; height: 100dvh; border-radius: 0; }
  .v3d-pick { flex: 1 1 100%; }
  .v3d-dims { margin-left: 0; flex-basis: 100%; }
  .v3d-hint { display: none; }
}
.m-grid > li { position: relative; }
.m-3d { position: absolute; top: 12px; right: 12px; background: var(--bg); }

/* ---------- Вход и редактор новостей (admin.js) ---------- */
.login-form { display: grid; gap: 10px; max-width: 360px; }
.login-form input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; }
.login-form .btn { justify-self: start; }
.adm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; margin-bottom: 24px; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.adm-msg { flex: 1; min-width: 12ch; color: var(--muted); font-size: .9375rem; }
.adm-msg.bad, .adm-err { color: #c0392b; }
.adm-link { background: none; border: 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; }
.news li { display: grid; grid-template-rows: 1fr auto; gap: 10px; }
.adm-card-actions { display: flex; gap: 8px; }
.adm-card-actions .btn, .adm-bar .btn { padding: 8px 14px; font-size: .875rem; }
.adm-dlg { width: min(860px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 10px; background: var(--bg); color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .4); }
.adm-dlg::backdrop { background: rgba(14, 14, 13, .7); }
.adm-form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 24px); }
.adm-dlg-head, .adm-dlg-foot { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.adm-dlg-foot { border-bottom: 0; border-top: 1px solid var(--line); justify-content: flex-end; }
.adm-dlg-foot .adm-err { margin-right: auto; }
.adm-dlg-head h2 { font: 600 1.25rem/1.3 var(--font-display); margin-right: auto; }
.adm-x { background: none; border: 0; color: var(--ink); font-size: 1.25rem; cursor: pointer; }
.adm-dlg-body { overflow: auto; padding: 20px; display: grid; gap: 18px; }
.adm-field { display: grid; gap: 6px; }
.adm-field > span { font-weight: 600; }
.adm-field small { color: var(--muted); font-size: .8125rem; }
.adm-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
@media (max-width: 560px) { .adm-row { grid-template-columns: 1fr; } }
.adm-dlg input, .adm-dlg textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; }
.adm-dlg input[readonly] { background: var(--surface); color: var(--muted); }
.adm-dlg textarea { resize: vertical; line-height: 1.5; }
.adm-cover { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.adm-cover img { width: 200px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.adm-blocks { display: grid; gap: 12px; }
.adm-block { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.adm-block-head { display: flex; align-items: center; gap: 6px; }
.adm-block-head b { margin-right: auto; font-size: .875rem; }
.adm-block-head button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; font-size: .8125rem; }
.adm-block-head button:hover { border-color: var(--ink); }
.adm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.adm-photos figure { position: relative; margin: 0; }
.adm-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: block; }
.adm-photos figure button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; }
.adm-add-photo { aspect-ratio: 4 / 3; border: 1px dashed var(--muted); border-radius: 4px; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.adm-add { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-add .btn { padding: 8px 14px; font-size: .875rem; }
