.affix-filters {
    gap: 10px;
}

.affix-filters .affix-job-chips {
    gap: 10px;
    padding-bottom: 0;
}

.affix-filters .affix-job-primary-chips,
.affix-filters .affix-job-subchips,
.affix-filters .affix-type-section-weapon .affix-type-grid,
.affix-filters .affix-level-row,
.affix-filters .affix-rarity-toggle,
.affix-filters .affix-quality-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    grid-template-columns: none;
}

.affix-filters .affix-type-section-weapon .affix-type-grid {
    gap: 0;
    padding: 0 1px 1px 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.affix-filters .affix-type-section-weapon .affix-type-grid::after {
    content: "";
    flex: 999 1 0;
    min-width: 0;
}

.affix-filters .affix-type-section-weapon .affix-type-btn,
.affix-filters .affix-type-section-weapon .affix-type-btn:hover,
.affix-filters .affix-type-section-weapon .affix-type-btn.selected {
    margin: 0 -1px -1px 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.affix-filters .affix-type-section-weapon .affix-type-btn:first-child {
    border-top-left-radius: 8px;
}

.affix-filters .affix-type-section-weapon .affix-type-btn:last-child {
    border-bottom-right-radius: 8px;
}

.affix-filters .affix-type-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 0;
    width: auto;
    grid-template-columns: none;
}

.affix-filters .affix-type-section {
    display: block;
    flex: 0 0 auto;
    min-width: 0;
}

.affix-filters .affix-type-section-weapon {
    flex: 1 0 100%;
}

.affix-filters .affix-type-section-armor .affix-type-grid {
    display: flex;
    gap: 0;
    width: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0;
    grid-template-columns: none;
}

.affix-filters .affix-type-section-armor + .affix-type-section-armor .affix-type-grid {
    border-left-color: rgba(255, 255, 255, 0.07);
    margin-left: -1px;
}

.affix-filters .affix-type-section-armor:first-child .affix-type-grid {
    border-radius: 8px 0 0 8px;
}

.affix-filters .affix-type-section-armor:not(:has(+ .affix-type-section-armor)) .affix-type-grid {
    border-radius: 0 8px 8px 0;
}

.affix-filters .affix-type-section-armor:first-child:not(:has(+ .affix-type-section-armor)) .affix-type-grid {
    border-radius: 8px;
}

.affix-filters .affix-job-chip,
.affix-filters .affix-type-btn,
.affix-filters .affix-level-btn,
.affix-filters .affix-rarity-btn,
.affix-filters .affix-quality-btn {
    --seg-color: #a3b4d4;
    display: inline-flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    min-width: 56px;
    height: auto;
    min-height: 38px;
    margin: 0;
    padding: 6px 14px;
    color: var(--text-secondary, #a3b4d4);
    border: 0;
    border-radius: 0;
    background: #25272b;
    box-shadow: none;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transform: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.affix-filters .affix-job-chip-group {
    min-width: 44px;
    padding: 6px 10px;
}

.affix-filters .affix-job-chip:hover,
.affix-filters .affix-type-btn:hover,
.affix-filters .affix-level-btn:hover,
.affix-filters .affix-rarity-btn:hover,
.affix-filters .affix-quality-btn:hover {
    color: var(--text-primary, #e6f0ff);
    border: 0;
    background: #2c2f34;
    box-shadow: none;
    transform: none;
}

.affix-filters .affix-job-chip.selected,
.affix-filters .affix-type-btn.selected,
.affix-filters .affix-level-btn.active,
.affix-filters .affix-rarity-btn.active,
.affix-filters .affix-quality-btn.active {
    color: var(--text-primary, #e6f0ff);
    border: 0;
    background: color-mix(in srgb, var(--seg-color) 16%, #25272b);
    box-shadow: none;
}

.affix-filters .affix-job-chip:focus-visible,
.affix-filters .affix-type-btn:focus-visible,
.affix-filters .affix-level-btn:focus-visible,
.affix-filters .affix-rarity-btn:focus-visible,
.affix-filters .affix-quality-btn:focus-visible {
    outline: 2px solid var(--seg-color);
    outline-offset: -2px;
}

.affix-filters .affix-job-chip-icons {
    gap: 4px;
}

.affix-filters .affix-job-chip img,
.affix-filters .affix-job-chip-group img.affix-job-chip-icon {
    width: 22px;
    height: 22px;
}

.affix-filters .affix-job-primary-chips .affix-job-chip:not(.affix-job-chip-all) .affix-job-chip-label {
    display: none;
}

.affix-filters .affix-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 0;
    background: transparent;
}

.affix-filters .affix-type-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.affix-filters .affix-type-name {
    flex: 0 0 auto;
    width: auto;
    color: inherit;
    font-size: inherit;
    line-height: 1.2;
    overflow-wrap: normal;
    text-align: left;
}

.affix-filters .affix-type-btn.is-empty {
    --seg-color: #ff6b6b;
}

.affix-filters .affix-rarity-btn.rarity-2 { --seg-color: #75c278; }
.affix-filters .affix-rarity-btn.rarity-3 { --seg-color: #79aef2; }
.affix-filters .affix-rarity-btn.rarity-4 { --seg-color: #bd7dea; }
.affix-filters .affix-rarity-btn.rarity-5 { --seg-color: #f99854; }
.affix-filters .affix-rarity-btn.rarity-6 { --seg-color: #e45454; }

.affix-filters .affix-rarity-btn.rarity-2::before,
.affix-filters .affix-rarity-btn.rarity-3::before,
.affix-filters .affix-rarity-btn.rarity-4::before,
.affix-filters .affix-rarity-btn.rarity-5::before,
.affix-filters .affix-rarity-btn.rarity-6::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--seg-color);
}

@media (max-width: 760px) {
    .affix-filters .affix-job-primary-chips,
    .affix-filters .affix-job-subchips,
    .affix-filters .affix-level-row,
    .affix-filters .affix-rarity-toggle,
    .affix-filters .affix-quality-toggle {
        width: 100%;
    }

    .affix-filters .affix-job-primary-chips {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
    }

    .affix-filters .affix-job-primary-chips .affix-job-chip {
        padding: 6px 2px;
    }

    .affix-filters .affix-level-row,
    .affix-filters .affix-rarity-toggle {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .affix-filters .affix-level-row:has(> :nth-child(10):last-child) {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .affix-filters .affix-job-chip,
    .affix-filters .affix-type-btn,
    .affix-filters .affix-level-btn,
    .affix-filters .affix-rarity-btn,
    .affix-filters .affix-quality-btn {
        min-width: 0;
        min-height: 36px;
        padding: 6px 9px;
        gap: 5px;
        font-size: 0.8rem;
    }

    .affix-filters .affix-job-chip-group {
        padding: 6px 7px;
    }

    .affix-filters .affix-rarity-btn.rarity-2::before,
    .affix-filters .affix-rarity-btn.rarity-3::before,
    .affix-filters .affix-rarity-btn.rarity-4::before,
    .affix-filters .affix-rarity-btn.rarity-5::before,
    .affix-filters .affix-rarity-btn.rarity-6::before {
        width: 6px;
        height: 6px;
    }
}

.affix-card-grid .affix-card {
    --stunt-color: #79aef2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    transform: none;
}

.affix-card-grid .affix-card.stunt-green { --stunt-color: #75c278; }
.affix-card-grid .affix-card.stunt-blue { --stunt-color: #79aef2; }
.affix-card-grid .affix-card.stunt-purple { --stunt-color: #bd7dea; }
.affix-card-grid .affix-card.stunt-gold { --stunt-color: #f99854; }
.affix-card-grid .affix-card.stunt-red { --stunt-color: #e45454; }

.affix-card-grid .affix-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    transform: none;
}

.affix-card-grid .affix-card.picked {
    border-color: color-mix(in srgb, var(--stunt-color) 70%, transparent);
    background: color-mix(in srgb, var(--stunt-color) 8%, transparent);
    box-shadow: none;
}

.affix-card-grid .affix-card:focus-visible {
    outline: 2px solid var(--stunt-color);
    outline-offset: 2px;
}

.affix-card-grid .affix-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
}

.affix-card-grid .affix-card-name {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    color: var(--text-primary);
}

.affix-card-grid .affix-card-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.affix-card-grid .affix-card-level {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 10px;
    border: 1px solid color-mix(in srgb, var(--stunt-color) 65%, transparent);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: color-mix(in srgb, var(--stunt-color) 45%, #ffffff);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.affix-card-grid .affix-card-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .affix-card-grid .affix-card {
        padding: 12px;
    }
}
