/* Security/mobile release: global responsive fixes loaded after all theme files. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 320px; }
img, video, audio { max-width: 100%; }
button, input, select, textarea { font: inherit; }

@media (max-width: 720px) {
  .auth-modal {
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    padding: 0 !important;
    place-items: stretch !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  .auth-dialog {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }

  .auth-art { display: none !important; }

  .auth-form-side {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(34px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    background: #fff !important;
  }

  .auth-close {
    position: sticky !important;
    z-index: 8 !important;
    top: 0 !important;
    margin: 0 0 -42px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
  }

  .auth-tabs-modern {
    position: sticky !important;
    z-index: 7 !important;
    top: 0 !important;
    width: calc(100% - 54px) !important;
    margin: 0 54px 24px 0 !important;
    background: rgba(242,242,248,.96) !important;
    backdrop-filter: blur(12px);
  }

  .auth-modern-form {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    gap: 16px !important;
    padding-bottom: 20px !important;
  }

  .auth-modern-form h2 {
    font-size: clamp(1.65rem, 8vw, 2.2rem) !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere;
  }

  .auth-modern-form .input,
  .auth-modern-form input,
  .auth-modern-form button,
  .auth-modern-form select {
    min-height: 50px;
    font-size: 16px !important;
  }

  .auth-modern-form .btn-block {
    width: 100% !important;
    min-height: 54px !important;
    margin-top: 2px !important;
    flex: 0 0 auto !important;
  }

  .human-check { line-height: 1.45 !important; }
  .human-check span { overflow-wrap: anywhere; }

  .site-header .container.header-inner { min-width: 0; }
  .brand { min-width: 0; }
  .brand img { max-width: 156px; }
  .header-actions { min-width: 0; }

  .nav.open {
    max-height: calc(100dvh - 76px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .nav-dropdown-menu {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
  }

  .modal {
    padding: 10px !important;
    align-items: flex-end !important;
  }

  .modal-card {
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    overflow-y: auto !important;
    border-radius: 24px 24px 14px 14px !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  }

  .cookie {
    left: 10px !important;
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
  }
}

@media (max-width: 420px) {
  .auth-form-side { padding-left: 14px !important; padding-right: 14px !important; }
  .auth-tabs-modern { width: calc(100% - 50px) !important; margin-right: 50px !important; }
  .account-guest-actions .btn { width: 100%; }
}
