.items-main {
    display: block;
}

.items-loading {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted);
}

.items-panel {
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 400px;
}

.items-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.items-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.items-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.items-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.items-filter {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.items-filter-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding-top: 7px;
}

.items-types-wrap {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.items-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.items-collapse {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0;
    line-height: 1;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.items-collapse svg {
    display: block;
    flex: 0 0 auto;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.items-collapse:hover svg {
    color: var(--text-primary);
}

.items-collapse.open svg {
    transform: rotate(90deg);
}

.items-heart {
    color: #f472a6;
    margin-right: 3px;
}

.items-tip-row.hl {
    margin: 2px -6px;
    padding: 0 6px;
    border-radius: 6px;
    background: #393c43;
    box-shadow: inset 0 0 0 1px rgba(230, 240, 255, 0.35);
}

.items-tip-row.hl > span:nth-child(2),
.items-tip-row.hl b {
    color: var(--text-primary);
}


.items-subtypes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.items-subtypes[hidden] {
    display: none;
}

.items-type,
.items-feature {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 8px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.84rem;
    cursor: pointer;
}

.items-type:hover,
.items-feature:hover {
    color: var(--text-primary);
}

.items-type.selected,
.items-feature.selected {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.items-dec-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.items-dec-pick {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.75;
}

.items-dec-pick img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.items-dec-pick:hover {
    opacity: 1;
    background: var(--bg-tertiary);
}

.items-dec-pick.selected {
    opacity: 1;
    background: var(--bg-tertiary);
}

#items-dec-row[hidden] {
    display: none;
}

.items-type--all {
    position: relative;
    margin-right: 9px;
    font-weight: 700;
    color: var(--text-primary);
}

.items-type--all::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border-color);
}

.items-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.items-quality {
    justify-self: start;
    max-width: 100%;
    overflow-x: auto;
}

.items-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}

.items-search-row .items-filter-label {
    padding-top: 0;
}

.items-sort {
    min-height: 40px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.items-card {
    appearance: none;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 350 / 185;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    overflow: hidden;
}

.items-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(20, 22, 26, 0.42);
}

.items-card:hover::before,
.items-card:focus-visible::before,
.items-card.active::before {
    background: rgba(20, 22, 26, 0.25);
}

.items-card:focus-visible {
    outline: none;
}

.items-card-icon,
.items-card-name {
    z-index: 1;
}

.items-badge {
    z-index: 2;
}

.items-card-icon {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 78%;
    display: grid;
    place-items: center;
}

.items-card-icon img {
    width: 56%;
    max-width: 64px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}

