/* Interface direction only; clinical and user-entered text is not translated. */
html[dir=ltr] body {direction:ltr;}
html[dir=ltr] .sidebar {inset:0 auto 0 0;border-left:0;border-right:1px solid var(--line);}
html[dir=ltr] .main {margin-right:0;margin-left:var(--sidebar);}
html[dir=ltr] body.sidebar-collapsed .sidebar {transform:translateX(-110%);}
html[dir=ltr] body.sidebar-collapsed .main {margin-left:0;}
html[dir=ltr] .table th {text-align:left;}
html[dir=ltr] .table td[dir=ltr] {text-align:left!important;}
html[dir=ltr] .timeline {border:0;margin:0;padding-right:0;padding-left:20px;}
html[dir=ltr] .timeline::before {right:auto;left:5px;}
html[dir=ltr] .timeline-dot {right:auto;left:-20px;}
html[dir=ltr] .ai-message.user {margin-right:0;margin-left:auto;}
html[dir=ltr] .ai-message.assistant {margin-left:0;margin-right:auto;}
html[dir=ltr] .detail-page .table td::before {text-align:left;}
.language-switch {display:inline-flex;margin:0;}
.public-language {display:flex;justify-content:flex-end;padding:8px 12px;}
@media(max-width:820px) {
 html[dir=ltr] .main {margin-left:0;}
 html[dir=ltr] .sidebar {transform:translateX(-105%);}
 html[dir=ltr] body.sidebar-open .sidebar {transform:translateX(0);}
 .language-switch .btn {min-height:44px;}
}
@media print {.language-switch,.public-language {display:none!important;}}

/* The assistant follows the interface direction and stays opposite the sidebar. */
html[dir=ltr] .ai-widget-root {left:auto;right:24px;direction:ltr;}
html[dir=ltr] .ai-fab {padding:9px 18px 9px 12px;}
html[dir=ltr] .ai-widget {left:auto;right:0;transform-origin:bottom right;}
html[dir=ltr] .ai-widget-header,
html[dir=ltr] .ai-widget-compose,
html[dir=ltr] .ai-widget-compose textarea {direction:ltr;text-align:start;}
html[dir=ltr] .ai-widget-message.user {justify-content:flex-end;}
html[dir=ltr] .ai-widget-message.assistant {justify-content:flex-start;}
html[dir=ltr] .ai-widget-message.user .ai-widget-bubble {border-bottom-left-radius:18px;border-bottom-right-radius:6px;}
html[dir=ltr] .ai-widget-message.assistant .ai-widget-bubble {border-bottom-left-radius:6px;border-bottom-right-radius:18px;}
html[dir=ltr] .ai-widget-typing em {margin-right:0;margin-left:5px;}
@media(max-width:520px) {
 html[dir=ltr] .ai-widget-root {right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));}
 html[dir=ltr] .ai-fab {padding:9px;}
 html[dir=ltr] .ai-widget-root.is-open {inset:0;}
}
