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

.drawer.drawer {
    width: min(720px, 100vw);
    height: 100%;
}

.drawerBody {
    display: grid;
    min-height: 0;
    grid-template-rows: auto 1fr;
    gap: var(--space-3);
}

.filters {
    display: grid;
    min-width: 0;
    gap: var(--space-3);
}

.search {
    width: 100%;
}

.tabs {
    min-height: 38px;
    border-bottom: 1px solid var(--border-muted);
}

.tabs :global(.MuiTab-root) {
    min-height: 38px;
    padding: 0 var(--space-3);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.tabs :global(.Mui-selected) {
    color: var(--primary);
}

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

.card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 184px;
    align-content: start;
    align-self: start;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    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),
        transform var(--motion-base) var(--ease-emphasized);
}

.card:hover {
    border-color: var(--primary-border);
    background: var(--primary-surface);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

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

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

.checkbox {
    position: absolute;
    top: 6px;
    right: 6px;
    pointer-events: none;
}

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

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

.name,
.meta,
.tag {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.name {
    color: var(--text-primary);
    font-weight: 700;
}

.meta {
    color: var(--text-tertiary);
    font-size: 13px;
}

.tags {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.tag {
    display: inline-flex;
    max-width: 100%;
    height: var(--admin-tag-height);
    align-items: center;
    padding: 0 var(--space-2);
    border: 1px solid var(--admin-tag-border);
    border-radius: var(--admin-tag-radius);
    background: var(--admin-tag-bg);
    color: var(--admin-tag-color);
    font-size: 12px;
    font-weight: 650;
}

.empty {
    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) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

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

    .card:hover {
        transform: none;
    }
}
