/* Мобильная доводка страниц Tilda (главная, B2B, контакты). Только экраны до 639px. */
@media (max-width: 959px) {

  /* ---------- Главная: «О нас» — обычная колонка вместо абсолютной вёрстки ---------- */
  #rec1544949191 .t396__artboard {
    height: auto !important; min-height: 0 !important;
    display: grid; grid-template-columns: 78px 1fr; column-gap: 12px; row-gap: 6px; align-items: center;
    padding: 36px 20px 40px; box-sizing: border-box;
  }
  #rec1544949191 .t396__carrier, #rec1544949191 .t396__filter { height: 100% !important; }
  #rec1544949191 .tn-elem {
    position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    width: auto !important; height: auto !important; transform: none !important;
  }
  #rec1544949191 .tn-elem[data-elem-type="shape"] { display: none !important; }
  #rec1544949191 .tn-elem[data-elem-id="1761024276676"] { order: 1; grid-column: 1 / -1; }
  #rec1544949191 .tn-elem[data-elem-id="1763034416926"] { order: 2; grid-column: 1 / -1; margin-bottom: 8px; }
  #rec1544949191 .tn-elem[data-elem-id="1761024038161"] { order: 3; grid-column: 1 / -1; margin-bottom: 18px; }
  #rec1544949191 .tn-elem[data-elem-id="1761024276676"] .tn-atom { font-size: 13px !important; letter-spacing: 2px; color: #e5c394 !important; }
  #rec1544949191 .tn-elem[data-elem-id="1763034416926"] .tn-atom { font-size: 24px !important; line-height: 1.2 !important; }
  #rec1544949191 .tn-elem[data-elem-id="1761024038161"] .tn-atom { font-size: 15px !important; line-height: 1.6 !important; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909011180"] { order: 4; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909741640"] { order: 5; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909282580"] { order: 6; }
  #rec1544949191 .tn-elem[data-elem-id="176171357910156870"] { order: 7; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909477110"] { order: 8; }
  #rec1544949191 .tn-elem[data-elem-id="176171357910475930"] { order: 9; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909510260"] { order: 10; }
  #rec1544949191 .tn-elem[data-elem-id="176171357910894540"] { order: 11; }
  #rec1544949191 .tn-elem[data-elem-id^="17617135790"] .tn-atom { font-size: 26px !important; line-height: 1.2 !important; color: #e5c394 !important; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909741640"] .tn-atom,
  #rec1544949191 .tn-elem[data-elem-id="176171357910156870"] .tn-atom,
  #rec1544949191 .tn-elem[data-elem-id="176171357910475930"] .tn-atom,
  #rec1544949191 .tn-elem[data-elem-id="176171357910894540"] .tn-atom { font-size: 14px !important; line-height: 1.35 !important; color: #f0ebe6 !important; }

  /* ---------- Главная: лишние отступы ---------- */
  #rec1580068031 { padding-top: 36px !important; padding-bottom: 28px !important; }
  #rec1545005971 { padding-top: 48px !important; padding-bottom: 40px !important; }
  #rec1545005971 .t-section__title { margin-bottom: 24px !important; text-align: center; }

  /* ---------- Главная: форма заявки — колонкой, заголовок слева ---------- */
  #rec1544949321 .t396__artboard {
    height: auto !important; min-height: 0 !important; display: flex; flex-direction: column; gap: 18px;
    padding: 32px 20px 36px; box-sizing: border-box; background: #4a352d !important;
  }
  #rec1544949321 .t396__carrier, #rec1544949321 .t396__filter { display: none !important; }
  #rec1544949321 .tn-elem {
    position: relative !important; left: auto !important; top: auto !important; width: 100% !important; height: auto !important; transform: none !important;
  }
  #rec1544949321 .tn-elem[data-elem-type="shape"], #rec1544949321 .tn-elem[data-elem-type="image"] { display: none !important; }
  #rec1544949321 .tn-elem[data-elem-id="1762414105856"] .tn-atom { text-align: left !important; font-size: 22px !important; line-height: 1.3 !important; }
  #rec1544949321 .tn-elem[data-elem-id="1762413729733"] { min-height: 290px; display: block !important; }
  #rec1544949321 .tn-elem[data-elem-id="1762413729733"] .tn-atom { display: block !important; }
  #rec1544949321 .t-input-title { font-size: 15px !important; }

  /* ---------- B2B ---------- */
  #rec1591651091 .tn-elem[data-elem-id="1763717639142"] { left: 20px !important; width: calc(100% - 40px) !important; }
  #rec1591651091 .tn-elem[data-elem-id="1763717639142"] .tn-atom { font-size: 26px !important; line-height: 1.2 !important; }
  #rec1602647261 .tn-elem[data-elem-id="1763985976578"] .tn-atom { text-align: center !important; }
  #rec1602448671 .tn-elem[data-elem-id="1763721455994"] { left: 12px !important; width: calc(100% - 24px) !important; }
  #rec1602448671 .tn-elem[data-elem-id="1763721542116"] { top: 44px !important; left: 32px !important; width: calc(100% - 64px) !important; }
  #rec1602448671 .tn-elem[data-elem-id="1763721585612"],
  #rec1602448671 .tn-elem[data-elem-id="1763721614409"],
  #rec1602448671 .tn-elem[data-elem-id="1763721629595"] { left: 32px !important; width: calc(100% - 64px) !important; }

  /* ---------- Контакты: иконки соцсетей видны на тёмном фоне ---------- */
  .t433 .t-sociallinks__item a svg path, .t433 .t-sociallinks__item a svg rect, .t433 .t-sociallinks__item a svg circle { fill: #fff !important; }
  .t433 .t-sociallinks__item a svg > path:first-child { fill: #cc8e40 !important; }

  /* ---------- Подвал на всех страницах ---------- */
  .t457 .t457__copyright, .t457 .t-descr { font-size: 12px !important; line-height: 1.6 !important; }
}
@media (max-width: 959px) {
  #rec1544949321 .tn-elem[data-elem-id="1762414105856"] { order: 1; }
  #rec1544949321 .tn-elem[data-elem-id="1762413729733"] { order: 2; min-height: 270px; }
  #rec1544949321 .t396__artboard { padding-bottom: 28px; }
}

/* ---------- B2B «О компании»: видео, под ним текст — обычной колонкой, без наложения ---------- */
@media (max-width: 959px) {
  #rec1602391021 .t396__artboard {
    height: auto !important; min-height: 0 !important; display: flex; flex-direction: column; align-items: stretch; gap: 22px;
    max-width: 560px; margin: 0 auto; padding: 36px 20px 44px; box-sizing: border-box;
  }
  #rec1602391021 .t396__carrier, #rec1602391021 .t396__filter { height: 100% !important; }
  #rec1602391021 .tn-elem {
    position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
    width: 100% !important; height: auto !important; transform: none !important; zoom: 1 !important;
  }
  #rec1602391021 .tn-elem[data-elem-type="shape"] { display: none !important; }
  #rec1602391021 .tn-elem[data-elem-id="1470209944682"] { order: 1; }
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] { order: 2; aspect-ratio: 9 / 14; max-height: 70vh; border-radius: 16px; overflow: hidden; }
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] .tn-atom,
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] video,
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] iframe { width: 100% !important; height: 100% !important; object-fit: cover; }
  #rec1602391021 .tn-elem[data-elem-id="1763983607054"] { order: 3; }
  #rec1602391021 .tn-elem[data-elem-id="1763983607054"] .tn-atom { font-size: 17px !important; line-height: 1.55 !important; }
}
@media (max-width: 959px){
  #rec1544949191 .t396__artboard{max-width:600px;margin:0 auto}
  #rec1544949191 .tn-elem .tn-atom{text-align:left !important}
}

