/* shared shell for every modal popup, built by js/modal.js */
.modal {
    position: fixed;
    inset: 0;
    /* above the site banner (1000) */
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.62);
    backdrop-filter: blur(4px);
}

.modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    max-height: min(92vh, 900px);
    overflow: hidden;
    color: #fff;
    background: var(--ohaz-grey, #2f2e2e);
    border: 1px solid #444;
    border-top: 4px solid var(--ohaz-yellow, #f8e109);
    border-radius: var(--ui-radius, 10px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    animation: modal-in 220ms ease-in;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #444;
}

.modal__header h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.modal__close {
    border: 0;
    padding: 4px 8px;
    color: #fff;
    background: transparent;
    font: 600 24px/1 "Clarity City", sans-serif;
    cursor: pointer;
}

.modal__close:hover,
.modal__close:focus-visible {
    color: var(--ohaz-yellow, #f8e109);
}

.modal__body {
    padding: 14px 16px;
    overflow: auto;
}

.modal__footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #444;
}

.modal__buttons {
    display: flex;
    gap: 8px;
}

.modal__button {
    flex: 1 1 0;
    min-width: 0;
    border: 1px solid var(--ohaz-yellow, #f8e109);
    padding: 10px 12px;
    color: var(--ohaz-grey, #2f2e2e);
    background: var(--ohaz-yellow, #f8e109);
    border-radius: var(--ui-radius-sm, 6px);
    font: 600 13px/1.2 "Clarity City", sans-serif;
    cursor: pointer;
}

.modal__button:hover,
.modal__button:focus-visible {
    background: #fff6a8;
}

.modal__close:focus-visible,
.modal__button:focus-visible {
    outline: 2px solid var(--ohaz-yellow, #f8e109);
    outline-offset: 2px;
}

.modal__status {
    min-height: 16px;
    margin: 8px 0 0;
    color: #c8c8c8;
    font-size: 11px;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .modal {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal__dialog,
    .modal__close,
    .modal__button {
        transition: none;
        animation: none;
    }
}
