/* V243 — Arabic direction model cleanup.
   Arabic documents remain semantically RTL. Only technical/application UI and
   Latin/numeric tokens are isolated as LTR. Site shell geometry is preserved
   where mirroring would make the product UI look horizontally flipped. */

html[lang="ar"],
html[lang="ar"] body.lang-ar{
  direction:rtl!important;
}

/* General Arabic prose */
html[lang="ar"] :where(
  main,.page-hero,.policy-wrap,.policy-layout,.policy-card,.policy-intro,.policy-section,
  .contact-section,.contact-card,.review-card,.guide-shell
){
  direction:rtl!important;
}
html[lang="ar"] :where(
  h1,h2,h3,h4,h5,h6,p,li,dt,dd,legend,label,.eyebrow,
  .footer-saas-heading,.policy-card,.policy-card *,.legal-copy,.rtl-copy,.rtl-ui-label
){
  unicode-bidi:plaintext;
}
html[lang="ar"] :where(.page-hero,.policy-card,.policy-intro,.policy-section,.contact-card,.review-card){
  text-align:right;
}

/* Keep global header/footer geometry consistent with every other locale.
   Arabic text inside them still reads RTL. */
html[lang="ar"] :where(
  header.nav > .wrap.navin,header.nav .wrap.navin,.subpage-nav > .wrap.navin,
  .subpage-nav .wrap.navin,.clinic-navin,.footer.footer-saas,
  .footer-saas-top,.footer-saas-bottom
){
  direction:ltr!important;
}
html[lang="ar"] :where(.brand,.footbrand,.skiinobs-brand-lock,.tech-ltr,[dir="ltr"]){
  direction:ltr!important;
  unicode-bidi:isolate!important;
}
html[lang="ar"] .nav-actions{
  direction:ltr!important;
}
html[lang="ar"] .back-link{
  display:inline-flex!important;
  align-items:center!important;
  gap:.4em!important;
  direction:ltr!important;
  unicode-bidi:isolate!important;
}
html[lang="ar"] .back-link > span{
  direction:rtl!important;
  unicode-bidi:isolate!important;
}

/* Language selector: each language name keeps its own writing direction. */
html[lang="ar"] :is(.langmenu,.lang-menu){
  direction:ltr!important;
}
html[lang="ar"] :is(.langmenu,.lang-menu) a{
  direction:ltr!important;
  unicode-bidi:isolate!important;
  text-align:left!important;
}
html[lang="ar"] :is(.langmenu,.lang-menu) a[lang="ar"]{
  direction:rtl!important;
  text-align:right!important;
}

/* Homepage workflow is a process diagram; never mirror camera → app → OBS. */
html[lang="ar"] .hero-experience :where(.native-workflow,.native-workflow-row,.native-workflow-chain){
  direction:ltr!important;
}
html[lang="ar"] .hero-experience :where(.native-workflow-label,.native-workflow-chain > span){
  direction:rtl!important;
  unicode-bidi:plaintext!important;
  text-align:center!important;
}
html[lang="ar"] .hero-experience .native-workflow-chain > b{
  direction:ltr!important;
  unicode-bidi:isolate!important;
  transform:none!important;
}

/* Product preview: application chrome/control placement remains LTR.
   Only Arabic labels inside the preview are RTL. */
html[lang="ar"] .hero-experience .skiin-preview,
html[lang="ar"] .hero-experience .skiin-preview :where(
  .skdemo-preview-body,.skdemo-workspace-tools,.skdemo-camera-control,.skdemo-preset-control,
  .skdemo-preset-actions,.skdemo-tabs,.skdemo-tab-content,.skdemo-slider-row,
  .skdemo-slider-track-wrap,.skdemo-slider-track,.skdemo-slider-fill,.skdemo-slider-thumb,
  .skdemo-slider-value,.skdemo-toggle-row,.skdemo-switch,.skdemo-switch-track,.skdemo-more-grid
){
  direction:ltr!important;
}
html[lang="ar"] .hero-experience .skiin-preview :where(
  .skdemo-tool-label,.skdemo-preset-chip,.skdemo-tab-hint,.skdemo-tab,
  .skdemo-slider-label,.skdemo-switch-state,.skdemo-more-item > span:last-child
){
  direction:rtl!important;
  unicode-bidi:plaintext!important;
}
html[lang="ar"] .hero-experience .skiin-preview :where(.skdemo-slider-value,input[type="number"]){
  direction:ltr!important;
  unicode-bidi:isolate!important;
  text-align:center!important;
}
html[lang="ar"] .hero-experience .skiin-preview select{
  direction:rtl!important;
  text-align:right!important;
}