/* ---------- Ноутбуки 960–1199px: главная ---------- */
@media (min-width: 960px) and (max-width: 1199px) {
  /* «О нас»: слева текст, справа цифры — без обрезки справа */
  #rec1544949191 .t396__artboard {
    height: auto !important; min-height: 0 !important; box-sizing: border-box; padding: 64px 6% 70px;
    display: grid; grid-template-columns: minmax(0, 1.25fr) 96px minmax(0, 1fr); column-gap: 18px; row-gap: 10px; align-items: center;
  }
  #rec1544949191 .t396__carrier, #rec1544949191 .t396__filter { height: 100% !important; }
  #rec1544949191 .tn-elem { position: relative !important; left: auto !important; top: auto !important; width: auto !important; height: auto !important; zoom: 1 !important; transform: none !important; }
  #rec1544949191 .tn-elem[data-elem-type="shape"] { display: none !important; }
  #rec1544949191 .tn-elem[data-elem-id="1761024276676"] { grid-column: 1; grid-row: 1; }
  #rec1544949191 .tn-elem[data-elem-id="1763034416926"] { grid-column: 1; grid-row: 2; }
  #rec1544949191 .tn-elem[data-elem-id="1761024038161"] { grid-column: 1; grid-row: 3 / span 2; align-self: start; padding-right: 30px; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909011180"] { grid-column: 2; grid-row: 1; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909741640"] { grid-column: 3; grid-row: 1; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909282580"] { grid-column: 2; grid-row: 2; }
  #rec1544949191 .tn-elem[data-elem-id="176171357910156870"] { grid-column: 3; grid-row: 2; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909477110"] { grid-column: 2; grid-row: 3; }
  #rec1544949191 .tn-elem[data-elem-id="176171357910475930"] { grid-column: 3; grid-row: 3; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909510260"] { grid-column: 2; grid-row: 4; }
  #rec1544949191 .tn-elem[data-elem-id="176171357910894540"] { grid-column: 3; grid-row: 4; }
  #rec1544949191 .tn-elem .tn-atom { text-align: left !important; }
  #rec1544949191 .tn-elem[data-elem-id^="17617135790"] .tn-atom { font-size: 40px !important; line-height: 1.1 !important; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909741640"] .tn-atom,
  #rec1544949191 .tn-elem[data-elem-id="176171357910156870"] .tn-atom,
  #rec1544949191 .tn-elem[data-elem-id="176171357910475930"] .tn-atom,
  #rec1544949191 .tn-elem[data-elem-id="176171357910894540"] .tn-atom { font-size: 15px !important; line-height: 1.35 !important; }

  /* «Применение»: 4 фото ровно в ширину экрана */
  #rec1545022261 .tn-elem[data-elem-id="1762849521451"], #rec1545022261 .tn-elem[data-elem-id="1763368781938"] { left: 0 !important; }
  #rec1545022261 .tn-elem[data-elem-id="176284954159874660"], #rec1545022261 .tn-elem[data-elem-id="176336879240722380"] { left: 25% !important; }
  #rec1545022261 .tn-elem[data-elem-id="176284954893535370"], #rec1545022261 .tn-elem[data-elem-id="176336879807078780"] { left: 50% !important; }
  #rec1545022261 .tn-elem[data-elem-id="176284954894483420"], #rec1545022261 .tn-elem[data-elem-id="176336880999157260"] { left: 75% !important; }
  #rec1545022261 .tn-elem[data-elem-type="image"], #rec1545022261 .tn-elem[data-elem-type="shape"] { width: calc(25% - 5px) !important; zoom: 1 !important; }
  #rec1545022261 .tn-elem[data-elem-id="176336885396037360"] { left: 18px !important; }
  #rec1545022261 .tn-elem[data-elem-id="176336887267377490"] { left: calc(25% + 18px) !important; }
  #rec1545022261 .tn-elem[data-elem-id="1763368718035"] { left: calc(50% + 18px) !important; }
  #rec1545022261 .tn-elem[data-elem-id="176336887938563080"] { left: calc(75% + 18px) !important; }
  #rec1545022261 .tn-elem[data-elem-type="text"] { width: calc(25% - 40px) !important; zoom: 1 !important; }
}

