html.ehr-pdf-popup-open,
body.ehr-pdf-popup-open {
    overflow: hidden !important;
}

.ehr-pdf-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    box-sizing: border-box;
}

.ehr-pdf-popup *,
.ehr-pdf-popup *::before,
.ehr-pdf-popup *::after {
    box-sizing: border-box;
}

.ehr-pdf-popup.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ehr-pdf-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7,20,43,.78);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.ehr-pdf-popup__window {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: min(1200px, calc(100vw - 48px));
    height: min(88vh, 900px);
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
    animation: ehrPdfPopupIn .18s ease-out;
}

@keyframes ehrPdfPopupIn {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ehr-pdf-popup__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 10px 14px 10px 18px;
    background: #102b62;
    color: #fff;
}

.ehr-pdf-popup__title {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ehr-pdf-popup__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ehr-pdf-popup__open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 5px;
    background: rgba(255,255,255,.08);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.ehr-pdf-popup__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.ehr-pdf-popup__body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #e9edf2;
}

.ehr-pdf-popup__body iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

.ehr-pdf-popup__loading {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    padding: 10px 16px;
    border-radius: 6px;
    transform: translate(-50%,-50%);
    background: #fff;
    color: #102b62;
    box-shadow: 0 5px 20px rgba(16,43,98,.12);
    font-size: 13px;
    font-weight: 700;
}

.ehr-pdf-popup__error {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: min(440px, calc(100% - 40px));
    padding: 20px;
    border-radius: 8px;
    transform: translate(-50%,-50%);
    background: #fff;
    color: #53657f;
    box-shadow: 0 10px 30px rgba(16,43,98,.15);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.ehr-pdf-popup__error a {
    color: #ed1455 !important;
    font-weight: 700;
    text-decoration: none !important;
}

@media (max-width:700px) {
    .ehr-pdf-popup__window {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        border-radius: 8px;
    }

    .ehr-pdf-popup__toolbar {
        min-height: 54px;
        padding-left: 13px;
    }

    .ehr-pdf-popup__open {
        display: none;
    }
}
