html, body {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

/* Защита от непреднамеренной горизонтальной прокрутки */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Адаптивные изображения */
/* img {
  max-width: 100%;
  display: block;
} */

/* Мобильный оверрайд только для img.w-full.h-96.object-cover */
@media (max-width: 640px) {
    
    /* показать только первый аватар на мобильных */
.flex.justify-center.space-x-8 > img {
  display: none !important;
}

.flex.justify-center.space-x-8 > img:first-child {
  display: inline-block !important;
  width: 5rem !important;      /* соответствует w-20 */
  height: 5rem !important;     /* соответствует h-20 */
  object-fit: cover !important;
  border-radius: 9999px !important; /* соответствует rounded-full */
  box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important; /* соответствует shadow-lg */
}

    
  img.w-full.h-96.object-cover {
    width: 100% !important;
    display: block !important;
    height: calc(var(--spacing) * 66) !important;
    max-height: calc(var(--spacing) * 66) !important;
    object-fit: cover !important;
    object-position: center center !important;
    box-sizing: border-box !important;
  }

  /* Безопасная альтернатива для участков, где фиксированная высота ломает поток:
     снимет фиксированную высоту, оставит ограничение по max-height */
  img.w-full.h-96.object-cover.safe {
    height: auto !important;
    max-height: calc(var(--spacing) * 66) !important;
    object-fit: cover !important;
  }

  /* Если изображение находится внутри .relative с overlay элементами,
     гарантируем, что контейнер не позволит картинке выйти за пределы */
  .relative > img.w-full.h-96.object-cover,
  .relative img.w-full.h-96.object-cover {
    max-width: 100% !important;
    overflow: hidden !important;
    display: block !important;
  }
}


@media (max-width: 640px) {
  /* Базовые установки */
  html, body {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-x: visible;
  }

  body {
    font-size: 18px;
    line-height: 1.6;
    padding: 0 6px;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    min-width: 0;
  }

  /* Заголовки и текст */
  h1 {
    font-size: 28px !important;
    line-height: 1.25 !important;
    margin: 0 0 0.5rem 0;
    word-break: break-word;
  }
  h2 {
    font-size: 24px !important;
    line-height: 1.25 !important;
    margin: 0 0 0.5rem 0;
    word-break: break-word;
  }
  h3 {
    font-size: 20px !important;
    line-height: 1.25 !important;
    margin: 0 0 0.5rem 0;
    word-break: break-word;
  }

  p, li, a, span {
    font-size: 16px !important;
    line-height: 1.6 !important;
    word-break: break-word;
    min-width: 0;
  }

  /* Медиа */
  /*  img, picture, video, iframe {
    max-width: 100% !important;
   /*  height: auto !important; */
   /*  display: block !important;*/
  }

  /* Хедер: позволить элементам сжиматься, логотип максимум 55 процентов */
  header .flex, header .flex > * {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  header .flex > :first-child {
    flex-shrink: 1 !important;
    min-width: 0 !important;
    max-width: 55% !important;
    box-sizing: border-box !important;
  }

  /* Универсальные правила для кнопок на странице */
  a[data-slot="button"], button[class*="btn"], .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
    min-width: 60px !important;
    border-radius: 8px !important;
  }

  /* Кнопка в шапке: сжимается, не выталкивает шапку */
  header a[data-slot="button"] {
    flex: 0 1 auto !important;
    flex-shrink: 1 !important;
    max-width: 44% !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    height: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    min-width: 72px !important;
  }
  header a[data-slot="button"] svg {
    width: 16px !important;
    height: 16px !important;
    margin-right: 6px !important;
    flex-shrink: 0 !important;
  }

  /* Мобильное меню: компактнее, маленький шрифт, небольшой gap, горизонтальная прокрутка при необходимости */
  .mobile-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    padding: 4px 6px !important;
    justify-content: flex-start !important;
    scrollbar-width: thin !important;
    min-width: 0 !important;
  }
  .mobile-nav::-webkit-scrollbar {
    height: 4px !important;
  }
  .mobile-nav a {
    flex: 0 0 auto !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    min-width: 0 !important;
    text-align: center !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  /* Текст в карточках */
  [data-slot="card-content"] p,
  [data-slot="card-content"] span {
    font-size: 16px !important;
  }

  /* Абсолютные бейджи и блоки с отрицательными отступами: безопасные отступы */
  .absolute[class*="-right-"], [class*="-right-"] > .absolute,
  .relative > div[style*="right:-"], .relative > div[style*="bottom:-"] {
    right: 0.5rem !important;
    bottom: -0.6rem !important;
    transform: none !important;
    max-width: 48% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .absolute[class*="-right-"] img,
  .relative > div[style*="right:-"] img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Защита для flex контейнеров */
  .flex, .inline-flex {
    min-width: 0 !important;
  }
}



/* === Планшеты (641px – 1024px) === */
@media (min-width: 641px) and (max-width: 1024px) {
  body {
    font-size: 18px;
    line-height: 1.6;
  }

  h1 {
    font-size: 36px !important;
    line-height: 1.3 !important;
  }

  h2 {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }

  p, li, a, span {
    font-size: 17px !important;
    line-height: 1.6 !important;
  }

  /* Кнопки */
  a[data-slot="button"] {
    font-size: 17px !important;
    padding: 14px 24px !important;
  }

  /* Меню */
  nav a {
    font-size: 16px !important;
    margin: 0 8px;
  }
}

/* === Десктопы от 1025px === */
@media (min-width: 1025px) {
  body {
    font-size: 18px;
  }

  h1 {
    font-size: 48px !important;
  }

  h2 {
    font-size: 36px !important;
  }

  h3 {
    font-size: 24px !important;
  }

  nav a {
    font-size: 16px;
  }
}