/* ---------- Ноутбуки 960–1199px: B2B ---------- */
@media (min-width: 960px) and (max-width: 1199px) {
  /* Первый экран: кнопка под заголовком, а не за правым краем */
  #rec1591651091 .tn-elem[data-elem-id="1763717748523"] { left: 20px !important; top: 420px !important; zoom: 1 !important; }
  /* «О компании»: заголовок и линия над текстом справа от видео */
  #rec1602391021 .tn-elem[data-elem-id="1470209944682"] { left: 391px !important; top: 120px !important; width: auto !important; zoom: 1 !important; }
  #rec1602391021 .tn-elem[data-elem-id="1470209944682"] .tn-atom { text-align: left !important; }
  #rec1602391021 .tn-elem[data-elem-id="1473846256711"] { left: 391px !important; top: 190px !important; width: calc(100% - 431px) !important; zoom: 1 !important; }
  #rec1602391021 .tn-elem[data-elem-id="1763983607054"] { top: 214px !important; width: calc(100% - 431px) !important; max-width: 640px; zoom: 1 !important; }
}
@media (min-width: 960px) and (max-width: 1199px) {
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] { top: 120px !important; left: 29px !important; width: 306px !important; height: 547px !important; zoom: 1 !important; border-radius: 16px; overflow: hidden; }
  #rec1602391021 .t396__artboard, #rec1602391021 .t396__carrier, #rec1602391021 .t396__filter { height: 760px !important; }
}

