/* EMX landing — ЕДИНЫЙ файл вёрстки (Claude, 20.10.2026). Заменяет fit.css + layout.css + emx-fit-sections.css.
 * Подключается вместо них на всех 6 страницах: на главных — последним стилем, на подстраницах — на месте layout.css.
 * Правила «секция = экран» действуют только на главных (html body:has(.hero)). tg-shell.css остаётся (Telegram).
 * Тексты и ссылки не меняет. */

/* ===== 1. Телефоны и общие правки (бывший layout.css, 20.10) ===== */
/* Landing layout fix 20.10 (EMX_LANDING_LAYOUT_FIX_PROMPT_2026-10-20, items 2-11): layout only, no text. Measured on
 * nrgmax.club build-946c47e at 320-1366 px before the fix. This file loads before the landing's own <style> /
 * site.css, so every rule starts with "html body" to win over them (as tg-shell.css does). The hero box is not moved. */

/* 2 + 5: a one-column grid sized its column by the longest word ("конфиденциальности" 411 px on a 358 px phone; the
 * protocol line of the document card 186 px in a 131 px column at 768 px) - the column now never exceeds the box */
html body .prose, html body .paper__t { grid-template-columns: minmax(0, 1fr); }
html body .prose h1 { font-size: clamp(22px, 7vw, 62px); overflow-wrap: break-word; hyphens: auto; }
/* 5: at 761-1000 px two document cards share a row and leave their text 131 px - "аккредитованной" (19 px) spilled
 * past the card and widened the page to 771 px: one card per row, as on phones */
@media (min-width: 761px) and (max-width: 1000px) {
  html body .papers, html body .grid2:has(> .paper) { grid-template-columns: 1fr; }  /* dokumenty.html: .grid2 */
}
html body .paper__t > * { overflow-wrap: break-word; hyphens: auto; }
/* Ф4 4.5: the partner page bottom - three ways (§6.1) in one column; «Узнать подробнее» on the dark screen */
html body .emx-helpband__ctas { display: grid; gap: 10px; flex: 1 1 280px; max-width: 460px; min-width: 0; }
/* the landing's .btn never wraps - the long first label («… — тест на 1 минуту») overflowed the band at 1280 */
html body .emx-helpband__ctas .btn { width: 100%; justify-content: center; text-align: center; white-space: normal;
  height: auto; min-height: 52px; padding-block: 12px; line-height: 1.25; }
/* the same for the home «Партнёр» card: «Узнать, что подходит именно вам» (Ф4 4.1) needs 378 px, the card column is
 * 343 px at 768 (two cards a row) - the page grew to 771 px (§14 matrix, tablet 768) */
html body .path .btn { max-width: 100%; text-align: center; white-space: normal; height: auto; min-height: 54px;
  padding-block: 12px; line-height: 1.25; }
html body .emx-more { margin: 18px 0 0; }
/* п.24 (audit 22.10): /partner «Кто ведёт команду» - the photo and Igor's words side by side, one column on a phone */
html body .emx-lead__grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 32px;
  align-items: center; }
html body .emx-lead__photo { width: 100%; height: auto; border-radius: var(--r-m, 18px); display: block; }
html body .emx-lead__text { display: grid; gap: 14px; justify-items: start; min-width: 0; }
html body .emx-lead__text p { color: var(--ink-2); max-width: 60ch; }
html body .emx-lead__text .btn { white-space: normal; height: auto; min-height: 52px; padding-block: 12px; }
@media (max-width: 760px) {
  html body .emx-lead__grid { grid-template-columns: 1fr; gap: 20px; }
  html body .emx-lead__photo { max-width: 360px; justify-self: center; }
}
/* F6 У23 (audit 22.10): tap height >= 44 px - «Как устроено партнёрство →» (27 px) and the logo link (26 px); the look
 * stays, only the pressable box grows */
