.catalog-shell {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.catalog-panel {
    background: rgba(30, 41, 59, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.85rem;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.catalog-filters {
    display: flex;
    align-items: end;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.catalog-field {
    flex: 1 1 0;
    min-width: 0;
}

.catalog-field:first-child {
    flex: 0 0 380px;
}

.catalog-field label {
    display: block;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.catalog-input,
.catalog-select {
    width: 100%;
    min-height: 42px;
    background: rgba(15, 23, 42, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.55rem;
    color: #f8fafc;
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
}

.catalog-input:focus,
.catalog-select:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.75);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.catalog-reset {
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 42px;
    min-height: 42px;
    align-self: end;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.55rem;
    background: rgba(30, 41, 59, 0.86);
    color: #e2e8f0;
    font-weight: 700;
    padding: 0.55rem 0.8rem;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.catalog-reset:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(167, 139, 250, 0.42);
}

.catalog-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.catalog-list-title {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 800;
}

.catalog-count {
    color: #94a3b8;
    font-size: 0.82rem;
    white-space: nowrap;
}

.catalog-list {
    max-height: calc(100vh - 260px);
    min-height: 430px;
    overflow: auto;
}

.catalog-row {
    width: 100%;
    display: block;
    text-align: left;
    color: inherit;
    background: transparent;
    border: 0;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.82rem 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.catalog-row:hover {
    background: rgba(255, 255, 255, 0.035);
}

.catalog-row.active {
    background: rgba(139, 92, 246, 0.14);
    border-left-color: #a78bfa;
}

.catalog-row-title {
    color: #fff;
    font-weight: 800;
    line-height: 1.25;
}

.catalog-row-subtitle {
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.35;
    margin-top: 0.25rem;
}

.catalog-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.catalog-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.66);
    color: #cbd5e1;
    font-size: 0.72rem;
    line-height: 1.15;
    padding: 0.22rem 0.48rem;
}

.catalog-detail {
    position: sticky;
    top: 5.7rem;
    min-height: 520px;
    overflow: hidden;
}

.catalog-detail-body {
    padding: 1.15rem;
}

.catalog-detail-kicker {
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}

.catalog-detail-title {
    color: #fff;
    font-size: clamp(1.6rem, 2.4vw, 2.15rem);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: 0;
}

.catalog-detail-alt {
    color: #94a3b8;
    font-size: 0.92rem;
    margin-top: 0.35rem;
}

.catalog-detail-summary {
    color: #cbd5e1;
    font-size: 0.96rem;
    line-height: 1.55;
    margin-top: 0.85rem;
}

.catalog-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.catalog-stat {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    background: rgba(15, 23, 42, 0.52);
    padding: 0.7rem;
}

.catalog-stat-label {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
}

.catalog-stat-value {
    color: #fff;
    font-size: 1rem;
    font-weight: 850;
    margin-top: 0.2rem;
}

.catalog-section {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    margin-top: 1rem;
    padding-top: 1rem;
}

.catalog-section-title {
    color: #f8fafc;
    font-size: 0.96rem;
    font-weight: 850;
    margin-bottom: 0.55rem;
}

.catalog-prose {
    color: #dbe4f0;
    font-size: 0.92rem;
    line-height: 1.62;
}

.catalog-prose p + p,
.catalog-entry + .catalog-entry {
    margin-top: 0.65rem;
}

.catalog-entry-name {
    color: #fff;
    font-weight: 850;
}

.catalog-ability-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 1rem;
}

.catalog-ability {
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.48);
    padding: 0.5rem 0.35rem;
}

.catalog-ability-label {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
}

.catalog-ability-value {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 850;
    margin-top: 0.15rem;
}

.catalog-empty {
    color: #94a3b8;
    padding: 2rem;
    text-align: center;
}

.catalog-fav {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    font-weight: 800;
    padding: 0.48rem 0.7rem;
}

.catalog-fav.active {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.45);
}

@media (max-width: 1100px) {
    .catalog-filters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .catalog-field:first-child {
        flex-basis: auto;
    }
}

@media (max-width: 900px) {
    .catalog-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-shell {
        grid-template-columns: 1fr;
    }

    .catalog-detail {
        position: static;
        min-height: 0;
    }

    .catalog-list {
        max-height: 420px;
        min-height: 260px;
    }
}

@media (max-width: 640px) {
    .catalog-filters,
    .catalog-stat-grid,
    .catalog-ability-grid {
        grid-template-columns: 1fr;
    }
}
