Rtl on amp


In order to make my Unbounce pages rtl for hebrew, I make a Java script with the code:

<html dir="rtl" lang="he">

I have just finished to build my first AMP page and put the same code on the Java script area.
the result was this:

The rtl transition worked, but the some of the text along the page shifted to the left (randomly)

Do I need to use different code for AMP?