.ms-pdf-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 99999; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.ms-pdf-overlay.is-open { display: flex; opacity: 1; }
.ms-pdf-content { background: #fff; width: 90%; height: 90%; max-width: 1400px; position: relative; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.ms-pdf-close { position: absolute; top: 40px; right: 40px; background: none; border: none; color: #fff; cursor: pointer; padding: 5px; transition: transform 0.2s; z-index: 100000; }
.ms-pdf-close:hover { transform: scale(1.1); }
#ms-doc-container { flex-grow: 1; width: 100%; height: 100%; background: #f4f4f4; position: relative; }
.ms-pdf-footer { padding: 15px; background: #fff; border-top: 1px solid #eee; display: flex; justify-content: flex-end; }
.ms-pdf-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: #003366; color: #fff; text-decoration: none; font-weight: 500; font-size: 14px; transition: background 0.2s; }
.ms-pdf-btn:hover { background: #002244; color: #fff; }
.ms-pdf-iframe { width: 100%; height: 100%; border: none; display: block; }

@media (max-width: 768px) {
    .ms-pdf-overlay {
        height: 100dvh;
        align-items: stretch;
        justify-content: stretch;
    }
    .ms-pdf-content {
        width: 100%;
        height: 100%;
        max-height: none;
        max-width: none;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .ms-pdf-close {
        position: absolute;
        top: 10px;
        left: 6px;
        margin: 0;
        padding: 4px;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.4);
        border-radius: 0;
        z-index: 100001;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .ms-pdf-close svg {
        width: 24px;
        height: 24px;
    }
    .ms-pdf-footer {
        display: none; /* Ховаємо футер, щоб документ був на всю висоту */
    }
}
