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

.previewField {
    display: grid;
    width: 100%;
    min-height: 88px;
    gap: var(--space-2);
    padding: var(--space-2);
    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);
}

.previewField:hover {
    border-color: var(--primary-border);
    background: var(--primary-surface);
    box-shadow: var(--shadow-soft);
}

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

.previewField:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.previewTop {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.previewLabel {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.previewRequired {
    color: var(--danger);
}

.previewBadge {
    display: inline-flex;
    height: var(--admin-tag-height);
    align-items: center;
    padding: 0 var(--space-2);
    border-radius: var(--admin-tag-radius);
    background: var(--primary-surface);
    color: var(--primary);
    font-size: 12px;
    font-weight: 750;
}

.previewBody {
    display: grid;
    min-width: 0;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: var(--space-2);
    align-items: center;
}

.previewThumb {
    width: 54px;
    height: 54px;
}

.previewCopy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

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

.previewMeta {
    min-width: 0;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
    gap: var(--space-2);
    align-items: center;
}

.search,
.typeFilter {
    width: 100%;
}

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

.card {
    display: grid;
    min-width: 0;
    min-height: 164px;
    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);
}

.thumb {
    display: inline-flex;
    width: 54px;
    height: 54px;
    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) {
    .filters {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    }
}

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

    .card:hover {
        transform: none;
    }
}
