/* Load after main.css / true-styles.css and application-progress.css.
   Keep the existing compact, warm-paper application layout and typography. */
.main-content > .application-language {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-self: center;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 3px;
    border: 1px solid rgba(28, 10, 8, 0.2);
    border-radius: 10px;
    background: rgba(234, 230, 216, 0.65);
}

.application-language > button[data-language] {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #1C0A08;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    touch-action: manipulation;
}

.application-language > button[data-language][aria-pressed="true"] {
    border-color: #1C0A08;
    background: #1C0A08;
    color: #EAE6D8;
}

@media (hover: hover) {
    .application-language > button[data-language][aria-pressed="false"]:hover {
        border-color: rgba(28, 10, 8, 0.3);
        background: rgba(28, 10, 8, 0.06);
    }
}

.application-language > button[data-language]:focus-visible {
    outline: 2px solid #1C0A08;
    outline-offset: 3px;
}

.application-language > button[data-language]:active {
    transform: translateY(1px);
}

/* Translation sets the document (or main content) lang to ru.
   Wrap prose rather than reducing type size or clipping translations. */
.country-list > button.country-option {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font: inherit;
}

.main-content:lang(ru) .form-container :is(
    .header-content, .question, h1, h2, h3, p, label,
    .option-label, .option-text, .upload-label,
    .input-description, .input-requirements, .agreement-list,
    .time-estimate, .file-name
) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

.main-content:lang(ru) .form-container :is(.button, .upload-button) {
    min-width: 0;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

/* The legacy arrow-sized control may now contain a translated word. */
.main-content:lang(ru) .form-container #meta-profile .button-group .button:not(.secondary) {
    width: auto;
    min-width: 56px;
    padding: 12px 16px;
}

.main-content:lang(ru) .form-container .upload-button {
    text-align: left;
}

.main-content:lang(ru) .form-container :is(.upload-icon, .option-letter, .time-estimate img) {
    flex-shrink: 0;
}

.main-content:lang(ru) .form-container select {
    /* Native selects remain single-line; leave space for the chevron. */
    padding-inline-end: 40px;
    text-overflow: ellipsis;
}

@media (max-width: 380px) {
    .application-language > button[data-language] {
        padding-inline: 12px;
    }

    .main-content:lang(ru) .form-container .button-group > .button {
        flex: 1 1 auto;
    }

    .main-content:lang(ru) .form-container .option-label {
        gap: 10px;
    }
}

@media (forced-colors: active) {
    .application-language > button[data-language][aria-pressed="true"] {
        border-color: Highlight;
        background: Highlight;
        color: HighlightText;
        forced-color-adjust: none;
    }

    .application-language > button[data-language]:focus-visible {
        outline-color: Highlight;
    }
}
