.pydantic-form-grid {
    display: flex !important;
    flex-direction: column;
}

@container (min-width: 40rem) {
    .pydantic-form-grid {
        display: grid !important;
        grid-template-columns: repeat(var(--pydf-form-cols), minmax(0, 1fr));
    }
}

.pydantic-form-field {
    grid-column: span min(var(--pydf-field-cols), var(--pydf-form-cols));
}

[data-mantine-color-scheme="dark"] .ag-theme-alpine.ag-themed {
    color-scheme: dark;
    --ag-background-color: #181d1f;
    --ag-foreground-color: #fff;
    --ag-border-color: #68686e;
    --ag-secondary-border-color: rgba(88, 86, 82, 0.5);
    --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);
    --ag-header-background-color: #222628;
    --ag-tooltip-background-color: #222628;
    --ag-odd-row-background-color: #222628;
    --ag-control-panel-background-color: #222628;
    --ag-subheader-background-color: #000;
    --ag-input-disabled-background-color: #282c2f;
    --ag-input-focus-box-shadow: 0 0 2px 0.5px rgba(255, 255, 255, 0.5),
        0 0 4px 3px var(--ag-input-focus-border-color);
    --ag-card-shadow: 0 1px 20px 1px black;
    --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);
    --ag-chip-background-color: rgba(255, 255, 255, 0.07);
    --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);
    --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);
}

.ag-theme-alpine.ag-themed.read-only .ag-cell-focus:focus-within {
    --ag-range-selection-border-color: transparent !important;
}

.overflowing-ag-grid>div>div {
    overflow: visible !important;
}

.pydf-model-list-wrapper:empty:before {
    content: "No items";
    color: rgb(128, 128, 128);
    font-size: 14px;
    display: block;
}

.pydf-model-list-wrapper.required:empty {
    outline: solid red;
    border-radius: 0.25rem;
    margin: -0.5rem 0 -2.5rem -0.25rem;
    padding: 0.375rem 0.5rem 2rem;
}

.required_cell {
    background: rgba(255, 0, 0, 0.05);
    border-bottom: 2px solid var(--mantine-color-red-6) !important;
}

.pydf-markdown-preview {
    font-size: 14px;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 0.25rem;
    padding: 0.5rem 0.5rem 0;
    position: relative;
}

.pydf-markdown-preview::after {
    content: "Preview";
    position: absolute;
    top: 0;
    right: 0.25rem;
    color: var(--mantine-color-gray-5);
}

.transferlist-checkbox {
    border-radius: 0.25rem;
    transition: background-color 0.05s;
}

.transferlist-checkbox:hover {
    background-color: color-mix(in srgb, var(--mantine-color-gray-5), transparent 90%)
}

.pydf-model-list-accordion-item {
    & .pydf-model-list-accordion-item-delete {
        display: none;
        cursor: pointer;
    }
    &:hover .pydf-model-list-accordion-item-delete,
    &:has(*:focus) .pydf-model-list-accordion-item-delete,
    &:has(*:active) .pydf-model-list-accordion-item-delete {
        display: block;
    }
}

.pydf-model-list-modal-item {
    & .pydf-model-list-modal-item-btn {
        display: none;
        cursor: pointer;
    }
    &:hover .pydf-model-list-modal-item-btn,
    &:has(*:focus) .pydf-model-list-modal-item-btn,
    &:has(*:active) .pydf-model-list-modal-item-btn {
        display: block;
    }
}

.pydf-model-list-scalar-item {
    & .pydf-model-list-scalar-item-delete {
        --ai-size: 0 !important;
        overflow: hidden;
        transition: width 100ms;
        cursor: pointer;
    }
    &:hover .pydf-model-list-scalar-item-delete,
    &:has(*:focus) .pydf-model-list-scalar-item-delete,
    &:has(*:active) .pydf-model-list-scalar-item-delete {
        --ai-size: var(--ai-size-sm) !important;
        margin-left: 0.25rem;
    }
}

.read-only .mantine-Input-input {
    cursor: auto !important;
    --input-bd: transparent !important;

    &+.mantine-Select-section[data-position="right"] {
        opacity: 0;
    }
}

.read-only .mantine-Checkbox-input,
.read-only .mantine-Radio-radio {
    cursor: auto !important;
    border-color: var(--mantine-color-default-border);

    &:checked {
        background-color: var(--mantine-color-gray-filled);
    }
    &:checked + .mantine-Checkbox-icon,
    &:checked + .mantine-Radio-icon {
        color: var(--mantine-primary-color-contrast);
    }
}

.hover-clipboard {
    opacity: 0.4;
    cursor: pointer;

    &:hover {
        opacity: 0.75;
    }
}
.path-field-filter-input {
    padding-inline: 1.25rem 0.5rem;
    margin-left: 0.25rem;
    transition: background-color 250ms;

    &:hover,
    &:focus-visible,
    &:not([value=""]) {
        background-color: var(--mantine-color-gray-light);
    }
}
