/* Shared language control and bidirectional layout. */
.topbar-account {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 18px);
    flex: 0 0 auto;
}

.locale-switch {
    margin: 0;
}

.locale-switch button {
    min-height: 34px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--green);
    cursor: pointer;
}

.locale-switch button:hover {
    background: var(--pale);
}

.login-language {
    display: flex;
    justify-content: flex-end;
    margin-block-end: 14px;
}

html[lang="fa-AF"] body {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    line-height: 1.75;
}

html[lang="fa-AF"] :is(h1, h2, h3, h4, small, legend, th, button, .nav-label, .eyebrow) {
    letter-spacing: normal;
}

html[lang="fa-AF"] .login-card h2 {
    font-family: inherit;
    font-weight: 700;
    line-height: 1.4;
}

html[lang="fa-AF"] :is(.brand-identity, .mobile-login-brand) strong {
    font-family: inherit;
    line-height: 1.55;
}

.quote-translation {
    margin-block: 14px 0;
    color: inherit;
    line-height: 1.9;
}

:is(.sidebar-dropdown-arrow, .role-navigation-arrow, .category-expand span) {
    direction: ltr;
    unicode-bidi: isolate;
}

[dir="rtl"] :is(.sidebar-dropdown-arrow, .role-navigation-arrow, .category-expand span) {
    scale: -1 1;
}

[dir="rtl"] :is(.sidebar-dropdown[open] .sidebar-dropdown-arrow, .category-expand[aria-expanded="true"] span) {
    scale: none;
    transform: rotate(90deg);
}

.sidebar nav {
    scrollbar-width: thin;
    scrollbar-color: #598574 transparent;
}

[dir="rtl"] .topbar .page-heading {
    min-width: 0;
    overflow-wrap: anywhere;
}

:where(input, textarea)[dir="auto"] {
    text-align: start;
}

[dir="rtl"] :is(input, textarea)[dir="auto"]:placeholder-shown {
    direction: rtl;
}

[dir="rtl"] .user-actions-column {
    box-shadow: 10px 0 18px -16px rgba(10, 52, 38, .55);
}

[dir="rtl"] table thead th:first-child {
    border-radius: 0 9px 9px 0;
}

[dir="rtl"] table thead th:last-child {
    border-radius: 9px 0 0 9px;
}

.currency-code, .conversion-preview output, time, .amount-text {
    direction: ltr;
    unicode-bidi: isolate;
}

@media (max-width: 900px) {
    [dir="rtl"] .sidebar:not(.open) {
        transform: translateX(105%);
    }
}

@media (max-width: 480px) {
    .topbar-account .user {
        display: none;
    }
}

@media (max-width: 780px) {
    .login-language {
        margin: 0;
        padding: 12px clamp(18px, 5vw, 28px) 0;
    }
}
