/* After an in-place swap the listing takes focus so the keyboard lands on the new rows. */
#ij-category-results:focus,
#ij-search-results:focus {
    outline: none;
}

#ij-category-results[aria-busy="true"],
#ij-search-results[aria-busy="true"] {
    cursor: progress;
}

/* Active filters: one row of removable chips above the table. */
.ij-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 13px;
}

.ij-filters-kicker {
    color: var(--ij-muted, #6b7280);
    font-weight: 700;
    font-size: 12px;
}

.ij-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 12px;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4f91;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.6;
}

.ij-filter-chip:hover,
.ij-filter-chip:focus-visible {
    border-color: #1d4f91;
    background: #e3edff;
    color: #163c6e;
}

.ij-filter-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(29, 79, 145, .12);
    font-size: 12px;
    line-height: 1;
}

.ij-filter-clear {
    color: #b42318;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    padding-bottom: 1px;
}

.ij-filter-clear:hover,
.ij-filter-clear:focus-visible {
    color: #8f1d14;
}

/* Suggested facets for the search page, with the record count inside the chip. */
.ij-facets {
    margin: 0 0 14px;
}

.ij-facets-title {
    margin: 0 0 8px;
    color: var(--ij-muted, #6b7280);
    font-size: 12px;
    font-weight: 700;
}

.ij-facets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ij-facet {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border: 1px solid var(--ij-line, #e5e7eb);
    border-radius: 999px;
    background: #fff;
    color: var(--ij-ink, #1f2937);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.6;
}

.ij-facet:hover,
.ij-facet:focus-visible {
    border-color: var(--ij-brand, #1d4f91);
    color: var(--ij-brand, #1d4f91);
}

.ij-facet-count {
    display: inline-block;
    min-width: 26px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}

/* Autocomplete field: a plain GET form that also works without JavaScript. */
.ij-qfilter {
    position: relative;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--ij-line, #e5e7eb);
    border-radius: 14px;
    background: #fbfcfe;
}

.ij-qfilter-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ij-muted, #6b7280);
    font-size: 12px;
    font-weight: 700;
}

.ij-qfilter-box {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ij-qfilter-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d6dde7;
    border-radius: 10px;
    background: #fff;
    color: var(--ij-ink, #1f2937);
    font-size: 14px;
}

.ij-qfilter-input:focus {
    border-color: var(--ij-brand, #1d4f91);
    outline: 2px solid rgba(29, 79, 145, .18);
    outline-offset: 1px;
}

.ij-qfilter-btn {
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--ij-brand, #1d4f91);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.ij-qfilter-btn:hover,
.ij-qfilter-btn:focus-visible {
    background: #163c6e;
}

.ij-qfilter-hint {
    margin: 8px 0 0;
    color: #8a94a6;
    font-size: 11.5px;
    line-height: 1.8;
}

.ij-qfilter-list {
    position: absolute;
    z-index: 40;
    top: 100%;
    right: 16px;
    left: 16px;
    max-height: 280px;
    margin: 4px 0 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #d6dde7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .14);
    list-style: none;
}

.ij-qfilter-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ij-ink, #1f2937);
    font-size: 13px;
    cursor: pointer;
}

.ij-qfilter-opt:hover,
.ij-qfilter-opt.is-active {
    background: #eef4ff;
    color: #163c6e;
}

.ij-qfilter-opt-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ij-search-empty-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 560px) {
    .ij-filters,
    .ij-facets-list {
        gap: 6px;
    }

    .ij-filter-chip,
    .ij-facet {
        padding: 5px 10px;
        font-size: 12px;
    }

    .ij-qfilter {
        padding: 12px;
    }

    .ij-qfilter-box {
        flex-direction: column;
    }

    .ij-qfilter-input {
        width: 100%;
        box-sizing: border-box;
    }

    .ij-qfilter-btn {
        width: 100%;
    }

    .ij-qfilter-list {
        right: 12px;
        left: 12px;
    }
}
