@layer base {
    dialog {
        color: var(--color-fg);
        background: none;
        border: none;
        max-height: fit-content;
        max-width: 100%;
        width: 100%;
        overscroll-behavior: contain;
        &::backdrop {
            overscroll-behavior: contain;
            background: oklch(0.98 0 0);
            opacity: .9;
        }
    }

    dialog:modal[open] {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        align-items: center;
    }
}

@layer components {
    dialog:has(.dialog\/close-form) {
        position: relative;
    }

    .dialog\/close-form {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    .dialog\/unsaved-changes {
        form {
            width: fit-content;
            text-align: center;
            margin-inline: auto;

            div {
                display: flex;
                flex-direction: row;
                gap: var(--space-neutral);
            }

            h4 {
                font-size: var(--font-size-xx-large);
                font-weight: 600;
            }

            button[value="discard"] {
                background: var(--color-error);
            }
        }
    }
}