html body .path a:not(.btn), html body .nav__logo { display: inline-flex; align-items: center; min-height: 44px; }
/* Ф4 4.2-4.4: the own text pages (soglasie, maxilin, instrukciya) - lists and the fact table of the article; the
 * landing's site.css has no rules for them inside .prose */
html body .prose ul, html body .prose ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
html body .prose li > ul { margin-top: 8px; }
html body .prose li::marker { color: var(--brand); }
html body .prose .emx-facts { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-m, 18px); overflow: hidden; }
html body .prose .emx-facts th, html body .prose .emx-facts td { padding: 14px 16px; text-align: left; vertical-align: top;
  border-top: 1px solid var(--line); }
html body .prose .emx-facts tr:first-child > * { border-top: 0; }
html body .prose .emx-facts th { width: 34%; color: var(--forest, var(--ink)); font-weight: 700; }
html body .prose .emx-facts td { color: var(--ink-2); }
@media (max-width: 560px) {  /* phones: the label above its text */
  html body .prose .emx-facts th, html body .prose .emx-facts td { display: block; width: auto; }
  html body .prose .emx-facts td { border-top: 0; padding-top: 0; }
}

/* 3: the cookie notice of site.js had no styles on the two home pages (they do not load site.css): the same card as on
 * the inner pages, fixed at the bottom, above the price bar on phones and Telegram */
