/* OpenCode Studio — RTL + Arabic fixes (override layer, no rebuild) */

/* 1) Arabic-first font stack (Inter keeps Latin, Plex renders Arabic) */
html, body, #root {
  font-family: "IBM Plex Sans Arabic", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* 2) Isolate mixed-direction fragments so Latin/numbers don't jump around */
.truncate { unicode-bidi: isolate; }
.card td, .card th { unicode-bidi: isolate; }
.rounded-lg.bg-cream-100 { unicode-bidi: isolate; }

/* 3) Code, paths, URLs, IDs: always LTR */
code, kbd, samp, pre,
.font-mono,
.md pre, .md pre code {
  direction: ltr;
  unicode-bidi: isolate;
}
.md pre, .font-mono { text-align: left; }
.md code { unicode-bidi: isolate; } /* inline code follows surrounding text */

/* 4) Markdown (react-markdown) RTL */
.md ul, .md ol { padding-left: 0; padding-right: 1.5rem; }
.md blockquote {
  border-left-width: 0;
  border-right-width: 2px;
  padding-left: 0;
  padding-right: .75rem;
}
.md th, .md td { text-align: right; }

/* 5) Chat: user bubble text follows reading direction (was forced text-left) */
.text-left { text-align: start; }

/* 6) Inputs: align to reading start, auto-direction for mixed content */
.field { text-align: start; }
input.field, textarea.field { unicode-bidi: plaintext; }

/* 7) Numbers in stats: tabular, isolated */
.card { font-variant-numeric: tabular-nums; }

/* 8) API hint lines (GET /api/...) */
.text-xs.text-ink-400 { unicode-bidi: isolate; }

/* 9) Settings floating button */
.oc-settings-fab {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background: #d97757;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(38, 36, 31, .25);
}
.oc-settings-fab:hover { background: #c4623f; }
