/* Dreams Insights AI — Front-end RTL overrides */
.diai-rtl,
html[dir="rtl"] .diai-container{
  direction:rtl;
  text-align:right;
}

.diai-rtl .diai-field,
html[dir="rtl"] .diai-field{
  text-align:right;
}

.diai-rtl .diai-field label,
html[dir="rtl"] .diai-field label{
  text-align:right;
  display:block;
}

.diai-rtl .diai-field textarea,
html[dir="rtl"] .diai-field textarea{
  text-align:start;
  unicode-bidi:plaintext;
  padding-right:16px;
  padding-left:16px;
  padding-bottom:76px;
}

.diai-rtl .diai-word-counter,
html[dir="rtl"] .diai-word-counter{
  left:16px!important;
  right:auto!important;
  text-align:left!important;
}

.diai-rtl .diai-acc-toggle,
html[dir="rtl"] .diai-acc-toggle{
  text-align:right;
  flex-direction:row-reverse;
}

.diai-rtl .diai-acc-toggle::after,
html[dir="rtl"] .diai-acc-toggle::after{
  margin-right:auto;
  margin-left:0;
}

.diai-rtl .diai-acc-panel,
html[dir="rtl"] .diai-acc-panel{
  text-align:right;
}

.diai-rtl .diai-symbols,
.diai-rtl .diai-actions,
html[dir="rtl"] .diai-symbols,
html[dir="rtl"] .diai-actions{
  padding-right:1.2em;
  padding-left:0;
}

.diai-rtl #sendCopy .row,
html[dir="rtl"] #sendCopy .row{
  direction:rtl;
}

.diai-rtl #sendCopy input[type="text"],
.diai-rtl #sendCopy input[type="email"],
html[dir="rtl"] #sendCopy input[type="text"],
html[dir="rtl"] #sendCopy input[type="email"]{
  direction:rtl;
  text-align:right;
}

.diai-rtl .diai-checkline,
html[dir="rtl"] .diai-checkline{
  direction:rtl;
  flex-direction:row;
  justify-content:flex-start;
}

.diai-rtl .diai-reset-wrap,
html[dir="rtl"] .diai-reset-wrap{
  text-align:center;
}

.diai-rtl .diai-notice,
html[dir="rtl"] .diai-notice{
  direction:rtl;
  text-align:right;
}

.diai-rtl .diai-line,
html[dir="rtl"] .diai-line{
  direction:rtl;
}

/* Speech-to-text RTL adjustments */
.diai-rtl .diai-textarea-wrap .diai-speech-btn,
html[dir="rtl"] .diai-textarea-wrap .diai-speech-btn{
  right:18px;
  left:auto;
}
.diai-rtl .diai-speech-status,
html[dir="rtl"] .diai-speech-status{
  text-align:center;
}
@media (max-width:760px){
  .diai-rtl .diai-textarea-wrap .diai-speech-btn,
  html[dir="rtl"] .diai-textarea-wrap .diai-speech-btn{right:14px;left:auto;}
}

.diai-rtl #diai_dream{text-align:start;unicode-bidi:plaintext;}

/* v1.4.8 — stricter RTL alignment */
.diai-rtl .diai-acc-toggle,
html[dir="rtl"] .diai-acc-toggle{
  direction:rtl;
  text-align:right!important;
  flex-direction:row!important;
}
.diai-rtl .diai-acc-toggle::after,
html[dir="rtl"] .diai-acc-toggle::after{
  margin-right:auto!important;
  margin-left:0!important;
}
.diai-rtl .diai-acc-panel .diai-sub,
.diai-rtl .diai-acc-panel h4,
html[dir="rtl"] .diai-acc-panel .diai-sub,
html[dir="rtl"] .diai-acc-panel h4{
  direction:rtl;
  text-align:right!important;
}

.diai-rtl .diai-related-symbols,
.diai-rtl .diai-related-symbols *{
  text-align:right;
}
.diai-rtl .diai-related-card{
  direction:rtl;
}

/* v1.5.3 — RTL placeholder and form alignment refinements */
.diai-rtl .diai-form,
html[dir="rtl"] .diai-form{
  margin-left:auto;
  margin-right:auto;
}
.diai-rtl .diai-field textarea,
html[dir="rtl"] .diai-field textarea{
  direction:rtl;
  text-align:right;
}
.diai-rtl .diai-field textarea::placeholder,
html[dir="rtl"] .diai-field textarea::placeholder{
  direction:rtl;
  text-align:right;
}
.diai-rtl .diai-acc-toggle::after,
html[dir="rtl"] .diai-acc-toggle::after{
  display:none!important;
  content:none!important;
}
.diai-rtl .diai-acc-toggle,
html[dir="rtl"] .diai-acc-toggle{
  pointer-events:none;
}

/* v1.5.7 — RTL email layout refinements */
.diai-rtl #sendCopy .row,
html[dir="rtl"] #sendCopy .row{
  direction:rtl;
  grid-template-columns:1fr 1fr!important;
}
.diai-rtl #sendCopy .diai-email-actions,
html[dir="rtl"] #sendCopy .diai-email-actions{
  justify-content:center;
}
.diai-rtl .diai-reset-wrap,
html[dir="rtl"] .diai-reset-wrap{
  text-align:center;
}
@media (max-width:900px){
  .diai-rtl #sendCopy .row,
  html[dir="rtl"] #sendCopy .row{grid-template-columns:1fr!important;}
}

/* v1.6.3 — keep counter fragments in correct order on RTL sites */
.diai-rtl .diai-prompt-tools .diai-word-counter,
html[dir="rtl"] .diai-prompt-tools .diai-word-counter{
  direction:ltr!important;
  unicode-bidi:isolate!important;
  text-align:left!important;
}
.diai-rtl .diai-word-counter .diai-count-part,
html[dir="rtl"] .diai-word-counter .diai-count-part{
  direction:ltr!important;
  unicode-bidi:isolate!important;
}
