/**
 * ProjectEntityIndex — стили карточек индекса мудбордов проекта.
 * Карточки рендерятся в #gallery-grid; используем тот же CSS-grid страницы,
 * только наш набор классов для содержимого.
 */

.pei-scope-switcher {
    margin: 0 0 12px;
    position: relative;
    z-index: 11;
}

.pei-scope-switcher[hidden] {
    display: none !important;
}

.pei-scope-switcher .mvs-btn {
    min-width: 92px;
}

.pei-card {
    cursor: pointer;
    background: var(--card-bg, #1a1a1f);
    border: 1px solid var(--border-color, #2a2a30);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.pei-card:hover {
    border-color: var(--accent, #f4c430);
    transform: translateY(-1px);
}

.pei-card.pei-card--active {
    outline: 2px solid var(--accent, #f4c430);
    outline-offset: -2px;
    border-color: var(--accent, #f4c430) !important;
    box-shadow: 0 4px 16px rgba(244, 196, 48, 0.25);
}

.pei-card.pei-card--active .pei-card__title {
    color: var(--accent, #f4c430);
}

.pei-card__thumb {
    aspect-ratio: 1 / 1;
    background: #0f0f12;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pei-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.pei-card__body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 56px;
}

.pei-card__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #e0e0e6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pei-card__path {
    font-size: 11px;
    color: var(--text-secondary, #8a8a92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pei-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary, #8a8a92);
}

.pei-card__count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pei-card__count i {
    width: 12px;
    height: 12px;
}

/* ── Empty / loading / error ── */

.pei-loading,
.pei-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary, #8a8a92);
    text-align: center;
}

.pei-empty__text {
    font-size: 14px;
    line-height: 1.5;
    max-width: 480px;
}

.pei-empty--error .pei-empty__text {
    color: #ef4444;
}

/* ── Псевдо-узел "Мудборды" в дереве ── */

.ftree-node--entity-index .ftree-icon {
    color: var(--accent, #f4c430);
    opacity: 0.85;
}

.ftree-node--entity-index.ftree-node--active .ftree-row {
    background: var(--row-active-bg, rgba(244, 196, 48, 0.12));
}
