.heading-actions,
.modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: rgba(5, 24, 27, .66);
    backdrop-filter: blur(3px);
}

.modal[hidden] {
    display: none;
}

.modal-panel {
    width: min(560px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    border-radius: 18px;
    padding: 26px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(7, 33, 38, .35);
    color: var(--ink);
}

.modal-panel-wide {
    width: min(1120px, calc(100% - 28px));
}

body.modal-open {
    overflow: hidden;
}

.modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.modal-heading h2 {
    margin: 2px 0 0;
    font-size: 27px;
}

.modal-close {
    border: 0;
    background: #edf2f3;
    color: #314750;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 4px;
}

.modal:not([hidden]) .modal-panel {
    animation: modal-in .16s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .modal-panel { width: 100%; padding: 20px; }
}