html body .cookie { position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 380px; display: flex; gap: 14px;
  align-items: center; padding: 14px 16px; border-radius: var(--r-m, 18px); background: var(--card, #fff);
  border: 1px solid var(--line, #D6DED6); box-shadow: 0 20px 40px -20px rgba(14,59,43,.45); font-size: 13.5px;
  color: var(--ink-2, #4A5A52); }
html body .cookie a { color: var(--forest, #0E3B2B); }
html body .cookie button { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--forest, #0E3B2B); color: #fff; font: 700 14px var(--f-display, sans-serif); cursor: pointer; }
@media (max-width: 900px) {
  html body .cookie { right: 16px; max-width: none; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  html.tg body .cookie { bottom: calc(84px + var(--tg-safe-area-inset-bottom, 0px)); }
}

/* Dm 31.10 (on a phone «не мог понять, где инструкция; меню нет»): the landing hides .nav__links under 900 px and has no
 * menu instead - the sections (Инструкция too) were only in the footer. On phones and tablets they stay: a second row of
 * the sticky header under the logo and «Купить», scrolled sideways by the finger (no script, the page CSP untouched). */
@media (max-width: 900px) {
  html body .nav .wrap { flex-wrap: wrap; row-gap: 0; }
  html body .nav__links { display: flex; order: 3; flex: 0 0 100%; gap: 20px; overflow-x: auto; white-space: nowrap;
    padding: 2px 0 12px; margin-top: -6px; font-size: 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  html body .nav__links::-webkit-scrollbar { display: none; }
  html body .nav__links a { flex: 0 0 auto; padding-block: 6px; }
  /* the home page: «Инструкция» was 6th, past the screen edge - first on phones (the order of the desktop row stays) */
  html body:has(.hero) .nav__links a[href="/instrukciya"] { order: -1; }
}

/* 4: variant B paints its brand button with a gradient under a transparent 1.5 px border; the background started at the
 * padding box and repeated into the border - a sliver of the other end colour at both edges */
html body .btn--brand { background-origin: border-box; }

/* 6: the flavour and history rails run to the screen edge; the first card stays on the 16 px line, the next one peeks
 * from behind the edge */
html body .ribbon { margin-inline: calc(-1 * var(--gut, 16px)); padding-inline: var(--gut, 16px);
  scroll-padding-inline: var(--gut, 16px); }

/* 7: tg-shell.css (P0 18.10) lets every .btn wrap on phones - right for a button longer than the screen, wrong for the
 * rest: a CTA of the page takes the full width, so it stays on one line wherever the line fits */
@media (max-width: 430px) {
  html body main .btn { width: 100%; justify-self: stretch; min-height: 48px; padding-inline: 16px; }
  /* the cards around a CTA give it 20 px a side (was 26-28 px), so "Заказать через консультанта" fits from 360 px */
  html body .path, html body .helpband { padding-inline: 20px; }
}
@media (max-width: 360px) {
  html body main .btn { font-size: 15px; gap: 8px; padding-inline: 12px; }
  html body .path, html body .helpband { padding-inline: 16px; }
}

/* 8: headings break lines evenly (the short words are glued to the next one at build time) */
html body h1, html body h2, html body h3 { text-wrap: balance; }

/* 9: a certificate / protocol number breaks only where the build put <wbr> (after a dot) or at a space */
html body code { overflow-wrap: normal; word-break: normal; }

/* 10: tap areas of at least 44 px; the visible marks keep their size */
html body .slider__dots { margin-top: -5px; margin-bottom: -19px; }
html body .slider__dots button { height: 44px; background: transparent; }
html body .slider__dots button::before { content: ""; position: absolute; left: 0; right: 0; top: 19px; height: 6px;
  border-radius: 6px; background: var(--line, #D6DED6); }
html body .slider__dots button i { top: 19px; bottom: auto; height: 6px; border-radius: 6px; z-index: 1; }
html body .foot nav { row-gap: 0; }
html body .foot nav a { display: inline-flex; align-items: center; min-height: 44px; }
html body .crumbs { align-items: center; }
html body .crumbs a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -16px; }

/* 11: no text below 12 px on phones */
@media (max-width: 760px) {
  html body .hero__badge span, html body .fcard__t span, html body .path .eyebrow { font-size: 12px; }
}

/* ===== 2. Десктоп главной: секция = экран (бывший emx-fit-sections.css) ===== */
/* EMX landing — FIT v5 overlay для nrgmax.club (Claude, 20.10.2026).
 * Десктоп (>900 px): каждая секция = один экран высотой «окно минус шапка», контент по центру,
 * шрифты/картинки/карточки масштабируются по высоте окна, переход из меню ставит секцию ровно под шапку (69 px).
 * Порт правки v5 от 12.10 (EMX_LANDING_MAXILIN_RU_STATUS). Hero не трогает (утверждён 20.10, его держит fit.css).
 * Телефоны и планшеты до 900 px не затрагивает. Только CSS, тексты и ссылки не меняет.
 * Подключать ПОСЛЕДНИМ стилем страниц index.html и index-b.html (после layout.css). */
@media (min-width:901px){
  html body:has(.hero){--hdr:69px}
  /* Learning 20.10: no scroll-snap - "proximity" snapped the page to 36 px on load (the price strip above the nav went
     off-screen for good) and pulled a 300 px wheel scroll back to 53 px on 1920x1080; menu jumps need only the padding */
  html:has(.hero){scroll-padding-top:69px}
  html body:has(.hero) .sec{min-height:calc(100svh - var(--hdr));display:flex;flex-direction:column;justify-content:center;padding-block:clamp(24px,5.5vh,72px)}
  html body:has(.hero) .sec>.wrap{width:100%}
  html body:has(.hero) h2{font-size:clamp(26px,min(4.2vw,6.4vh),52px)}
  html body:has(.hero) h3{font-size:clamp(17px,min(1.8vw,2.8vh),22px)}
  /* Learning 20.10: ".lead" -> ".sec .lead" - the hero's lead is not a section's (hero = Owner-approved, the only edit) */
  html body:has(.hero) .sec .lead{font-size:clamp(15px,min(1.5vw,2.5vh),19px)}
  html body:has(.hero) .sec-head{gap:clamp(8px,1.6vh,16px);margin-bottom:clamp(16px,4vh,56px)}
}
@media (min-width:901px){
  /* ritual */
  html body:has(.hero) .ritual__grid{align-items:center}
  html body:has(.hero) .ritual__media{position:relative;top:0;max-height:calc(100svh - var(--hdr) - 2*clamp(24px,5.5vh,72px))}
  html body:has(.hero) .step{padding-block:clamp(10px,2.4vh,28px)}
  html body:has(.hero) .step__n{width:clamp(38px,6vh,52px);height:clamp(38px,6vh,52px);font-size:clamp(16px,2.6vh,20px)}
  html body:has(.hero) .ritual__note{margin-top:clamp(10px,2.4vh,22px)}
  /* formula */
  html body:has(.hero) .formula__img{max-width:min(520px,calc(100svh - var(--hdr) - 2*clamp(24px,5.5vh,72px)))}
  html body:has(.hero) .ingr li{padding-block:clamp(8px,1.9vh,20px)}
  html body:has(.hero) .ingr p{font-size:clamp(14px,2.3vh,16px)}
  /* morning */
  html body:has(.hero) .morning__img{max-height:calc(100svh - var(--hdr) - 2*clamp(24px,5.5vh,72px))}
  /* flavors + history ribbons */
  html body:has(.hero) .fcard{aspect-ratio:auto;height:clamp(220px,calc(100svh - var(--hdr) - 400px),440px)}
  html body:has(.hero) .fcard .box{top:14%;width:auto;height:52%;left:50%;right:auto;transform:translateX(-50%);animation:none}
  html body:has(.hero) .flv__cta{margin-top:clamp(12px,2.6vh,26px)}
  html body:has(.hero) .yr img{max-height:calc(100svh - var(--hdr) - 460px);min-height:100px;object-fit:cover;width:100%}
  html body:has(.hero) .ribbon__bar{margin-top:clamp(10px,2.4vh,22px)}
  html body:has(.hero) .yr__t{padding:clamp(12px,2vh,20px) 22px clamp(14px,2.4vh,24px)}
  html body:has(.hero) .history small{margin-top:clamp(8px,1.8vh,28px)}
  html body:has(.hero) .yr p{font-size:clamp(14px,2.2vh,15.5px)}
  /* docs */
  html body:has(.hero) .papers{margin-bottom:clamp(10px,2vh,16px)}
  html body:has(.hero) .paper{grid-template-columns:clamp(80px,17vh,150px) 1fr;padding:clamp(12px,2.4vh,20px)}
  html body:has(.hero) .doclist{grid-template-columns:repeat(3,1fr);gap:clamp(10px,2vh,16px)}
  html body:has(.hero) .doc{padding:clamp(14px,2.8vh,26px);gap:6px}
  html body:has(.hero) .doc--wide{grid-column:auto;grid-template-columns:1fr;gap:10px}
  /* price */
  html body:has(.hero) .pcard{padding:clamp(18px,3.4vh,44px);gap:clamp(14px,2.4vh,24px)}
  html body:has(.hero) .pcard img{max-height:calc(100svh - var(--hdr) - 400px);width:auto;max-width:100%;margin-inline:auto;object-fit:contain}
  html body:has(.hero) .pcard--soft{grid-template-columns:minmax(80px,.55fr) 1fr;align-content:center}
  html body:has(.hero) .pcard--soft img{max-height:min(220px,calc(100svh - var(--hdr) - 360px));max-width:100%}
  html body:has(.hero) .price .sec-head,html body:has(.hero) .docs .sec-head{max-width:1000px}
  /* faq: заголовок сверху, вопросы в две колонки */
  html body:has(.hero) .faq__grid{grid-template-columns:1fr;gap:clamp(14px,3vh,36px)}
  html body:has(.hero) .faq .sec-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 28px;max-width:none;margin:0}
  html body:has(.hero) .faq .sec-head .eyebrow{flex-basis:100%}
  html body:has(.hero) .faq__grid>div:last-child{columns:2;column-gap:clamp(28px,4vw,64px)}
  html body:has(.hero) .faq details{break-inside:avoid;border-top:0;border-bottom:1px solid var(--line)}
  html body:has(.hero) .faq details:first-child{border-top:1px solid var(--line)}
  html body:has(.hero) .price .lead,html body:has(.hero) .docs .lead{max-width:none}
  html body:has(.hero) .faq summary{padding-block:clamp(10px,2.1vh,22px);font-size:clamp(15px,min(1.5vw,2.6vh),19px)}
  html body:has(.hero) .faq details p{padding-bottom:clamp(10px,2vh,22px);font-size:clamp(14px,2.4vh,17px)}
  html body:has(.hero) .pcard__body{gap:clamp(6px,1.4vh,12px)}
  html body:has(.hero) .pcard__new{font-size:clamp(38px,min(5.6vw,8vh),72px)}
  html body:has(.hero) .pcard .btn{min-height:clamp(44px,7vh,54px)}
  /* buy, faq */
  html body:has(.hero) .buy3 li{padding:clamp(16px,3.2vh,28px)}
  html body:has(.hero) .helpband{margin-top:clamp(12px,2.4vh,24px);padding:clamp(14px,2.6vh,24px) 28px}
}
/* Learning 20.10: the v5 block for "Что это" (.wake) on short screens, verbatim from v5 12.10 - missing in the overlay,
   so at 1270x610 the counter card ran 1 trln KOE past the screen; threshold 760 -> 840 px (the overlay's own second
   step): at 1024x768 / 1180x820 the card still ended 4 / 11 px below the screen */
@media (max-height:840px) and (min-width:901px){
  html body:has(.hero) .wake.sec{padding-block:32px 36px}
  html body:has(.hero) .wake h2{font-size:34px;max-width:26ch}
  html body:has(.hero) .wake .lead{font-size:15.5px;line-height:1.55}
  html body:has(.hero) .wake .sec-head{gap:10px}
  html body:has(.hero) .wake__grid{gap:16px!important}
  html body:has(.hero) .wake .counter{padding:14px 20px}
  html body:has(.hero) .wake .counter__value{font-size:42px}
  html body:has(.hero) .wake .counter__x{margin-top:4px;padding-top:8px}
  html body:has(.hero) .wake .counter__x b{font-size:22px}
  html body:has(.hero) .wake small{display:none}
}
/* низкие экраны ноутбуков: убираем второстепенное, а не режем */
@media (min-width:901px) and (max-height:760px){
  html body:has(.hero) .free{display:none}
  html body:has(.hero) .doc p{font-size:14px}
  html body:has(.hero) .paper__t span{font-size:13.5px}
  html body:has(.hero) .price small,html body:has(.hero) .company small{display:none}
}
@media (min-width:901px) and (max-height:840px){html body:has(.hero) .free{display:none}html body:has(.hero) .ingr li{padding-block:clamp(8px,1.6vh,16px)}}

/* ===== 3. Первый экран и широкие мониторы (новое) ===== */
/* ============ HERO, десктоп (замена fit.css) ============
 * Первый экран = окно минус полоса цены и шапка. Всё важное (заголовок, цена, кнопки) видно без прокрутки
 * на любом окне от 1270x610 до 1920x1080. Заголовок масштабируется по меньшему из ширины и высоты окна,
 * колонка текста шире колонки фото. Положение коробки относительно фото — как утверждено. */
@media (min-width:901px){
  html body{--tb:37px;--hdr:69px;--hero-pad:clamp(16px,4.2vh,56px)}
  html body .hero{min-height:calc(100svh - var(--tb) - var(--hdr));display:flex;align-items:center;padding-block:var(--hero-pad)}
  html body .hero>.wrap{width:100%;grid-template-columns:minmax(0,1fr) auto;gap:clamp(40px,4.5vw,80px);align-items:center}
  html body .hero__text{gap:clamp(10px,2.1vh,22px);padding-top:0}
  html body .hero h1{font-size:clamp(34px,min(3.3vw,6.4vh),60px);line-height:1.04;max-width:none}
  html body .hero .lead{font-size:clamp(15px,min(1.2vw,2.3vh),19px);line-height:1.55;max-width:50ch}
  html body .hero__price b{font-size:clamp(24px,min(2.2vw,3.9vh),36px)}
  html body .hero__visual{justify-self:end;width:min(36vw,540px,calc((100svh - var(--tb) - var(--hdr) - 2*var(--hero-pad) - 36px)*.8))}
  html body .hero__photo,html body .hero .slider{aspect-ratio:4/5;height:auto}
  html body .hero__box{width:74%;left:-15%;bottom:-6%}
  html body .hero__badge{width:clamp(88px,12vh,118px);height:clamp(88px,12vh,118px);top:clamp(12px,2.2vh,22px);right:clamp(12px,2.2vh,22px)}
  html body .hero__badge b{font-size:clamp(26px,3.6vh,34px)}
}
/* низкое окно ноутбука: значки доверия переезжают ниже первого экрана не нужны — прячем, кнопки остаются в кадре */
@media (min-width:901px) and (max-height:700px){
  html body .hero__trust{display:none}
}
/* широкие мониторы: контейнер шире, чтобы страница не превращалась в узкую полосу посередине */
@media (min-width:1600px){
  html body{--wrap:1320px}
  html body .nav__links{gap:32px;font-size:15px}
}

/* якорные переходы на телефоне: раздел встаёт под шапку (68 px) */
@media (max-width:900px){html{scroll-padding-top:72px}}

/* цена: сумма не разрывается на строки; во второй карточке кегль меньше, чтобы «7 140 ₽» стояло в одну строку */
html body .pcard__new{white-space:nowrap}
@media (min-width:901px){html body .pcard--soft .pcard__new{font-size:clamp(28px,min(2.6vw,5vh),46px)}}
/* подстраницы на десктопе: заголовок по меньшему из ширины и высоты окна, чтобы на ноутбуке текст начинался в первом экране */
@media (min-width:901px){html body .page-hero h1{font-size:clamp(34px,min(4vw,7.2vh),58px)}}
/* 320–340 px: «Заказать через консультанта» в одну строку */
@media (max-width:340px){html body .helpband .btn,html body .path .btn{font-size:14px;letter-spacing:-.01em;padding-inline:10px}}

/* ===== 4. Вариант B, подстраницы (пакет 20.10, п. 3) ===== */
/* html.v-b ставит variant-mark.js только на vkusy / dokumenty / partneram / privacy, если человек видел синюю главную.
 * Значения - из index-b.html (вариант B v3): 11 переменных палитры + цвета, которые B задаёт напрямую на элементах,
 * встречающихся на подстраницах (шапка, кнопки, карточки вкусов, просмотр документов, подвал, cookie). */
html.v-b{--forest:#0B2F55;--forest-2:#0F4C75;--brand:#077EED;--apple:#35EE9F;--milk:#F5F9FC;--stone:#EAF3FA;
  --ink:#0A1A3A;--ink-2:#4A5873;--line:#D8E5EF;--on-dark:#EAF4FB;--on-dark-2:#A8C1D9}
html.v-b body .nav{background:rgba(245,249,252,.82)}
html.v-b body .btn:hover{box-shadow:0 12px 28px -12px rgba(11,47,85,.55)}
html.v-b body .btn--brand{background:linear-gradient(90deg,#077EED,#14B8C8 55%,#35EE9F);border-color:transparent}
html.v-b body .fcard::after{background:linear-gradient(180deg,rgba(255,255,255,0) 35%,rgba(11,47,85,.88) 100%)}
html.v-b body .fcard .box{filter:drop-shadow(0 18px 18px rgba(11,47,85,.35))}
html.v-b body .lb::backdrop{background:rgba(6,20,40,.82)}
html.v-b body .lb__body{background:#EEF3F8}
html.v-b body .lb__nav{background:rgba(11,47,85,.85)}
html.v-b body .foot{background:#081F3D}
html.v-b body .cookie{box-shadow:0 20px 40px -20px rgba(11,47,85,.45)}
