/* iTeachPlus V4.42.0: physical layout mirroring for the entire shared shell. */
:root[lang="fa"]{direction:rtl}
:root[lang="fa"] body{direction:rtl;text-align:right}
:root[lang="en"]{direction:ltr}
:root[lang="en"] body{direction:ltr;text-align:left;font-family:Inter,"Public Sans",Arial,sans-serif}
:root[lang="en"] :is(h1,h2,h3,h4,h5,h6,p,li,label,legend,summary,th,td,caption,blockquote){direction:ltr;text-align:left}
:root[lang="en"] :is(input,textarea,select){direction:ltr;text-align:left}
:root[lang="en"] :is(.container,.section-head,.panel-v4,.panel,.teacher-v4,.course-card,.course-body,.hero-copy,.hero-main-v48,.hero-search,.pb4396-hero-copy,.dash-main,.dashboard-shell,.sidebar,.side-nav,.main-nav,.site-header,.account-dropdown-v43988,.feature-v4,.form-grid,.field,.teacher-hero-copy,.teacher-profile-content,.modal,.modal-content){direction:ltr}
:root[lang="en"] :is(.hero-copy,.hero-main-v48,.hero-search,.pb4396-hero-copy,.teacher-hero-copy,.dash-main,.sidebar,.side-nav,.account-dropdown-v43988,.form-grid,.field){text-align:left}
/* Shared floating panels and icon direction in English. */
:root[lang="en"] .account-dropdown-v43988{left:auto;right:0}
:root[lang="en"] .sidebar{left:0;right:auto}
:root[lang="en"] .dash-main{margin-inline-start:auto}
:root[lang="en"] .admin-mobile-toolbar-v4264{direction:ltr}
:root[lang="en"] .admin-menu-trigger-v4264{flex-direction:row}
:root[lang="en"] :is(.data-table,.table-wrap){direction:ltr}
:root[lang="en"] :is(.search-form,.hero-search-v48,.hero-actions-v48,.teacher-actions,.proof-strip,.meta-row){direction:ltr}
:root[lang="en"] :is(.hero-actions-v48,.teacher-actions,.pb4396-actions){justify-content:flex-start}
:root[lang="en"] :is(.stars,.rating-mini,[class*="score"],[class*="price"]){unicode-bidi:isolate}
/* Preserve intentional centered labels, badges and buttons. */
:root[lang="en"] :is(button,.btn,.btn-v4,.badge,.match-pill,.round-add,.section-head .eyebrow-v4,.hero-search-v48 button){text-align:center}
:root[lang="en"] :is([dir="rtl"]):not(input):not(textarea){direction:ltr}
:root[lang="en"] :is([dir="rtl"]):not(input):not(textarea) :is(h1,h2,h3,h4,p,label,span){text-align:left}
:root[lang="en"] :is(input[type="tel"],input[type="email"],input[type="url"],input[type="number"]){direction:ltr;text-align:left}
:root[lang="fa"] :is(input[type="email"],input[type="url"]){direction:ltr;text-align:left}
/* Language control is always accessible on desktop and mobile; no JS dependency. */
.itp-lang-toggle-v4420{display:inline-flex;direction:ltr;align-items:center;gap:2px;flex:none;padding:3px;border-radius:999px;border:1px solid rgba(56,93,113,.22);background:rgba(255,255,255,.91);white-space:nowrap}
.itp-lang-toggle-v4420 a{color:#25465c;min-width:34px;min-height:34px;display:inline-flex;justify-content:center;align-items:center;text-decoration:none;font-weight:800;font-size:12px;border-radius:999px;line-height:1}
.itp-lang-toggle-v4420 a[aria-current="true"]{background:#23617e;color:#fff}
.itp-lang-toggle-v4420 a:focus-visible{outline:3px solid #e89c73;outline-offset:2px}
@media(max-width:600px){.itp-lang-toggle-v4420{padding:2px}.itp-lang-toggle-v4420 a{min-width:32px;min-height:32px;font-size:11px}.nav-actions{gap:5px}}
/* LTR admin direction and responsive drawer must not cover content. */
@media(min-width:1025px){:root[lang="en"] .dashboard-shell .sidebar{left:0;right:auto}:root[lang="en"] .dashboard-shell .dash-main{margin-left:auto;margin-right:0}}
@media(max-width:1024px){:root[lang="en"] .admin-drawer-backdrop-v4264{direction:ltr}}
/* Older inline RTL instructions in security / admin modules. */
:root[lang="en"] [style*="direction:rtl"],
:root[lang="en"] [style*="direction: rtl"]{direction:ltr!important}
:root[lang="en"] [style*="text-align:right"],
:root[lang="en"] [style*="text-align: right"]{text-align:left!important}
:root[lang="en"] [dir="rtl"]{direction:ltr!important}
/* Language-natural start/end alignment while keeping search controls tappable. */
:root[lang="en"] :is(.main-nav,.account-menu-v43988,.bottom-nav,.footer-grid,.catalog-filter-row,.teacher-grid-v4,.feature-grid-v4){direction:ltr}
:root[lang="en"] :is(.footer,.footer-grid,.footer-bottom,.pb4396-breadcrumb){text-align:left}
