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

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

.groupTitle {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 760;
    line-height: 18px;
}

.fieldGrid {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.fieldGrid > :global(.MuiTextField-root),
.fieldGrid > :global(.MuiFormControl-root) {
    width: 100%;
}

.wideField {
    grid-column: span 2;
}

.invalid {
    padding: 9px 12px;
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--danger) 7%, transparent);
    color: var(--danger);
    font-size: 12px;
    font-weight: 650;
}

.catalogHeader {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.catalogRows {
    display: grid;
    gap: var(--space-2);
}

.catalogRow {
    display: grid;
    min-width: 0;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-card-strong);
}

.catalogMain {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(130px, 0.55fr) minmax(150px, 0.7fr) minmax(260px, 1.5fr) auto;
    align-items: start;
    gap: var(--space-2);
}

.catalogMain > :global(.MuiTextField-root) {
    width: 100%;
}

.rowDetails,
.details {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg-card-strong);
}

.rowDetails {
    border: 0;
    background: transparent;
}

.rowDetails > summary,
.details > summary {
    padding: 9px 11px;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    user-select: none;
}

.rowDetails > summary {
    padding: 2px 0;
}

.details[open] > summary {
    border-bottom: 1px solid var(--border-soft);
}

.rowExtra {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    padding-top: var(--space-2);
}

.imageURLField {
    min-width: 0;
}

.imageURLField > :global(.MuiTextField-root) {
    width: 100%;
}

.fileInput {
    display: none;
}

.uploadButton {
    display: inline-flex;
    height: 28px;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-input-strong);
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.uploadButton:hover:not(:disabled) {
    border-color: var(--primary-border);
    background: var(--primary-hover);
    color: var(--primary);
}

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

.uploadButton:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.advancedEditor,
.details > .fieldGrid {
    padding: var(--space-3);
}

.empty {
    display: grid;
    min-height: 48px;
    place-items: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 12px;
}

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

    .catalogMain {
        grid-template-columns: minmax(120px, 0.6fr) minmax(150px, 0.8fr) minmax(220px, 1.4fr) auto;
    }
}

@media (max-width: 720px) {
    .fieldGrid,
    .rowExtra,
    .catalogMain {
        grid-template-columns: 1fr;
    }

    .wideField {
        grid-column: auto;
    }

    .catalogMain > :global(button) {
        justify-self: end;
    }
}
