/* Shared app focus and selected-state treatment. Loaded after component CSS. */

/* Keep single-choice dropdown arrows consistently inset from the right edge. */
select:not([multiple]):not([size]),
select[size="1"] {
    padding-right: 32px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7.5 5 5 5-5' fill='none' stroke='%231b222c' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px 16px !important;
    appearance: none;
    -webkit-appearance: none;
}

:is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea:not(.es-ai-chat__input),
    .es-input,
    .es-select,
    .es-textarea
):focus {
    border-color: var(--es-focus-border) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 1px var(--es-focus-ring) !important;
}

.es-ai-chat__input-wrap:focus-within {
    border-color: var(--es-focus-border) !important;
    box-shadow: 0 0 0 1px var(--es-focus-ring) !important;
}

:is(
    .es-dashboard-pages__tab,
    .es-workout-analysis__tabs button,
    .admin-all-workouts-filter-summary,
    .analysis-presets__action,
    .analysis-share-btn,
    .es-documents-toolbar-btn,
    .es-documents-add-btn,
    .es-documents-filter-btn,
    .es-documents-folder-btn,
    button.es-btn,
    a.es-btn
):focus-visible {
    border-color: var(--es-focus-border) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 1px var(--es-focus-ring) !important;
}

:is(
    .es-dashboard-pages__tab.is-active,
    .es-workout-analysis__tabs button.is-active,
    .admin-all-workouts-filter-summary.is-active,
    .admin-all-workouts-filter-summary.is-open,
    .es-documents-filter-btn.is-active
) {
    border-color: var(--es-focus-border) !important;
    box-shadow: 0 0 0 1px var(--es-focus-ring) !important;
}
