/* first-paint: dump header/h1 stay visible; no rise-from-0, no font @import wait */
html,
body {
  background: #f3eee6;
  color: #1a1612;
}
header,
main,
main#main-content,
h1,
h1.font-display,
#visual-result {
  opacity: 1 !important;
  visibility: visible !important;
}
.rise,
.rise-2,
.rise-3,
.rise-4 {
  animation: none !important;
  animation-delay: 0s !important;
  opacity: 1 !important;
  transform: none !important;
}

/* 404-shell из spa-fallback не должен мелькать на живых страницах */
#linosklad-404-paint {
  display: none !important;
}
html[data-ls-404="1"] #linosklad-404-paint {
  display: block !important;
}

/* 2026-09-17 mobile: sticky CTA + нижнее меню не должны бить поля формы */
@media (max-width: 1023px) {
  form.mt-6.space-y-4 > .sticky.bottom-20 {
    position: static;
  }

  /* checkout: поля (имя…комментарий) выше fixed-меню уже на первом кадре */
  form.mt-6:has(textarea[name="comment"]) {
    padding-bottom: 8.5rem;
  }
  form.mt-6:has(textarea[name="comment"]) > :not(:last-child) {
    margin-block-end: 0.4rem;
  }
  form.mt-6:has(textarea[name="comment"]) > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0;
    margin-block-start: 0;
  }
  form.mt-6:has(textarea[name="comment"]) textarea[name="comment"] {
    min-height: 4rem;
    height: 4rem;
    max-height: 5.5rem;
  }
  form.mt-6:has(textarea[name="comment"]) [data-legal-consent],
  form.mt-6:has(textarea[name="comment"]) input[name="agree"] {
    margin-block: 0.15rem;
  }

  main#main-content:has(textarea[name="comment"]) {
    padding-bottom: 8.5rem;
  }

  html:has(textarea[name="comment"]) {
    scroll-padding-bottom: 7rem;
  }

  form.mt-6:has(textarea[name="comment"]) input[name="name"],
  form.mt-6:has(textarea[name="comment"]) input[name="tel"],
  form.mt-6:has(textarea[name="comment"]) input[name="city"],
  form.mt-6:has(textarea[name="comment"]) input[name="address"],
  form.mt-6:has(textarea[name="comment"]) textarea[name="comment"],
  form.mt-6:has(textarea[name="comment"]) [data-legal-consent],
  form.mt-6:has(textarea[name="comment"]) button[type="submit"] {
    scroll-margin-bottom: 7.5rem;
  }

  /* Сопутствие: «В корзину» не прятать под нижнее меню */
  a[href^="/cart?add="] {
    scroll-margin-bottom: 7rem;
  }
  main#main-content:has(a[href^="/cart?add="]) {
    padding-bottom: 8.5rem;
  }
}

@media (min-width: 1024px) {
  form.mt-6:has(textarea[name="comment"]) {
    padding-bottom: 0;
  }
}

/* 390: длинный h1 «Политика конфиденциальности» раздувал scrollWidth */
@media (max-width: 430px) {
  h1.font-display {
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}

/* leftover dump 20260918: first paint already leftoverArea. Hide only if NaN returns. */
