.layout-alert {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.56);
}

body.layout-alert-open {
    overflow: hidden;
}

.layout-alert.is-open {
    display: flex;
}

.layout-alert__dialog {
    width: min(520px, 100%);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.layout-alert__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 8px;
}

.layout-alert__icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: #f8fafc;
    color: #111827;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.layout-alert__title {
    margin: 0;
    color: #111827;
    font-family: 'Manrope', 'Inter', Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
}

.layout-alert__message {
    margin: 0;
    padding: 2px 20px 18px 64px;
    color: #374151;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

.layout-alert__message--wide {
    padding-left: 20px;
}

.layout-alert__intro {
    margin: 0 0 12px;
}

.layout-alert-diff {
    display: grid;
    gap: 12px;
    max-height: min(52vh, 460px);
    overflow: auto;
    padding-right: 2px;
}

.layout-alert-diff__section {
    overflow: hidden;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
}

.layout-alert-diff__title {
    margin: 0;
    padding: 9px 12px;
    border-bottom: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.layout-alert-diff table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.layout-alert-diff th,
.layout-alert-diff td {
    padding: 8px 10px;
    border-top: 1px solid #edf2f7;
    border-right: 1px solid #edf2f7;
    vertical-align: top;
    overflow-wrap: anywhere;
    text-align: left;
}

.layout-alert-diff tr:first-child th {
    border-top: 0;
}

.layout-alert-diff th {
    background: #fbfdff;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.layout-alert-diff td {
    color: #111827;
    font-size: 12px;
}

.layout-alert-diff th:nth-child(2),
.layout-alert-diff td:nth-child(2) {
    background: #f8fbff;
}

.layout-alert-diff th:nth-child(3),
.layout-alert-diff td:nth-child(3) {
    background: #fffaf0;
}

.layout-alert-diff th:last-child,
.layout-alert-diff td:last-child {
    border-right: 0;
}

.layout-alert-diff__field {
    width: 25%;
    color: #334155;
    font-weight: 800;
}

.layout-alert-diff__foot {
    margin: 12px 0 0;
    color: #334155;
    font-weight: 700;
}

.layout-alert__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.layout-alert__btn {
    border-radius: 8px;
    white-space: nowrap;
}

.layout-alert--danger .layout-alert__icon {
    background: #fff1f2;
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px #fecdd3;
}

.layout-alert--danger [data-layout-alert-ok] {
    background: #ffd400;
    color: #000000;
}

.layout-alert--danger [data-layout-alert-ok]:hover,
.layout-alert--danger [data-layout-alert-ok]:focus {
    background: #b91c1c;
    color: #ffffff;
}

.layout-alert--success .layout-alert__icon {
    background: #f0fdf4;
    color: #15803d;
    box-shadow: inset 0 0 0 1px #bbf7d0;
}

@media (max-width: 520px) {
    .layout-alert {
        align-items: flex-end;
        padding: 12px;
    }

    .layout-alert__dialog {
        border-radius: 10px;
    }

    .layout-alert__message {
        padding-left: 20px;
    }

    .layout-alert-diff th,
    .layout-alert-diff td {
        padding: 7px;
    }

    .layout-alert__actions {
        flex-direction: column-reverse;
    }

    .layout-alert__btn {
        width: 100%;
    }
}