/* Prices, technical labels, acronyms, versions and Latin product names. */
html[lang="ar"] :where(
  .tech-ltr,.tech-ltr-block,.price,.email,.phone,.version,
  code,kbd,samp,input[type="email"],input[type="tel"]
){
  direction:ltr!important;
  unicode-bidi:isolate!important;
}

/* FAQ and CTA controls keep the same physical icon/arrow placement. */
html[lang="ar"] .hero-experience #faq .faq summary,
html[lang="ar"] .jp-doctor-cta a{
  direction:ltr!important;
}
html[lang="ar"] .hero-experience #faq .faq summary > .rtl-ui-label,
html[lang="ar"] .jp-doctor-cta .rtl-ui-label{
  direction:rtl!important;
  unicode-bidi:plaintext!important;
}
html[lang="ar"] .jp-doctor-cta [aria-hidden="true"],
html[lang="ar"] .hero-experience #faq .faq summary:after{
  direction:ltr!important;
  transform:none!important;
}

/* Contact: Arabic form reads RTL, but phone/email values and country codes are LTR. */
html[lang="ar"] .contact-card :where(.form-grid,.phone-grid,.choice-grid),
html[lang="ar"] .review-actions{
  direction:rtl!important;
}
html[lang="ar"] .contact-card :where(input[type="text"],textarea,select){
  direction:rtl!important;
  text-align:right!important;
}
html[lang="ar"] .contact-card :where(input[type="email"],input[type="tel"]){
  direction:ltr!important;
  unicode-bidi:isolate!important;
  text-align:left!important;
}
html[lang="ar"] .contact-card select[name="countryCode"]{
  direction:ltr!important;
  unicode-bidi:isolate!important;
  text-align:left!important;
}
html[lang="ar"] .contact-card select[name="countryCode"] option{
  direction:rtl;
}
html[lang="ar"] .contact-card :where(.choice,.privacy-check){
  direction:rtl!important;
}
html[lang="ar"] #reviewList dd[data-review-field="country"],
html[lang="ar"] #reviewList dd[data-review-field="phone"],
html[lang="ar"] #reviewList dd[data-review-field="email"]{
  direction:ltr!important;
  unicode-bidi:isolate!important;
  text-align:left!important;
}

/* Legal/footer subpages: lists and paragraphs are true RTL, without flipping the card shell. */
html[lang="ar"] .policy-card :where(ul,ol){
  direction:rtl!important;
  padding-right:1.4em!important;
  padding-left:0!important;
}
html[lang="ar"] .policy-card :where(li,p,h2,h3){
  text-align:right!important;
}

/* Footer: physical column order stays consistent; Arabic labels themselves are RTL. */
html[lang="ar"] .footer-saas-brand,
html[lang="ar"] .footer.footer-saas .footbrand{
  direction:ltr!important;
  text-align:left!important;
}
html[lang="ar"] .footer-saas-column{
  direction:rtl!important;
  text-align:right!important;
}
html[lang="ar"] .footer-saas-column :where(.footer-saas-heading,a){
  direction:rtl!important;
  unicode-bidi:plaintext!important;
  text-align:right!important;
}
html[lang="ar"] .footer-saas-bottom .legal-copy{
  direction:rtl!important;
  unicode-bidi:plaintext!important;
}

/* OBS Doctor: grids stay physically stable while Arabic copy is RTL. */
html[lang="ar"] body.clinic-page{
  direction:rtl!important;
}
html[lang="ar"] .clinic-page :where(.clinic-wrap,.clinic-map,.clinic-support-compact,.clinic-support-actions,.clinic-tags){
  direction:ltr!important;
}
html[lang="ar"] .clinic-page :where(
  .clinic-head,.clinic-support-context,.clinic-category,.clinic-category-top,
  .clinic-title-group,.clinic-support-trust,.clinic-creator-note,.clinic-catalog-copy
){
  direction:rtl!important;
}
html[lang="ar"] .clinic-page :where(h1,h2,h3,p){
  text-align:right!important;
  unicode-bidi:plaintext!important;
}

/* Modal chrome remains stable; message copy is Arabic RTL. */
html[lang="ar"] .site-modal .modal-dialog{
  direction:ltr!important;
}
html[lang="ar"] .site-modal .modal-dialog :where(h2,p,.btn){
  direction:rtl!important;
  unicode-bidi:plaintext!important;
}

@media(max-width:640px){
  html[lang="ar"] .footer-saas-column :where(.footer-saas-heading,a){
    text-align:right!important;
  }
}
