/* Мобильная адаптация лендинга /dash/ (дополнение к Tailwind-бандлу) */

@media (max-width: 767px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    margin: 0;
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  /* Вместо жёсткого h-screen + overflow:hidden — прокрутка страницы */
  #root .h-screen {
    height: auto;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #root .overflow-hidden {
    overflow-x: hidden;
    overflow-y: visible;
  }

  #root .container {
    max-width: 100%;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  #root .relative.z-10.h-full {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    height: auto !important;
    justify-content: flex-start !important;
    gap: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top)) !important;
    padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
  }

  #root .py-12 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #root header img.w-30 {
    width: 4.5rem !important;
    height: 4.5rem !important;
  }

  #root main {
    width: 100%;
    padding-inline: 0.25rem;
  }

  #root h1.text-5xl {
    font-size: clamp(1.75rem, 8.5vw, 2.5rem) !important;
    line-height: 1.05 !important;
    margin-bottom: 0.75rem !important;
  }

  #root main .text-lg {
    font-size: 0.9375rem !important;
    line-height: 1.55 !important;
    margin-bottom: 1.25rem !important;
    padding-inline: 0.25rem;
  }

  #root .mb-16 {
    margin-bottom: 1.25rem !important;
  }

  /* Карточки порталов */
  #root .grid.grid-cols-1 {
    gap: 0.625rem !important;
  }

  #root a.group.p-10,
  #root .p-10 {
    padding: 1.125rem 1rem !important;
    min-height: 5.5rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  #root .border-x {
    border-left-width: 0 !important;
    border-right-width: 0 !important;
  }

  #root h2.text-2xl {
    font-size: 1.25rem !important;
    word-break: break-word;
  }

  #root .absolute.top-0.right-0.p-4 {
    padding: 0.75rem !important;
  }

  #root .absolute.top-0.right-0 .w-12 {
    width: 2rem !important;
    height: 2rem !important;
  }

  /* Подвал */
  #root footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1.25rem !important;
    padding-top: 1rem !important;
    margin-top: 0.5rem;
  }

  #root footer > .flex.gap-12 {
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100%;
  }

  #root footer .text-right {
    text-align: left !important;
    align-items: flex-start !important;
  }

  #root footer a {
    min-height: 2.75rem;
    align-items: center;
  }

  #root footer img.w-6 {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }

  /* Модальное окно «Забыли пароль» — снизу экрана, с прокруткой */
  #root .fixed.max-w-md.bg-zinc-900,
  #root [class*="z-[110]"] {
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: auto !important;
    bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
    --tw-translate-x: 0 !important;
    --tw-translate-y: 0 !important;
    translate: none !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(88dvh, calc(100dvh - 1.5rem));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1rem 1.5rem !important;
    border-radius: 1rem;
  }

  #root .grid.grid-cols-2.gap-2 {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  #root .grid.grid-cols-2.gap-2 button {
    min-height: 3rem;
    width: 100%;
  }

  #root input,
  #root button {
    font-size: 16px; /* без зума на iOS */
  }
}

@media (max-width: 380px) {
  #root h1.text-5xl {
    font-size: 1.625rem !important;
  }

  #root [class*="tracking-[0.2em]"] {
    letter-spacing: 0.12em !important;
  }
}
