/* MOB-2 (19.11.2026): мобільний шар P0 — шари z-index, нижня панель (≤767), компактний Бізик (≤480), safe-area.
   Підключає partials/v2/wow.php лише при data/site_wow.php 'mob_p0' => true (клас html.bf-mob); логіка станів — site-mob.js.
   Правила лише під html.bf-mob і мобільні медіа; спільні токени (--bf-*, --bf-site-cta-bar-h, --bz-h на ПК) не змінюються; ПК (≥1120) — без змін.
   Стани (ставить site-mob.js на <html>): bf-mob-js — скрипт працює; bf-mob-bar-off — панель схована; bf-mob-bz-off — Бізик схований;
   bf-mob-cta-icon — «Обговорити проєкт» як іконка (обидва підписи в рядок не вміщаються). Тексти й розмітка не змінюються. */

/* ── 1. Єдина таблиця шарів (порядок шапки й меню відносно решти — як був) ── */
:root {
  --z-header: 50;   /* .bf2-header (sticky) */
  --z-bizik: 60;    /* Бізик і чат — нижче меню, банера cookie й модалок (було 120) */
  --z-menu: 70;     /* мобільне меню (#bf2-nav, :checked) */
  --z-bar: 80;      /* нижня панель кнопок */
  --z-cookie: 130;  /* банер cookie */
  --z-modal: 200;   /* лайтбокси, діалоги */
}
@media (max-width: 1119.98px) {
  html.bf-mob .ai-consultant-widget { z-index: var(--z-bizik); }
  html.bf-mob .bf2-ctas { z-index: var(--z-bar); }
  html.bf-mob .bf2-menu-toggle:checked ~ .bf2-nav { z-index: var(--z-menu); }
  html.bf-mob .bf2-cookie { z-index: var(--z-cookie); }
  /* відкрите меню або модалка — Бізик не показується (CSS-запасний шлях без JS) */
  html.bf-mob body:has(.bf2-menu-toggle:checked) .ai-consultant-widget:not(.is-open) { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ── 2. Вирізи iPhone (viewport-fit=cover): вміст не заходить під виріз у ландшафті; у портреті бічні відступи = 0 ── */
html.bf-mob body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }

/* ── 3. Нижня панель (≤767): 44 px кнопки + 6 px поля = 56 px + safe-area; один рядок; ховається за станами ── */
@media (max-width: 767.98px) {
  html.bf-mob { --mob-bar-h: 56px; }
  html.bf-mob .bf2-ctas {
    gap: 8px;
    padding: 6px max(12px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    transition: transform .25s ease, visibility 0s;
  }
  /* сіра кнопка — за шириною підпису, основна — решта рядка; обидва підписи в один рядок (виміряно: 600, Inter):
     15 px — від 412 px екрана, 14 px — від 381, 13 px — від 358; нижче — «Обговорити проєкт» стає іконкою (site-mob.js) */
  html.bf-mob .bf2-ctas { grid-template-columns: auto minmax(0, 1fr); }
  html.bf-mob .bf2-ctas .bf2-btn { min-height: 44px; height: 44px; padding: 0 10px; font-size: 15px; line-height: 1; white-space: nowrap; }
  @media (max-width: 411.98px) { html.bf-mob .bf2-ctas .bf2-btn { padding: 0 8px; font-size: 14px; } }
  @media (max-width: 380.98px) { html.bf-mob .bf2-ctas .bf2-btn { font-size: 13px; } }
  /* нижній відступ сторінки = висота панелі + safe-area, лише коли панель показується */
  html.bf-mob body { padding-bottom: calc(var(--mob-bar-h) + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-mob-js.bf-mob-bar-off body { padding-bottom: 0; }
  html.bf-mob.bf-mob-js.bf-mob-bar-off .bf2-ctas { transform: translateY(calc(100% + 4px)); visibility: hidden; pointer-events: none; transition: transform .25s ease, visibility 0s .25s; }
  /* меню відкрите — панель схована, меню до низу екрана */
  html.bf-mob.bf-mob-js.bf-mob-bar-off .bf2-menu-toggle:checked ~ .bf2-nav { bottom: 0; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  /* фігура (481–767) стоїть на компактній панелі; панель схована — на нижньому краї */
  html.bf-mob.bf-bizik-full .ai-consultant-widget { bottom: calc(var(--mob-bar-h) + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-bizik-full.bf-mob-bar-off .ai-consultant-widget { bottom: env(safe-area-inset-bottom, 0px); }
  /* «Обговорити проєкт» — іконка 48×48, коли обидва підписи в рядок не вміщаються (текст лишається в DOM: ім’я для екранних читачів) */
  html.bf-mob.bf-mob-cta-icon .bf2-ctas { grid-template-columns: 48px minmax(0, 1fr); }
  html.bf-mob.bf-mob-cta-icon .bf2-ctas .bf2-btn--gray {
    width: 48px; min-width: 48px; height: 44px; padding: 0; font-size: 0; line-height: 0; overflow: hidden; position: relative;
  }
  html.bf-mob.bf-mob-cta-icon .bf2-ctas .bf2-btn--gray::before {
    content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3Cpath d='M8.5 11h7M8.5 14h4.5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3Cpath d='M8.5 11h7M8.5 14h4.5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
/* ландшафт телефона: та сама компактна панель (висота екрана ≤ 500) */
@media (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px) {
  html.bf-mob { --mob-bar-h: 56px; }
  html.bf-mob .bf2-ctas { padding: 6px max(20px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); transition: transform .25s ease, visibility 0s; }
  html.bf-mob .bf2-ctas .bf2-btn { min-height: 44px; height: 44px; white-space: nowrap; }
  html.bf-mob body { padding-bottom: calc(var(--mob-bar-h) + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-mob-js.bf-mob-bar-off body { padding-bottom: 0; }
  html.bf-mob.bf-mob-js.bf-mob-bar-off .bf2-ctas { transform: translateY(calc(100% + 4px)); visibility: hidden; pointer-events: none; transition: transform .25s ease, visibility 0s .25s; }
  html.bf-mob.bf-mob-js.bf-mob-bar-off .bf2-menu-toggle:checked ~ .bf2-nav { bottom: 0; }
  html.bf-mob.bf-bizik-full .ai-consultant-widget { bottom: calc(var(--mob-bar-h) + 8px + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-bizik-full.bf-mob-bar-off .ai-consultant-widget { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}

/* ── 4. Бізик на телефоні (≤480): ширина 64 px, праворуч над панеллю (зазор 12 px); при прокрутці вниз заїжджає за край (язичок 16 px) ── */
@media (max-width: 480px) {
  html.bf-mob.bf-bizik-full { --bz-h: 78px; }   /* ширина фігури = 0.8216 × 78 ≈ 64 px (було 95×116) */
  html.bf-mob.bf-bizik-full .ai-consultant-widget {
    right: env(safe-area-inset-right, 0px);
    bottom: calc(var(--mob-bar-h, 56px) + 12px + env(safe-area-inset-bottom, 0px));
    transition: bottom .25s ease, opacity .2s ease, visibility 0s;
  }
  html.bf-mob.bf-bizik-full.bf-mob-bar-off .ai-consultant-widget { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-bizik-full .ai-consultant-widget .bz-full { transition: transform .14s ease-out, translate .3s ease, opacity .25s ease, visibility 0s; }
  html.bf-mob.bf-bizik-full .ai-consultant-widget.bf-mob-tuck:not(.is-open) .bz-full { translate: calc(100% - 16px) 0; }
  /* язичок: зона дотику 44 px уздовж краю (тап лише повертає фігуру — site-mob.js) */
  html.bf-mob.bf-bizik-full .ai-consultant-widget.bf-mob-tuck:not(.is-open) .bz-full::before { content: ""; position: absolute; z-index: 4; left: -28px; top: 0; width: 44px; height: 100%; pointer-events: auto; }
  /* підказка біля голови — не ширша за вільне місце ліворуч */
  html.bf-mob .bz-full-hint { max-width: min(160px, calc(100vw - 96px)); }
}
/* схований стан (меню, модалка, форма в полі зору, cookie-банер, клавіатура) — на всіх ширинах, де діє шар */
@media (max-width: 1119.98px) {
  html.bf-mob.bf-mob-bz-off .ai-consultant-widget:not(.is-open) { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility 0s .2s; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 1119.98px) {
  /* без заїзду: при прокрутці вниз фігура просто зникає (opacity) */
  html.bf-mob.bf-bizik-full .ai-consultant-widget.bf-mob-tuck:not(.is-open) .bz-full { translate: none; opacity: 0; visibility: hidden; pointer-events: none; }
  html.bf-mob .bf2-ctas, html.bf-mob .ai-consultant-widget, html.bf-mob .ai-consultant-widget .bz-full { transition: none !important; }
}

/* ═══════════ MOB-3 (19.11.2026): шапка, бургер-меню, футер на телефоні — лише під html.bf-mob.bf-mob-p1 ('mob_p1' => true, залежить від 'mob_p0') ═══════════
   Діє: ширина ≤767 і ландшафт телефона (768–1119, висота ≤500). Планшет 768+ портрет і ПК — без змін. Розмітка, тексти й посилання не змінюються:
   розкривачі футера, aria-атрибути, «Нагору» й поточний пункт меню додає site-mob.js (в HTML сервера їх немає). Згорнуте = visibility:hidden (у DOM лишається). */
@media (max-width: 767.98px), (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px) {

  /* ── 1. Шапка: майже непрозоре скло (було 20 %, saturate 1.9 над кольоровими плямами «ефіру») ── */
  html.bf-mob.bf-mob-p1 body .bf2-header::before {
    background: color-mix(in srgb, var(--glass-bg-solid, var(--bf-canvas)) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.1) blur(10px); backdrop-filter: saturate(1.1) blur(10px);
  }
  html.bf-mob.bf-mob-p1 .bf2-header { height: 64px; }
  html.bf-mob.bf-mob-p1 .bf2-header .bf2-theme { width: 44px; height: 44px; }
  html.bf-mob.bf-mob-p1 .bf2-header__actions { gap: 4px; }

  /* ── 2. Меню: прокрутка лише всередині, поточний пункт, CTA-панель — «закріплений низ меню» ── */
  /* нижня панель сторінки лишається видимою при відкритому меню й стає закріпленим низом меню (кнопки дії); меню закінчується над нею */
  html.bf-mob.bf-mob-p1 .bf2-menu-toggle:checked ~ .bf2-nav {
    bottom: calc(var(--mob-bar-h, 56px) + env(safe-area-inset-bottom, 0px));
    padding-bottom: 16px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  /* блокування прокрутки фону без стрибка (iOS не слухає overflow:hidden на body): body fixed + збережений scrollY (site-mob.js);
     sticky-шапка під fixed-body йшла б за межі екрана — на час блокування вона fixed, а її місце займає padding */
  html.bf-mob.bf-mob-p1.bf-mob-lock body { position: fixed; left: 0; right: 0; width: 100%; top: var(--mob-lock-top, 0px); overflow: hidden; padding-top: 64px; }
  html.bf-mob.bf-mob-p1.bf-mob-lock .bf2-header { position: fixed; top: 0; left: 0; right: 0; }
  /* поточна сторінка */
  html.bf-mob.bf-mob-p1 .bf2-nav [aria-current="page"], html.bf-mob.bf-mob-p1 .bf2-nav .bf2-dd.is-current > summary {
    color: var(--bf-accent-ink, var(--bf-accent)); font-weight: 700;
  }
  html.bf-mob.bf-mob-p1 .bf2-nav a.bf2-nav__link[aria-current="page"] { box-shadow: inset 4px 0 0 var(--bf-accent), var(--glass-hi, none); }
  html.bf-mob.bf-mob-p1 .bf2-nav .bf2-dd.is-current { box-shadow: inset 4px 0 0 var(--bf-accent), var(--glass-hi, none); }
  html.bf-mob.bf-mob-p1 .bf2-nav .bf2-dd__panel a[aria-current="page"] { background: color-mix(in srgb, var(--bf-accent) 12%, transparent); border-radius: 10px; }
  html.bf-mob.bf-mob-p1 .bf2-nav .bf2-nav__link[aria-current="page"]::after { display: none; }

  /* ── 3. Футер ── */
  /* нижній відступ = зона кнопки «Нагору» й Бізика (панель біля футера схована): нижній рядок футера не під ними */
  html.bf-mob.bf-mob-p1 .bf2-footer { padding: 32px 0 calc(8px + var(--mob-bar-h, 56px) + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-mob-p1 .bf2-footer__grid { gap: 0; }
  html.bf-mob.bf-mob-p1 .bf2-footer__brand { padding-bottom: 20px; }
  html.bf-mob.bf-mob-p1 .bf2-footer__brand p { margin-top: 10px; max-width: none; font-size: 14px; line-height: 1.45; }
  html.bf-mob.bf-mob-p1 .bf2-footer__contacts { gap: 0; margin-top: 8px; }
  html.bf-mob.bf-mob-p1 .bf2-footer__contacts a { min-height: 44px; }
  /* соцмережі — один рядок круглих кнопок 44×44; назва лишається в DOM для читачів екрана (візуально прихована) */
  html.bf-mob.bf-mob-p1 body .bf2-social--footer { margin-top: 8px; }
  html.bf-mob.bf-mob-p1 body .bf2-social--footer ul { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; }
  html.bf-mob.bf-mob-p1 body .bf2-social--footer .bf2-social__a { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
  html.bf-mob.bf-mob-p1 body .bf2-social--footer .bf2-social__t { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* зони дотику ≥44 px для всіх посилань футера */
  html.bf-mob.bf-mob-p1 .bf2-footer ul a, html.bf-mob.bf-mob-p1 .bf2-footer__bottom a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  html.bf-mob.bf-mob-p1 .bf2-footer ul { gap: 0; }
  /* акордеони (клас bf-mob-fa на футері ставить site-mob.js; без JS — повний список, як було) */
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__grid > nav { box-shadow: inset 0 1px 0 var(--bf-hairline); }
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__title {
    position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 0; padding-right: 4px;
    font-size: 15px; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
  }
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__title::after {
    content: ""; flex: none; width: 18px; height: 18px; background: currentColor; transition: transform .25s ease;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__title:focus-visible { outline: 2px solid var(--bf-accent-ink, var(--bf-accent)); outline-offset: -2px; border-radius: 8px; }
  html.bf-mob.bf-mob-p1 .bf-mob-fa nav.is-open > .bf2-footer__title::after { transform: rotate(180deg); }
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__grid > nav > ul {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .28s ease, visibility 0s .28s;
  }
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__grid > nav > ul.bf2-footer__niches { columns: auto; }
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__grid > nav.is-open > ul { visibility: visible; transition: max-height .28s ease, visibility 0s; padding-bottom: 8px; }
  @media (max-width: 359.98px) { html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__grid > nav > ul { grid-template-columns: minmax(0, 1fr); } }
  /* реквізити й нижній рядок — компактно */
  html.bf-mob.bf-mob-p1 .bf2-footer .bf2-req { margin-top: 20px; padding-top: 16px; gap: 8px; font-size: 12.5px; line-height: 1.45; box-shadow: inset 0 1px 0 var(--bf-hairline); }
  html.bf-mob.bf-mob-p1 .bf2-footer__bottom { margin-top: 12px; padding-top: 10px; gap: 0 16px; font-size: 13px; }
  html.bf-mob.bf-mob-p1 .bf2-footer__bottom > span { display: flex; align-items: center; min-height: 36px; width: 100%; }
  html.bf-mob.bf-mob-p1 .bf2-footer__bottom nav { gap: 0 16px; }
  /* бічні відступи ≥16 px на всіх в'юпортах */
  html.bf-mob.bf-mob-p1 .bf2-footer .bf2-container { padding-left: max(16px, var(--bf-site-gutter, 20px)); padding-right: max(16px, var(--bf-site-gutter, 20px)); }
}

/* ── «Нагору»: кнопка додається site-mob.js (≤767 і ландшафт телефона); зліва над нижньою панеллю, Бізик — справа ── */
.bf-mob-totop { display: none; }
@media (max-width: 767.98px), (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px) {
  html.bf-mob.bf-mob-p1 .bf-mob-totop {
    position: fixed; z-index: var(--z-bizik, 60); left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(var(--mob-bar-h, 56px) + 12px + env(safe-area-inset-bottom, 0px));
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    color: var(--bf-text); background: var(--glass-bg-solid, var(--bf-card)); box-shadow: 0 0 0 1px var(--bf-hairline), 0 6px 16px -6px rgba(20, 16, 60, .35);
    opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility 0s .2s, bottom .25s ease;
    -webkit-tap-highlight-color: transparent;
  }
  html.bf-mob.bf-mob-p1 .bf-mob-totop.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease, visibility 0s, bottom .25s ease; }
  html.bf-mob.bf-mob-p1.bf-mob-bar-off .bf-mob-totop { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-mob-p1:has(.bf2-menu-toggle:checked) .bf-mob-totop { opacity: 0; visibility: hidden; pointer-events: none; }
  html.bf-mob.bf-mob-p1 .bf-mob-totop::before {
    content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  html.bf-mob.bf-mob-p1 .bf-mob-totop:focus-visible { outline: 2px solid var(--bf-accent-ink, var(--bf-accent)); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__grid > nav > ul, html.bf-mob.bf-mob-p1 .bf-mob-fa .bf2-footer__title::after, html.bf-mob.bf-mob-p1 .bf-mob-totop { transition: none !important; }
}

/* ═══════════ MOB-4 (19.11.2026): стрічки, сітки, накладання, майстер — лише під html.bf-mob.bf-mob-p2 ('mob_p2') і медіа телефона ═══════════
   Стрічки карток покращує site-mob.js (клас .bf-mob-car + панель .bf-mob-car__ctl під стрічкою), таблиці — .bf-mob-tbl. Розмітка й тексти не змінюються. */
@media (max-width: 767.98px), (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px) {

  /* ── 1а. Стрічки карток: край-градієнт там, де є ще контент; керування під стрічкою ── */
  html.bf-mob.bf-mob-p2 .bf-mob-car { scroll-padding-inline: 0; }
  html.bf-mob.bf-mob-p2 .bf-mob-car:not(.sw-snap) { scroll-snap-type: x proximity; }
  html.bf-mob.bf-mob-p2 .bf-mob-car:not(.sw-snap) > * { scroll-snap-align: start; }
  html.bf-mob.bf-mob-p2 .bf-mob-car.is-more-r:not(.is-more-l) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  html.bf-mob.bf-mob-p2 .bf-mob-car.is-more-l:not(.is-more-r) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px); mask-image: linear-gradient(90deg, transparent, #000 32px); }
  html.bf-mob.bf-mob-p2 .bf-mob-car.is-more-l.is-more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 40px), transparent); }
  html.bf-mob.bf-mob-p2 .bf-mob-car:focus-visible { outline: 2px solid var(--bf-accent-ink, var(--bf-accent)); outline-offset: 4px; border-radius: 12px; }
  html.bf-mob.bf-mob-p2 .bf-mob-car__ctl { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; }
  html.bf-mob.bf-mob-p2 .bf-mob-car__b {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    color: var(--bf-text); background: var(--glass-bg-solid, var(--bf-card)); box-shadow: 0 0 0 1px var(--bf-hairline), 0 4px 12px -6px rgba(20, 16, 60, .3);
    -webkit-tap-highlight-color: transparent; transition: opacity .2s ease;
  }
  html.bf-mob.bf-mob-p2 .bf-mob-car__b::before {
    content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  html.bf-mob.bf-mob-p2 .bf-mob-car__b--next::before { transform: scaleX(-1); }
  html.bf-mob.bf-mob-p2 .bf-mob-car__b[disabled] { opacity: .35; cursor: default; box-shadow: 0 0 0 1px var(--bf-hairline); }
  html.bf-mob.bf-mob-p2 .bf-mob-car__b:focus-visible { outline: 2px solid var(--bf-accent-ink, var(--bf-accent)); outline-offset: 2px; }
  html.bf-mob.bf-mob-p2 .bf-mob-car__dots { display: flex; align-items: center; gap: 6px; min-width: 0; }
  html.bf-mob.bf-mob-p2 .bf-mob-car__dots i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--bf-text) 22%, transparent); transition: width .2s ease, background .2s ease; }
  html.bf-mob.bf-mob-p2 .bf-mob-car__dots i.is-on { width: 18px; border-radius: 4px; background: var(--bf-accent); }
  html.bf-mob.bf-mob-p2 .bf-mob-car__bar { position: relative; flex: 0 1 140px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--bf-text) 14%, transparent); overflow: hidden; }
  html.bf-mob.bf-mob-p2 .bf-mob-car__bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--bf-accent); }

  /* ── 1б. Ряди посилань/чипів: перенос замість прихованого скролу; >6 — сітка 2 колонки ── */
  html.bf-mob.bf-mob-p2 :is(.sw-lr__u, .sw-hrow:not(.pres-thumbs), .blog-filter__chips) {
    flex-wrap: wrap !important; overflow: visible !important; justify-content: center !important; max-width: 100%;
  }
  html.bf-mob.bf-mob-p2 :is(.sw-lr__u, .sw-hrow:not(.pres-thumbs), .blog-filter__chips) > * { flex: 0 1 auto !important; max-width: 100%; }
  /* (сітку на 2 колонки для >6 чипів не застосовуємо: довгі однослівні назви, напр. «Автомайданчик», не вміщуються в півширини на 320 px) */
  html.bf-mob.bf-mob-p2 .sw-lr__a { white-space: normal; text-align: center; line-height: 1.25; }
  html.bf-mob.bf-mob-p2 .blog-filter__chips { margin-inline: 0 !important; padding-inline: 0 !important; justify-content: flex-start !important; gap: 8px !important; }

  /* ── 1в. Таблиці, що справді прокручуються: край-градієнт і одноразова мітка «гортайте →» (текст — у CSS, не в DOM) ── */
  html.bf-mob.bf-mob-p2 .bf-mob-tbl.is-more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), rgba(0, 0, 0, .25)); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), rgba(0, 0, 0, .25)); }
  html.bf-mob.bf-mob-p2 .bf-mob-tbl-hint { display: flex; justify-content: flex-end; margin: 0 0 6px; pointer-events: none; transition: opacity .3s ease; }
  html.bf-mob.bf-mob-p2 .bf-mob-tbl-hint::before { content: "гортайте →"; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--bf-text-2); background: var(--bf-fill); }
  html.bf-mob.bf-mob-p2 .bf-mob-tbl-hint.is-gone { opacity: 0; }

  /* ── 2. Статистика (11 / 14 / 4): остання непарна картка — на весь рядок ── */
  html.bf-mob.bf-mob-p2 .sw-cnts > li:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* ── 3. Накладання ── */
  /* картки соцмереж у демо: на телефоні — по одній у рядку, лічильник у потоці поруч із назвою, «Опубліковано» з переносом */
  html.bf-mob.bf-mob-p2 .sw-oc__nets { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  html.bf-mob.bf-mob-p2 .sw-oc__net { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px 14px; }
  html.bf-mob.bf-mob-p2 .sw-oc__net .sw-oc__nm { grid-column: 2; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
  html.bf-mob.bf-mob-p2 .sw-oc__net .sw-oc__cnt { position: static; grid-column: 3; grid-row: 1; justify-self: end; }
  html.bf-mob.bf-mob-p2 .sw-oc__net .sw-oc__st { grid-column: 2 / 4; grid-row: 2; min-width: 0; }
  html.bf-mob.bf-mob-p2 .sw-oc__net .sw-oc__ok { white-space: normal; }
  /* сповіщення «Новий запис від ШІ» над рамкою телефона: суцільний фон — рамка не просвічує крізь заголовок */
  html.bf-mob.bf-mob-p2 .sw-aid__note { background: var(--bf-card); }
  /* плашки режимів ШІ: на вузьких — одна колонка */
  @media (max-width: 400px) { html.bf-mob.bf-mob-p2 .sw-aim { grid-template-columns: minmax(0, 1fr); } }
  /* картка ціни: мітка, ціна й період — без вузьких колонок (WebKit) */
  html.bf-mob.bf-mob-p2 .sw-pc { min-width: 0; }
  html.bf-mob.bf-mob-p2 .sw-pc__v { flex-wrap: wrap; }
  html.bf-mob.bf-mob-p2 .sw-pc__rows li { grid-template-columns: 20px minmax(0, 1fr); }

  /* ── 4. Майстер заявки: legend у потоці (float у grid-fieldset на iOS накладав підзаголовок на заголовок на 10 px) ── */
  html.bf-mob.bf-mob-p2 .bf2-wiz__step > legend { float: none; display: block; width: 100%; margin: 0 0 6px; padding: 0; }
  html.bf-mob.bf-mob-p2 .bf2-wiz__step > legend + * { clear: none; }
  html.bf-mob.bf-mob-p2 .bf2-wiz__sub { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html.bf-mob.bf-mob-p2 .bf-mob-car__b, html.bf-mob.bf-mob-p2 .bf-mob-car__dots i, html.bf-mob.bf-mob-p2 .bf-mob-tbl-hint { transition: none !important; }
}

/* ═══════════ MOB-5 (23.11.2026): картинки — лише під html.bf-mob.bf-mob-p3 ('mob_p3') і медіа телефона ═══════════
   Без перегенерації: рамка під пропорцію джерела (обрізка ≤15 %), мініатюри — під реальне співвідношення, без розтягування.
   (Публічний онлайн-запис тенантів — окремий блок «MOB-5-BOOKING» у crm/assets/css/crm.css.) */
@media (max-width: 767.98px), (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px) {
  /* hero-кадри сцен: джерело 3:2, рамка була 21:9 (−36 %) → 3:2 */
  html.bf-mob.bf-mob-p3 .sw-dayhead .sw-heroart img { aspect-ratio: 3 / 2; height: auto; object-fit: cover; object-position: 50% 50%; }
  /* картки ніш: джерело 1:1, рамка 16:10 (−38 %) → 7:6 (обрізка 14 % — у межах ліміту 15 %; повний квадрат подовжив би 11 карток на ≈110 px кожна) */
  html.bf-mob.bf-mob-p3 .sw-ncard__pic img { aspect-ratio: 7 / 6; height: auto; object-fit: cover; object-position: 50% 50%; }
  /* пост-мокап (квадратне фото, рамка 16:10 — −38 %) → 7:6 */
  html.bf-mob.bf-mob-p3 .sw-post--compose .sw-post__img img { aspect-ratio: 7 / 6; height: auto; object-fit: cover; object-position: 50% 50%; }
  /* обкладинки «Інші статті» (1600×840) — під пропорцію джерела */
  html.bf-mob.bf-mob-p3 .blog-nb__media img { aspect-ratio: 40 / 21; height: auto; object-fit: cover; }
}
/* ландшафт телефона: квадратна сцена вступу в рамці 21:9 (−57 %) — цілком, по центру, не вище 70 % екрана */
@media (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px), (max-width: 767.98px) and (orientation: landscape) {
  html.bf-mob.bf-mob-p3 .sw-intro__pic img { aspect-ratio: 1 / 1; width: auto; max-width: 100%; height: min(70vh, 100%); max-height: 70vh; margin-inline: auto; object-fit: contain; }
}

/* ═══════════ MOB-6 (23.11.2026): типографіка, контраст, зони дотику, залишки — лише під html.bf-mob.bf-mob-p4 ('mob_p4') і медіа телефона ═══════════
   Кольори — лише локальні правила під конкретні селектори; спільні токени не змінюються. Обгортку .bf-nw навколо слів через дефіс додає site-mob.js. */
@media (max-width: 767.98px), (min-width: 768px) and (max-width: 1119.98px) and (max-height: 500px) {
  /* ── 1. Типографіка ── */
  /* inline-block замість white-space:nowrap: слово переходить на новий рядок цілим і не рветься на дефісі, а якщо ширше за блок
     (збільшений системний шрифт, вузька картка) — max-width:100% дозволяє розрив усередині, тож сторінку воно не розпирає */
  html.bf-mob.bf-mob-p4 .bf-nw { display: inline-block; max-width: 100%; }
  html.bf-mob.bf-mob-p4 main :is(h1, h2, h3) { text-wrap: balance; }
  html.bf-mob.bf-mob-p4 main :is(p, li) { text-wrap: pretty; }

  /* ── 2. Контраст ≥4,5:1 ── */
  /* приглушені кроки демо до кліку (0,42 / 0,45): на телефоні 0,9 — сірі підписи тримають ≥4,5:1, стан «ще не відтворено» лишається помітним */
  html.bf-mob.bf-mob-p4 .sw-oc.is-armed .sw-oc__step, html.bf-mob.bf-mob-p4 .sw-day.is-armed .sw-day__s { opacity: .9; }
  /* бульбашка клієнта й «Нове» на акценті: білий на #7C5CFC = 4,38 → акцент темніший на 12 % */
  html.bf-mob.bf-mob-p4 .sw-cm--u .sw-cm__b, html.bf-mob.bf-mob-p4 .sw-ribbon__new { background: color-mix(in srgb, var(--bf-accent) 86%, #000); }
  /* кнопка «Погодити» в мокапі Telegram: білий на #26A5E4 = 2,77 */
  html.bf-mob.bf-mob-p4 .sw-tgok__btn { background: #1b7db0; }
  /* лічильник лайків у демо-картках (#FF0069 = 3,85 на білому) */
  html.bf-mob.bf-mob-p4 .sw-oc__cnt { color: #c8005a; }
  html.bf-mob.bf-mob-p4[data-theme="dark"] .sw-oc__cnt { color: #ff5c9a; }
  /* бейдж «скоро» 11 px і сіра пігулка «ще ні» на лавандовому */
  html.bf-mob.bf-mob-p4 .sw-oc__step .sw-soon { font-size: 12px; }
  html.bf-mob.bf-mob-p4 .sw-pill--no { color: var(--bf-text-2); }

  /* ── 3. Зони дотику ≥44 px ── */
  html.bf-mob.bf-mob-p4 :is(.sw-fx__btn, .sw-chip__a, .bf2-path__links a, .pres-thumb, .blog-chip, .blog-tag, .blog-card .bf2-btn, .tour-ctl .bf2-btn) { min-height: 44px; }
  html.bf-mob.bf-mob-p4 :is(.blog-card__cat, .blog-article__cat, .blog-crumbs a, .blog-back a, .blog-nb__all a, .tsiny-cta__alt a, .sw-nsoc__link a) { display: inline-flex; align-items: center; min-height: 44px; }
  html.bf-mob.bf-mob-p4 :is(.tour-link, .tour-full) { min-height: 44px; }
  /* текстові посилання-стрілки «… →» і підписи в картках: рядок-ціль 44 px без зміни вигляду тексту */
  html.bf-mob.bf-mob-p4 :is(.hai-card__go, .bf2-svc__go a, .bf2-layer > a, .sw-home-oc__more a, .work-card__link, .pk-case-card__links a, .intg-cta__alt a, .legal-back, p.sw-home-oc__more > a, .bf2-layer > a) { display: inline-flex; align-items: center; min-height: 44px; }
  html.bf-mob.bf-mob-p4 :is(.bf-sx-chip, .bf2-chip, .blog-view__btn, .sw-md__tab, .sw-md__send) { min-height: 44px; }
  html.bf-mob.bf-mob-p4 .blog-view__btn { min-width: 44px; }
  html.bf-mob.bf-mob-p4 .bf2-field > label, html.bf-mob.bf-mob-p4 .contact-field > label { min-height: 28px; }
  html.bf-mob.bf-mob-p4 label.contact-consent { min-height: 44px; align-items: center; }
  /* ── дрібні шрифти в тексті для читання ── */
  html.bf-mob.bf-mob-p4 :is(.sw-chip__t > small, .sw-aim li, .sw-pc__n) { font-size: 14px; }

  /* ── 4. Якорі: html уже має scroll-padding-top (шапка + 16 px) — scroll-margin не додаємо (подвоїв би відступ); повторне вирівнювання — site-mob.js ── */
  /* ── 5. Блог і юридичні: нічого не виходить за ширину ── */
  html.bf-mob.bf-mob-p4 :is(.blog-article__body, .legal-article) :is(img, video, iframe) { max-width: 100%; height: auto; }
  html.bf-mob.bf-mob-p4 :is(.blog-article__body, .legal-article) :is(a, code) { overflow-wrap: anywhere; }
  html.bf-mob.bf-mob-p4 :is(.blog-article__body, .legal-article) pre { max-width: 100%; overflow-x: auto; }
}

/* ═══════════ MOB-8 (23.11.2026): Бізик у ландшафті телефона — лише під html.bf-mob.bf-mob-p5 ('mob_p5' => true, залежить від 'mob_p0') ═══════════
   Ландшафт телефона (висота ≤500 + дотик, ширина ≤1119): та сама компактна фігура 64×78, що й ≤480, праворуч над нижньою панеллю, при прокрутці
   вниз заїжджає за край (site-mob.js: bzCompact). Миша й великі екрани (ПК, планшет 768 портрет/ландшафт із висотою >500) — без змін.
   Правила прихованості (меню, форма в полі зору, cookie, клавіатура) — ті самі (MOB-2). Відкат: 'mob_p5' => false. */
@media (max-height: 500px) and (pointer: coarse) and (max-width: 1119.98px) {
  html.bf-mob.bf-mob-p5.bf-bizik-full { --bz-h: 78px; }   /* ширина фігури = 0.8216 × 78 ≈ 64 px (було 123×150) */
  html.bf-mob.bf-mob-p5.bf-bizik-full .ai-consultant-widget {
    right: env(safe-area-inset-right, 0px);
    bottom: calc(var(--mob-bar-h, 56px) + 12px + env(safe-area-inset-bottom, 0px));
    transition: bottom .25s ease, opacity .2s ease, visibility 0s;
  }
  html.bf-mob.bf-mob-p5.bf-bizik-full.bf-mob-bar-off .ai-consultant-widget { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html.bf-mob.bf-mob-p5.bf-bizik-full .ai-consultant-widget .bz-full { transition: transform .14s ease-out, translate .3s ease, opacity .25s ease, visibility 0s; }
  html.bf-mob.bf-mob-p5.bf-bizik-full .ai-consultant-widget.bf-mob-tuck:not(.is-open) .bz-full { translate: calc(100% - 16px) 0; }
  html.bf-mob.bf-mob-p5.bf-bizik-full .ai-consultant-widget.bf-mob-tuck:not(.is-open) .bz-full::before { content: ""; position: absolute; z-index: 4; left: -28px; top: 0; width: 44px; height: 100%; pointer-events: auto; }
  html.bf-mob.bf-mob-p5 .bz-full-hint { max-width: min(160px, calc(100vw - 96px)); }
}
@media (prefers-reduced-motion: reduce) and (max-height: 500px) and (pointer: coarse) and (max-width: 1119.98px) {
  html.bf-mob.bf-mob-p5.bf-bizik-full .ai-consultant-widget.bf-mob-tuck:not(.is-open) .bz-full { translate: none; opacity: 0; visibility: hidden; pointer-events: none; }
}
/* LINKEDIN-2 (26.11.2026): у футері 6 іконок соцмереж (+ LinkedIn): 6 × 44 + 5 × 8 = 304 px не вміщаються в 280 px на найвужчих екранах (< 360 px),
   остання виходила за відступ 16 px. Лише тут дозволяємо перенос (кнопки лишаються 44 × 44 для дотику); на ≥ 360 px — як було (один ряд). */
@media (max-width: 359.98px) {
  html.bf-mob.bf-mob-p1 body .bf2-social--footer ul { flex-wrap: wrap; }
}
