/* Avalon Studio — EN / עב toggle + right-to-left layout for Hebrew (i18n.css).
   Everything below except the toggle itself only applies when Hebrew is on (html[dir=rtl]),
   so the English screens look exactly as before. */

/* toggle (same look as the approved mockup) */
.lang-toggle { display: inline-flex; flex: none; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; direction: ltr; }
.lang-toggle button { border: 0; background: transparent; color: #e5e7eb; font: inherit; font-size: .85rem; font-weight: 700; padding: .3rem .7rem; min-height: 34px; min-width: 40px; cursor: pointer; }
.lang-toggle button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.lang-toggle button + button { border-inline-start: 1px solid rgba(255,255,255,.35); }
.lang-toggle button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.topbar .lang-toggle { margin-inline-start: .75rem; margin-block: -4px; }
@media (min-width: 900px) { .topbar .nav { margin-inline-start: auto; } }
/* copy shown on the sign-in screen (the top bar is hidden there) */
.lang-float { position: fixed; z-index: 40; top: calc(.7rem + env(safe-area-inset-top, 0px)); right: .8rem; background: var(--ink); }
html[dir=rtl] .lang-float { right: auto; left: .8rem; }
body:not(.is-login) .lang-float { display: none; }
/* "machine draft" strip, Hebrew only */
.i18n-mt { background: #fdf4dc; color: #7a4b00; border-bottom: 1px solid #f1d58f; font-size: .8rem; font-weight: 600; text-align: center; padding: .3rem .8rem; }

/* Hebrew: fonts */
html[lang=he] body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Arial Hebrew", "Noto Sans Hebrew", Arimo, Helvetica, Arial, sans-serif; }
html[dir=rtl] .brand, html[dir=rtl] .login-brand .brand-name { direction: ltr; }
html[dir=rtl] .brand { align-items: flex-start; }
html[dir=rtl] .brand-name, html[dir=rtl] .brand-sub { unicode-bidi: isolate; }
html[dir=rtl] .tot .tl, html[dir=rtl] th { letter-spacing: 0; }

/* Hebrew: mirror the physical left/right rules in style.css */
html[dir=rtl] th, html[dir=rtl] td { text-align: right; }
html[dir=rtl] .num, html[dir=rtl] .bar-n, html[dir=rtl] .co-amt { text-align: left; }
html[dir=rtl] .timeline { padding: 0 .2rem 0 0; }
html[dir=rtl] .timeline li { padding: 0 1.3rem .9rem 0; border-left: 0; border-right: 2px solid var(--line); }
html[dir=rtl] .timeline li:last-child { border-right-color: transparent; }
html[dir=rtl] .timeline li::before { left: auto; right: -7px; }
html[dir=rtl] details summary::before { content: '◂'; }
html[dir=rtl] details[open] summary::before { content: '▾'; }
html[dir=rtl] .dlg-head { padding: .7rem 1rem .4rem .7rem; }
html[dir=rtl] select { background-position: 13px 50%, 18px 50%; padding-right: .7rem; padding-left: 2rem; }
html[dir=rtl] .item.flag-red { border-left: 0; border-right: 4px solid var(--bad); padding-left: 0; padding-right: .6rem; }

/* Hebrew: phone numbers, emails, money, dates and times stay left-to-right */
html[dir=rtl] input[type=tel], html[dir=rtl] input[type=email], html[dir=rtl] input[type=number],
html[dir=rtl] input[type=date], html[dir=rtl] input[type=time], html[dir=rtl] input[type=password], html[dir=rtl] input[name=username] { direction: ltr; text-align: right; }
html[dir=rtl] .money-in { direction: ltr; }
html[dir=rtl] .money-in input { text-align: right; }
html[dir=rtl] a[href^="tel:"], html[dir=rtl] a[href^="sms:"], html[dir=rtl] a[href^="mailto:"] { unicode-bidi: isolate; direction: ltr; display: inline-block; }
html[dir=rtl] .num, html[dir=rtl] .tv, html[dir=rtl] .co-amt, html[dir=rtl] .count { unicode-bidi: isolate; }
/* typed text (names, addresses, notes) keeps its own direction but lines up on the right */
html[dir=rtl] input[type=text], html[dir=rtl] input[type=search], html[dir=rtl] input:not([type]), html[dir=rtl] textarea { unicode-bidi: plaintext; text-align: right; }
html[dir=rtl] .lead-name, html[dir=rtl] .lead-sum, html[dir=rtl] .pre, html[dir=rtl] .co-desc, html[dir=rtl] .client-head h1,
html[dir=rtl] .kv .v, html[dir=rtl] .lead-meta > span, html[dir=rtl] .row-link .row-title, html[dir=rtl] td a, html[dir=rtl] td .small,
html[dir=rtl] .row-sub:not(:has(.badge, b, span, a)), html[dir=rtl] .history li > div:not(.h-top) { unicode-bidi: plaintext; text-align: right; }
html[dir=rtl] .lead-meta > span { display: inline-block; }
/* sign-in screen: keep the warning strip clear of the floating toggle */
body.is-login .i18n-mt { padding-inline-end: 7rem; text-align: start; }
