.modal.pdf-viewer-modal {
    padding: 0.6rem;
    background: rgba(15, 23, 42, 0.72);
}

.modal.pdf-viewer-modal .modal-content {
    display: flex !important;
    flex-direction: column !important;
    width: min(1400px, calc(100vw - 1.2rem)) !important;
    max-width: min(1400px, calc(100vw - 1.2rem)) !important;
    height: calc(100dvh - 1.2rem) !important;
    max-height: calc(100dvh - 1.2rem) !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 0.85rem !important;
}

.modal.pdf-viewer-modal .modal-header {
    flex: 0 0 auto;
    padding: 0.7rem 0.9rem;
}

.modal.pdf-viewer-modal .modal-header h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
}

.modal.pdf-viewer-modal .modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden !important;
}

.pdf-viewer-shell,
.pdf-viewer-frame-wrap {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.pdf-viewer-shell {
    flex-direction: column;
}

.pdf-viewer-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.pdf-viewer-filename {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-viewer-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.4rem;
}

.pdf-viewer-action {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--background);
    color: var(--primary);
    cursor: pointer;
}

.pdf-viewer-action:hover,
.pdf-viewer-action:focus-visible {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.pdf-viewer-action svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.pdf-viewer-frame-wrap {
    background: #525659;
}

.pdf-viewer-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #525659;
}

.pdf-viewer-attachment {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--background);
}

.pdf-viewer-attachment span {
    padding: 0.25rem 0.4rem;
    border-radius: 0.35rem;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.72rem;
    font-weight: 800;
}

.pdf-viewer-email-hint {
    margin: 0.65rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

@media (max-width: 700px) {
    .modal.pdf-viewer-modal {
        padding: 0;
    }

    .modal.pdf-viewer-modal .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    .modal.pdf-viewer-modal .modal-header {
        padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 0.7rem 0.6rem;
    }

    .pdf-viewer-toolbar {
        padding: 0.45rem 0.6rem;
    }

    .pdf-viewer-action {
        width: 44px;
        height: 44px;
    }
}
