/* Backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

/* Visible state */
.modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Modal panel */
.modal-panel {
    width: 95%;
    max-width: 720px;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: auto;
    transform: translateY(10px) scale(0.995);
    transition: transform 200ms ease, opacity 200ms ease;
    opacity: 0;
    padding: 1rem;
}

/* When open: panel animates in */
.modal-backdrop.is-open .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header & close button */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: .25rem;
    border-radius: 6px;
}
.modal-close:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
}

/* Body */
.modal-body {
    padding-bottom: 0.5rem;
}

.modal-body p {
    white-space: pre-line;
}

/* Small utilities */
.slim-modal-footer {
    display:flex;
    gap:.5rem;
    justify-content: flex-end;
}

/* Make sure forms inside are responsive */
.modal-panel form {
    display: block;
}

/* Simple responsive */
@media (min-width: 640px) {
    .modal-panel { padding: 1.25rem; }
}