/* Hebrew / RTL shell layout — viewer app */
html[lang="he"] {
  direction: rtl;
}

/* Header uses physical LTR flex so title stays right, menu stays left */
html[lang="he"] .app-header {
  direction: ltr;
}

html[lang="he"] .menu-toggle {
  order: 1;
}

html[lang="he"] .lang-toggle {
  order: 2;
  margin-left: 0;
  margin-inline-start: 0;
}

html[lang="he"] .tabs {
  order: 3;
  direction: rtl;
}

html[lang="he"] .app-title {
  order: 4;
  margin-left: auto;
  margin-right: 0;
  text-align: right;
}

html[lang="he"] .toolbar-drawer {
  left: 12px;
  right: auto;
}

html[lang="he"] .toolbar-drawer-inner {
  text-align: right;
  direction: rtl;
}

html[lang="he"] .panel-toolbar {
  direction: rtl;
}

html[lang="he"] .status-text {
  margin-inline-start: 0;
  margin-inline-end: auto;
}

html[lang="he"] .toolbar-drawer label,
html[lang="he"] .toolbar-drawer .drawer-actions {
  direction: rtl;
}

html[lang="he"] .days-table th,
html[lang="he"] .days-table td {
  text-align: right;
}
/* Generated preview pages (iframe) — RTL content */
body[dir="rtl"] {
  text-align: right;
}

body[dir="rtl"] .schedule th,
body[dir="rtl"] .schedule td {
  text-align: right;
}

body[dir="rtl"] .page-shell {
  flex-direction: row-reverse;
}

body[dir="rtl"] .side-link {
  border-left: none;
  border-right: 3px solid transparent;
}

body[dir="rtl"] .side-link.active {
  border-right-color: var(--accent);
}

body[dir="rtl"] .side-link.today.active {
  border-right-color: #c41e3a;
}

body[dir="rtl"] .toc {
  margin: 0 24px 16px 0;
}

body[dir="rtl"] .toc-item {
  flex-direction: row-reverse;
}

body[dir="rtl"] .day-navigate {
  text-align: right;
}

body[dir="rtl"] .nav-route-item,
body[dir="rtl"] .nav-stop-item {
  flex-direction: row-reverse;
}

/* Top bar: refresh icon is first in DOM → sits on the right in RTL; days scroll in the middle. */

.latin {
  direction: ltr;
  unicode-bidi: embed;
}