.items-card-blank {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.items-card-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 21.6%;
    background: #2b2d31;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.items-card-name > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.items-card.q1 .items-card-name { color: #C4C4C4; }
.items-card.q2 .items-card-name { color: #75C278; }
.items-card.q3 .items-card-name { color: #79AEF2; }
.items-card.q4 .items-card-name { color: #BD7DEA; }
.items-card.q5 .items-card-name { color: #F99854; }
.items-card.q6 .items-card-name { color: #FA7575; }

.items-badge {
    position: absolute;
    top: 5px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.64rem;
    line-height: 1.3;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.5);
    color: #e6f0ff;
    pointer-events: none;
}

.items-badge.stack {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.items-badge.stack > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.items-badge img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.items-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
}

.items-detail {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}

.items-detail[hidden] {
    display: none;
}

.items-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, 0.55);
}

.items-detail-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(520px, 100vw);
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
}

.items-detail-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.items-detail-bar .spacer {
    flex: 1;
}

.items-detail-bar button {
    min-height: 32px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.items-detail-bar button:hover {
    color: var(--text-primary);
}

.items-detail-bar button[hidden] {
    display: none;
}

.items-detail-bar .items-detail-close {
    width: 32px;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.items-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 32px;
}

.items-detail-head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.items-detail-icon {
    position: relative;
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.items-detail-icon img {
    position: relative;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.items-detail-title {
    min-width: 0;
}

.items-detail-title h2 {
    margin: 0 0 2px;
    font-size: 1.2rem;
    line-height: 1.3;
}

.items-detail-type {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.items-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.items-facts small {
    font-weight: 400;
    color: var(--text-muted);
    margin-right: 5px;
}

.items-props {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.items-prop {
    display: grid;
    grid-template-columns: 22px minmax(0, 9fr) minmax(0, 11fr);
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.86rem;
}

.items-prop + .items-prop {
    border-top: 1px solid var(--border-color);
}

.items-prop + .items-prop.sub {
    border-top: 0;
}

.items-prop.sub {
    align-items: start;
    min-height: 0;
    padding-top: 0;
}

.items-prop.sub .items-prop-label {
    color: var(--text-secondary);
}

.items-prop.off .items-prop-label {
    color: var(--text-muted);
}

.items-check {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
}

.items-check.yes {
    background: rgba(87, 242, 135, 0.15);
    color: #57f287;
}

.items-check.no {
    background: rgba(237, 66, 69, 0.12);
    color: #ed6a6c;
}

.items-prop-value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 2px 8px;
    font-weight: 600;
    text-align: right;
}

.items-prop-value small {
    flex-basis: 100%;
    font-weight: 400;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.items-range {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.items-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.items-price img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.items-section {
    margin-top: 16px;
}

.items-section h3 {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.items-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.items-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 32px;
    padding: 3px 10px 3px 4px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
}

button.items-chip:hover,
a.items-chip:hover {
    border-color: var(--text-muted);
}

.items-chip--static {
    cursor: default;
}

.items-chip img,
.items-chip-blank {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 auto;
}

.items-chip-blank {
    border-radius: 4px;
    background: var(--bg-secondary);
}

.items-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.items-chip b {
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.items-chip em {
    font-style: normal;
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.items-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.items-cost {
    margin-top: 8px;
    font-size: 0.85rem;
}

.items-alt {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.items-alt-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.items-recipe + .items-recipe {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.items-recipe-head {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.items-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.items-odds {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.items-odds-head {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.items-odds ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.items-odds li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
}

.items-odds li b {
    font-variant-numeric: tabular-nums;
}

.items-src-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin-top: 8px;
}

.items-src-label {
    padding-top: 7px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.items-shop-list {
    display: grid;
    gap: 6px;
}

.items-shop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.items-shop span:first-child {
    flex: 1;
    min-width: 0;
}

.items-shop small {
    color: var(--text-muted);
}

.items-shop:hover {
    border-color: var(--text-muted);
}

body.items-detail-open {
    overflow: hidden;
}

@media (max-width: 760px) {
    .items-dec-pick {
        width: 36px;
        height: 36px;
    }

    .items-dec-pick img {
        width: 30px;
        height: 30px;
    }

    .items-filter {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .items-filter-label {
        padding-top: 0;
    }

    .items-quality > button {
        min-width: 48px;
        padding: 6px 10px;
    }

    .items-search-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .items-search-row .ro-search {
        grid-column: 1 / -1;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
        gap: 6px;
    }

    .items-detail-card {
        width: 100vw;
    }
}

.items-tip {
    position: fixed;
    z-index: 900;
    min-width: 200px;
    max-width: 380px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    box-shadow: var(--shadow);
    font-size: 0.8rem;
    pointer-events: none;
}

.items-tip[hidden] {
    display: none;
}

.items-tip-name {
    font-weight: 600;
    margin-bottom: 6px;
}

.items-tip-body {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 16px auto;
    column-gap: 6px;
}

.items-tip-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
    min-height: 24px;
}

.items-tip-row i {
    display: grid;
    place-items: center;
    font-style: normal;
}

.items-tip-row i img {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.items-tip-row i .items-heart {
    margin: 0;
}

.items-tip-row b {
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
