/* Keep the spatial workbench, XYZ controls and preview canvas in their existing
   physical positions. Arabic text surfaces read RTL; values retain LTR order. */
html[dir="rtl"] body { direction: ltr; }
html[dir="rtl"] :is(#leftPanel,#rightMini,#statusPanel,#sequencePanel,#settingsMenu,.modal,[role="dialog"],.hintBubble,.featureHelpPopover,.lvc-selection-backdrop,.calculator-entry-pending,.toast) {
  direction: rtl;
  text-align: start;
}
html[dir="rtl"] :is(input[type="number"],input[type="email"],input[type="url"],input[type="tel"],input[type="range"],canvas,.headerLanguagePicker,.languagePicker,.introLanguagePicker) {
  direction: ltr;
  unicode-bidi: isolate;
}
html[lang^="ar"] :is(button,label,p,span,small,h1,h2,h3) { letter-spacing: normal; }
/* These rows encode physical XYZ/order and fixed help-button positions, not
   reading order. Keep their layout while Arabic copy remains right-to-left. */
html:lang(ar) :is(.accHead,#rightMini .miniBtns,.selCard .grid3,.quickPlacementSection,.quickPlacementNumberRow,.quickPlacementSelectRow,.optionsNumberSliderRow,.sequenceStepControlsRow) { direction: ltr; }
html:lang(ar) :is(.accHead .accLabel,.selCard .grid3 label,.quickPlacementSection > b span,.quickPlacementToggleRow,.quickPlacementNumberRow > span,.quickPlacementSelectRow > span,.optionsNumberSliderRow > label,.sequenceStepControlsRow button) { direction: rtl; text-align: right; }
html:lang(ar) :is(#selWidth,#selDepth,#selHeight) { direction: ltr; unicode-bidi: isolate; }
html:lang(ar) .accHead.hasFeatureHelp:not(:has(> .accBetaBadge)) { display: grid; grid-template-columns: 15px minmax(0,1fr) 14px auto; }
html:lang(ar) .accHead.hasFeatureHelp:not(:has(> .accBetaBadge)) > .featureHelpButton { position: relative; right: auto; top: auto; transform: none; grid-column: 3; grid-row: 1; }
html:lang(ar) .accHead.hasFeatureHelp:not(:has(> .accBetaBadge)) > .accChevron { grid-column: 4; grid-row: 1; }
html:lang(ar) :is(.optionsHeader,.optionsHeaderActions,.dialogWindowRail,.uiDialogActions,.modal .footer,#__uiDlg .modal > div:has(> #__uiDlgTitle)) { direction: ltr; }
html:lang(ar) :is(.optionsHeader h3,.optionsHeaderActions button,.dialogWindowRail h3,#__uiDlgTitle,.uiDialogActions button,.modal .footer button,.optionsSliderRange,.quickPlacementNumberRow > small) { direction: rtl; text-align: right; }
