.identity {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.identityText,
.stack {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.name,
.resourceText {
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta,
.emptyValue {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.typeBadge {
    flex: 0 0 auto;
    min-width: 62px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 3px 8px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.statusCell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.badgeCover {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card-strong);
    color: var(--text-secondary);
}

.badgeCover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resourceField :global(.MuiInputBase-input:not(:disabled)) {
    cursor: pointer;
}

.resourceDrawer.resourceDrawer {
    width: min(640px, 100vw);
    height: 100%;
}

.resourceDrawerBody {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.resourceGrid {
    display: grid;
    min-height: 0;
    align-content: start;
    align-items: start;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-2);
    overflow-y: auto;
    padding-right: var(--space-1);
}

.resourceCard {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    min-width: 0;
    min-height: 78px;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition:
        border-color var(--motion-fast) var(--ease-standard),
        background var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-fast) var(--ease-standard);
}

.resourceCard:hover {
    border-color: var(--primary-border);
    background: var(--primary-surface);
}

.resourceCard:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.resourceCardSelected,
.resourceCardSelected:hover {
    border-color: var(--primary);
    background: var(--primary-surface-strong);
    box-shadow: inset 0 0 0 1px var(--primary-border);
}

.resourceCard .badgeCover {
    grid-row: 1 / 3;
}

.resourceName {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emptyState {
    display: flex;
    min-height: 180px;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-weight: 650;
}

@media (max-width: 640px) {
    .resourceGrid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .resourceCard {
        transition: none;
    }
}
