/* Language switcher + right-to-left support (shared by every language). */
.hdr-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border: 1.5px solid var(--ink-200); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink-700); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary svg { width: 16px; height: 16px; flex-shrink: 0; }
.lang-switch summary:hover, .lang-switch[open] summary { border-color: var(--brand-500); color: var(--brand-700); }
.lang-switch ul {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; margin: 0; padding: 6px;
  list-style: none; background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 10px 30px rgba(0,0,0,.12)); min-width: 190px; max-height: 70vh; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.lang-switch li a {
  display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-700); font-size: 13.5px; white-space: nowrap;
}
.lang-switch li a:hover { background: var(--brand-50); color: var(--brand-700); }
.lang-switch li a[aria-current="true"] { font-weight: 700; color: var(--brand-700); background: var(--brand-50); }
.i18n-note {
  background: var(--ink-50); border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  padding: 12px 14px; font-size: 13.5px; color: var(--ink-600); margin: 0 0 20px;
}

@media (max-width: 760px) {
  .hdr-actions .btn { display: none; }
  .lang-switch summary .lang-label { display: none; }
  .lang-switch ul { grid-template-columns: 1fr; }
}

/* Right-to-left (Arabic) */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .prose ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .file-item .remove { margin-left: 0; margin-right: auto; }
[dir="rtl"] .footer-bottom, [dir="rtl"] .crumbs { direction: rtl; }
[dir="rtl"] .pe-preview-wrap, [dir="rtl"] .edit-preview-wrap, [dir="rtl"] .redact-preview-wrap,
[dir="rtl"] canvas, [dir="rtl"] .pe-stage { direction: ltr; }
