/* English layout follows the same components and spacing as the Persian UI. */
html:is([lang=en],[lang=ru]){direction:ltr}
html:is([lang=en],[lang=ru]) body,html:is([lang=en],[lang=ru]) body[data-page]{direction:ltr!important;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif!important}
html:is([lang=en],[lang=ru]) [dir=rtl]{direction:ltr!important}
html:is([lang=en],[lang=ru]) body :is(main,section,article,header,footer,nav,dialog,form,fieldset,details,ul,ol,label,.ar-shell,.ar-menu-heading,.dm-app-menu-user,.dm-app-menu-subscription-row,.library-shell,.library-tabs,.library-grid,.library-history-grid,.sub-shell,.sub-plan-name,.mr,.mr-wrap){direction:ltr!important}
html:is([lang=en],[lang=ru]) :is(.ar-row,.ar-field,.ar-input,.sub-discount input,.sub-summary dt,.sub-plan-name,.dm-app-menu-row,.library-tabs>button){font-family:inherit!important;text-align:start!important}
html:is([lang=en],[lang=ru]) :is(.library-tabs>button,.dl-library-tabs>a){text-align:center!important}
html:is([lang=en],[lang=ru]) :is(.dm-app-menu-row,.dm-app-menu-user,.dm-app-menu-subscription-row){text-align:left!important}
html:is([lang=en],[lang=ru]) .dm-app-menu-chevron{margin-left:auto!important;margin-right:0!important;transform:rotate(180deg)}
html:is([lang=en],[lang=ru]) .dm-app-menu-account{direction:ltr!important}
html:is([lang=en],[lang=ru]) .dm-app-menu-nav{direction:ltr!important}
html:is([lang=en],[lang=ru]) .ar-menu-heading{padding-left:34px}
html:is([lang=en],[lang=ru]) #ar-menu-logout{align-self:flex-start;font-family:inherit!important}
html:is([lang=en],[lang=ru]) :is(.ar-header,.sub-head)>a{order:-1}
html:is([lang=en],[lang=ru]) :is(.ar-header,.sub-head)>h1{margin-right:auto;margin-left:14px;text-align:left}
html:is([lang=en],[lang=ru]) :is(.text-right,.md\:text-right){text-align:left!important}
html:is([lang=en],[lang=ru]) .text-left{text-align:left}
html:is([lang=en],[lang=ru]) .ar-password-wrap input{padding-left:12px;padding-right:38px}
html:is([lang=en],[lang=ru]) .ar-password-wrap button{left:auto;right:10px}
html:is([lang=en],[lang=ru]) :is(.library-header,.library-header-actions,#dm-app-bottom-nav){direction:ltr!important}
html:is([lang=en],[lang=ru]) :is(.sub-prices,.sub-summary dd,.dm-menu-latin){direction:ltr!important}
html:is([lang=en],[lang=ru]) :is(.sub-plan,.dm-app-menu-row){gap:12px}
html:is([lang=en],[lang=ru]) :is(.sub-plan-name,.dm-app-menu-row){white-space:normal}
html:is([lang=en],[lang=ru]) :is(.sub-head h1,.ar-header h1){line-height:1.5}
html:is([lang=en],[lang=ru]) :is(.dm-app-menu-footer,.dl-empty,.library-empty){text-align:center!important}
html:is([lang=en],[lang=ru]) :is(#diastomy-native-subtitle-overlay,#diastomy-subtitle-overlay,.dm-subtitle-line){direction:rtl!important;unicode-bidi:plaintext;font-family:'DM Movie Arabic',Tahoma,sans-serif!important}
html:is([lang=en],[lang=ru]) [data-i18n-ignore]{unicode-bidi:plaintext}
@media(max-width:420px){html:is([lang=en],[lang=ru]) .library-tabs>button{font-size:12px!important}html:is([lang=en],[lang=ru]) .dm-app-menu-row{font-size:12px!important}}

html:is([lang=en],[lang=ru]) .sub-prices small{margin-left:4px;margin-right:0}
html:is([lang=en],[lang=ru]) .ar-row>span:last-child:not(:first-child){font-family:Arial,sans-serif!important;font-size:18px;transform:scaleX(-1)}

/* Component-level RTL rules must also follow the interface language. */
html:is([lang=en],[lang=ru]) #dm-app-menu .dm-app-menu-row{direction:ltr!important;flex-direction:row!important;justify-content:flex-start!important;text-align:left!important}
html:is([lang=en],[lang=ru]) #dm-app-menu .dm-app-menu-row>svg{order:0;flex:none}
html:is([lang=en],[lang=ru]) #dm-app-menu .dm-app-menu-row>span:not(.dm-app-menu-chevron){order:1;text-align:left!important}
html:is([lang=en],[lang=ru]) #dm-app-menu .dm-app-menu-chevron{order:2;margin-left:auto!important;margin-right:0!important;transform:rotate(180deg)}
html:is([lang=en],[lang=ru]) body[data-page=home] :is(.dm54-head,.dm54-vtrack,.dm54-htrack,.dm54-genre-track),
html:is([lang=en],[lang=ru]).dmf3-active body[data-page=home] .dmf3-root .dm54-head,
html:is([lang=en],[lang=ru]).dmf3-active body[data-page=home] .dmf3-root .dm54-genres .dm54-head,
html:is([lang=en],[lang=ru]).dmf3-active body[data-page=home] .dmf3-root .dm54-section :is(.dm54-vtrack,.dm54-htrack),
html:is([lang=en],[lang=ru]).dmf3-active body[data-page=home] .dmf3-root .dm54-genres .dm54-genre-track{direction:ltr!important;flex-direction:row!important}
html:is([lang=en],[lang=ru]) body[data-page=home] .dm54-head h2{text-align:left!important}
html:is([lang=en],[lang=ru]) body[data-page=home] .dm54-head>h2{order:0!important}
html:is([lang=en],[lang=ru]) body[data-page=home] .dm54-head>a{order:1!important}

/* Arabic keeps the established RTL component layout. */
html[lang=ar]{direction:rtl}
html[lang=ar] body,html[lang=ar] body[data-page]{direction:rtl!important;font-family:'DM Movie Arabic',Tahoma,Arial,sans-serif!important}
html[lang=ar] :is(.ar-input,.ar-row,.sub-discount input,.dm-app-menu-row){font-family:inherit!important}
html[lang=ar] :is(.sub-head h1,.ar-header h1){line-height:1.65}
html[lang=ar] .dm-app-menu-row{white-space:normal!important;line-height:1.6}
html[lang=ar] :is(.dm-app-menu-footer,.dl-hint,.ar-note){line-height:1.9}
html[lang=ar] :is(.dm-menu-latin,.dl-amount){font-family:Arial,sans-serif!important;direction:ltr}
