.ml-preform-open {
    overflow: hidden;
}

.ml-preform-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    padding: 12px;
}

.ml-preform-overlay[hidden] {
    display: none;
}

.ml-preform-dialog {
    width: 100%;
    max-width: 560px;
    background: #f0f2f5;
    border-radius: 16px;
    border: 1px solid #d2e7da;
    box-shadow: 0 24px 45px rgba(0, 0, 0, 0.24);
    position: relative;
    overflow: hidden;
}

.ml-preform-head {
    background: #075e54;
    color: #ffffff;
    padding: 18px 20px 14px;
}

.ml-preform-head h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.ml-preform-head p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
}

.ml-preform-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.ml-preform-form {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.ml-preform-field {
    display: grid;
    gap: 6px;
}

.ml-preform-field label {
    font-size: 0.92rem;
    color: #1f2937;
    font-weight: 600;
}

.ml-preform-field input,
.ml-preform-field select,
.ml-preform-field textarea {
    width: 100%;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.95rem;
    color: #111827;
    background: #ffffff;
}

.ml-preform-field textarea {
    min-height: 100px;
    resize: vertical;
}

.ml-preform-field input:focus,
.ml-preform-field select:focus,
.ml-preform-field textarea:focus,
.ml-preform-close:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

.ml-preform-error {
    margin: 0;
    min-height: 20px;
    color: #b42318;
    font-size: 0.87rem;
}

.ml-preform-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.ml-preform-cancel,
.ml-preform-submit {
    border: 0;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.ml-preform-cancel {
    background: #e5e7eb;
    color: #111827;
}

.ml-preform-submit {
    background: #25d366;
    color: #073b2e;
}

@media (min-width: 640px) {
    .ml-preform-overlay {
        align-items: center;
        padding: 20px;
    }

    .ml-preform-form {
        padding: 18px;
    }

    .ml-preform-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}