/* ===== НАЧАЛО: SEM24 — панель фильтра, карточки и навигация ===== */
.sem24-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    margin: 0 0 16px;
    color-scheme: dark;
}

.sem24-filter select,
.sem24-filter button,
.sem24-filter .sem24-filter-reset,
.sem24-filter-nav a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #333139;
    border-radius: 4px;
    background: #1e1d22;
    color: #dedce2;
    font: inherit;
    font-size: 13px;
}

.sem24-filter select {
    flex: 1 1 100px;
    min-width: 0;
    cursor: pointer;
}

.sem24-filter button {
    background: #36323d;
    cursor: pointer;
}

.sem24-filter .sem24-filter-reset,
.sem24-filter-nav a {
    text-decoration: none;
}

.sem24-filter :is(select, button, a):focus-visible,
.sem24-filter-nav a:focus-visible {
    outline: 2px solid #a99bea;
    outline-offset: 2px;
}

/* Меню SEM24: тёмный список, светлый выбранный пункт и фиолетовая прокрутка. */
.sem24-filter select[hidden] {
    display: none;
}

.sem24-filter-dropdown {
    position: relative;
    flex: 1 1 99px;
    min-width: 0;
}

.sem24-filter-dropdown > summary {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
    height: 36px;
    padding: 0 8px;
    border-radius: 4px;
    background: #1e1d22;
    color: #dedce2;
    cursor: pointer;
    font-size: 13px;
    list-style: none;
}

.sem24-filter-dropdown > summary::-webkit-details-marker {
    display: none;
}

.sem24-filter-dropdown > summary > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sem24-filter-dropdown > summary::after {
    content: "";
    flex: none;
    border: 4px solid transparent;
    border-bottom: 0;
    border-top-color: #99969e;
}

.sem24-filter-dropdown[open] {
    z-index: 30;
}

.sem24-filter-options {
    position: absolute;
    inset: calc(100% + 3px) auto auto 0;
    box-sizing: border-box;
    min-width: 100%;
    width: max-content;
    max-width: min(220px, 45vw);
    max-height: min(402px, 50vh);
    overflow: auto;
    border: 1px solid #b6b2bc;
    border-radius: 4px;
    background: #1e1d22;
    scrollbar-width: thin;
    scrollbar-color: #a16bf3 #1e1d22;
}

.sem24-filter .sem24-filter-options > button {
    display: flex;
    width: 100%;
    min-height: 31px;
    height: auto;
    padding: 5px 12px 5px 16px;
    border: 0;
    border-radius: 0;
    background: #1e1d22;
    color: #c0bcc6;
    text-align: left;
    text-transform: none;
    white-space: normal;
}

.sem24-filter .sem24-filter-options > button + button {
    border-top: 1px solid #b6b2bc;
}

.sem24-filter .sem24-filter-options > button[aria-pressed="true"] {
    justify-content: space-between;
    background: #f4f3f6;
    color: #211d25;
    font-weight: 600;
}

.sem24-filter .sem24-filter-options > button[aria-pressed="true"]::after {
    content: "•";
    margin-left: 10px;
}

.sem24-filter .sem24-filter-options > button:not([aria-pressed="true"]):hover {
    background: #393141;
    color: #fff;
}

.sem24-filter-dropdown > summary:focus-visible,
.sem24-filter .sem24-filter-options > button:focus-visible {
    outline: 2px solid #a99bea;
    outline-offset: -2px;
}

.sem24-filter-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.sem24-filter-results > * {
    min-width: 0;
    max-width: 100%;
}

.sem24-filter-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

@media (max-width: 1000px) {
    .sem24-filter-results {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .sem24-filter-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sem24-filter-dropdown {
        flex: 1 1 42%;
    }

    .sem24-filter-dropdown > summary {
        height: 44px;
    }

    .sem24-filter .sem24-filter-options > button {
        min-height: 44px;
    }

    .sem24-filter select,
    .sem24-filter > button,
    .sem24-filter .sem24-filter-reset {
        min-height: 44px;
        flex: 1 1 42%;
        justify-content: center;
    }
}
/* Отфильтрованные карточки и навигация занимают всю ширину списка DLE. */
#dle-content:has(> .sem24-filter-results),
#dle-content:has(> .sem24-filter-empty) {
    display: block;
}

/* ===== КОНЕЦ: SEM24 — панель фильтра, карточки и навигация ===== */
