:root {
    --kufi: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
    scrollbar-color: #6852c7 #101116;
    scrollbar-width: thin;
}

html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select {
    font-family: var(--kufi);
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: #0e0f14; }
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7860e7, #4d3d94);
    border: 2px solid #0e0f14;
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #947cff, #6852c7); }
*::-webkit-scrollbar-corner { background: #0e0f14; }

.language-switch {
    min-width: 70px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 999px;
    background: rgba(255,255,255,.045);
    color: #6f707a;
    font: 700 9px/1 Arial, sans-serif;
    cursor: pointer;
    transition: .2s ease;
}
.language-switch:hover { border-color: rgba(151,125,255,.55); background: rgba(124,92,239,.09); }
.language-switch i { width: 1px; height: 12px; background: rgba(255,255,255,.12); }
.language-switch .lang-active { color: #c4b7ff; }
.editor-language {
    min-width: 78px;
    height: 36px;
    gap: 10px;
    padding-inline: 10px;
    font-size: 11px;
}
.editor-language i { height: 15px; }

.editor-brand-lockup {
    padding-inline: 14px;
    border-inline: 0;
}
.editor-brand-lockup img {
    display: block;
    width: 148px;
    height: auto;
}

a.avatar {
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    contain: paint;
    clip-path: circle(50%);
    isolation: isolate;
    color: inherit;
    text-decoration: none;
}
a.avatar > span,
a.avatar > img {
    grid-area: 1 / 1;
}
a.avatar > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
    z-index: 1;
}
a.avatar.has-image {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #5b45a0, #211a38);
    clip-path: none;
    contain: none;
    box-shadow: 0 0 0 1px rgba(170, 145, 255, .48), 0 4px 12px rgba(0, 0, 0, .28);
}
a.avatar.has-image > img {
    inset: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: 6px;
}

html[dir="ltr"] .tool-rail,
html[dir="ltr"] .library-panel,
html[dir="ltr"] .stage-area,
html[dir="ltr"] .inspector-panel,
html[dir="ltr"] .timeline,
html[dir="ltr"] .format-select,
html[dir="ltr"] .search-box,
html[dir="ltr"] .canvas-copy,
html[dir="ltr"] .track-labels,
html[dir="ltr"] .export-dialog { direction: ltr; }

html[dir="ltr"] .canvas-copy { align-items: flex-start; }
html[dir="ltr"] .project-title span { padding-right: 0; padding-left: 4px; }
html[dir="ltr"] .media-card { text-align: left; }

.video-canvas.ratio-square {
    width: auto;
    height: min(82%, 470px);
    max-width: 72%;
    aspect-ratio: 1 / 1;
}

.video-canvas.ratio-wide {
    width: min(78%, 760px);
    height: auto;
    max-width: 78%;
    aspect-ratio: 16 / 9;
}

@media (max-width: 800px) {
    .editor-language { display: none; }
    .editor-brand-lockup { padding: 0; }
    .editor-brand-lockup img {
        width: 34px;
        content: url("../brand/medbaa-symbol.svg");
    }
}
