.blade-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 21000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.blade-modal.is-open {
    display: flex;
}

.blade-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.blade-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(600px, 100%);
    max-height: 92vh;
    overflow: hidden;
    border: 1px solid var(--siim-overlay-border, #dce2e8);
    border-radius: 6px;
    background: var(--siim-overlay-surface, #fff);
    box-shadow: var(--siim-overlay-shadow, 0 12px 36px rgba(15, 23, 42, 0.22));
}

.blade-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--siim-overlay-border, #dce2e8);
    background: var(--siim-overlay-header, #f4f6f8);
}

.blade-modal__header h2 {
    color: var(--siim-overlay-header-text, #fff);
}

.blade-modal__header h2 {
    margin: 0;
    font-size: 19px;
}

.blade-modal__content {
    overflow-y: auto;
}

.blade-modal__body {
    padding: 18px;
}

.blade-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--siim-overlay-border, #dce2e8);
    background: var(--siim-overlay-header, #f4f6f8);
}

.pdf-viewer-modal {
    width: min(720px, calc(100vw - 32px));
    height: min(540px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
}

.pdf-viewer-modal .blade-modal__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pdf-viewer-modal__body {
    flex: 1;
    min-height: 0;
}

.pdf-viewer-modal__body iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 575px) {
    .blade-modal {
        padding: 8px;
    }

    .blade-modal__dialog {
        max-height: 96vh;
    }

    .blade-modal__body {
        padding: 14px;
    }
}