/* ---------- Ноутбуки 960–1199px: форма заявки на главной — плашка по ширине экрана, форма у правого края ---------- */
@media (min-width: 960px) and (max-width: 1199px) {
  #rec1544949321 .tn-elem[data-elem-id="1762413936132"] { left: 20px !important; width: calc(100% - 40px) !important; zoom: 1 !important; }
  #rec1544949321 .tn-elem[data-elem-id="1775996556176"] { left: 20px !important; zoom: 1 !important; }
  #rec1544949321 .tn-elem[data-elem-id="1762414105856"] { left: auto !important; right: 60px !important; width: calc(100% - 440px) !important; zoom: 1 !important; }
  #rec1544949321 .tn-elem[data-elem-id="1762414105856"] .tn-atom { font-size: 34px !important; }
  #rec1544949321 .tn-elem[data-elem-id="1762413729733"] { left: auto !important; right: 60px !important; zoom: 1 !important; }
}

/* ---------- Главная: блок-истории «С чего начать выбор камня?» (t994) ----------
   Скрипт Тильды на телефонах ставит высоту = высоте окна при каждом resize. На iPhone панель Safari
   прячется/появляется при прокрутке → блок меняет высоту → страница прыгает. Фиксируем высоту: --lsq-vh ставит lsq-common.js и меняет только при смене ширины (поворот). */
@media (max-width: 959px) {
  #rec1544949251 .t994__slidecontainer, #rec1544949251 .t994__width-wrapper,
  #rec1544949251 .t994__item, #rec1544949251 .t994__item-wrapper { height: 100vh !important; height: var(--lsq-vh, 100svh) !important; }
}

/* B2B «О компании»: в Safari видео съезжало вниз из-за zoom, который ставит Тильда, — прибиваем его к рамке */
@media (max-width: 959px) {
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] .tn-atom { position: relative !important; }
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] .tn-atom__videoiframe { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; }
  #rec1602391021 .tn-elem[data-elem-id="1763976577946"] video {
    position: absolute !important; top: 0 !important; left: 0 !important; zoom: 1 !important;
    width: 100% !important; height: 100% !important; object-fit: cover; margin: 0 !important;
  }
}

/* ---------- Телефоны и планшеты: без «дёрганий» при прокрутке ----------
   – анимации выезда Тильды (fadeinleft/right) на мгновение выталкивают элементы за край экрана — Safari сдвигает страницу вбок;
   – параллакс фона двигается скриптом на каждый кадр прокрутки — на iPhone рывками;
   – страница не должна прокручиваться вбок ни при каких условиях. */
@media (max-width: 959px) {
  html, body { overflow-x: hidden; }
  @supports (overflow: clip) { html, body { overflow-x: clip; } }
  .t-animate { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  .t-cover__carrier { background-attachment: scroll !important; transform: none !important; top: 0 !important; height: 100% !important; }
}

/* Главная «О нас»: цифры 100/6/95/100 анимированно «набегают». Пока число меняется, оно переносилось на 2 строки —
   блок рос/сжимался на 38px, и вся страница ниже тряслась. Число всегда в одну строку, высота строки фиксирована. */
@media (max-width: 959px) {
  #rec1544949191 .tn-elem[data-elem-id^="17617135790"] .tn-atom { white-space: nowrap !important; }
  #rec1544949191 .tn-elem[data-elem-id="176171357909011180"],
  #rec1544949191 .tn-elem[data-elem-id="176171357909282580"],
  #rec1544949191 .tn-elem[data-elem-id="176171357909477110"],
  #rec1544949191 .tn-elem[data-elem-id="176171357909510260"] { min-height: 38px; display: flex !important; align-items: center; }
}
