.course-pdf-viewer {
    display: grid;
    gap: 1rem;
}

.course-pdf-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 3rem;
}

.course-pdf-summary-info,
.course-pdf-summary-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.course-pdf-file-icon {
    color: #1d4ed8;
    font-size: 1.5rem;
}

.course-pdf-file-title {
    color: #1f2937;
    font-weight: 600;
}

.course-pdf-nav-chip:hover {
    border-color: #1d4ed8;
    color: #1d4ed8;
}

.course-pdf-button,
.course-pdf-download {
    display: inline-flex;
    min-width: 2.5rem;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    text-decoration: none;
}

.course-pdf-button i,
.course-pdf-download i {
    font-size: 1.25rem;
    line-height: 1;
}

.course-pdf-button:hover,
.course-pdf-download:hover {
    border-color: #1d4ed8;
    color: #1d4ed8;
}

.course-pdf-button:focus-visible,
.course-pdf-download:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}

.course-pdf-view-toggle {
    padding-inline: 1rem;
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #fff;
    font: inherit;
    font-weight: 600;
}

.course-pdf-view-toggle:hover {
    background: #1e40af;
    color: #fff;
}

.course-pdf-expanded[hidden],
.course-pdf-error[hidden],
.course-pdf-skeleton[hidden],
.course-pdf-status[hidden],
.course-pdf-toast[hidden] {
    display: none;
}

.course-pdf-expanded {
    width: 100%;
    min-width: 0;
}

.course-pdf-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .4rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding: .5rem;
    border: 1px solid #e5e7eb;
    border-radius: .75rem .75rem 0 0;
    background: #f9fafb;
}

.course-pdf-toolbar .course-pdf-button,
.course-pdf-toolbar .course-pdf-download {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.course-pdf-toolbar .course-pdf-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.course-pdf-page-label,
.course-pdf-zoom-label {
    flex: 0 0 auto;
    min-width: 3.75rem;
    color: #374151;
    text-align: center;
    white-space: nowrap;
}

.course-pdf-stage {
    position: relative;
    width: 100%;
    height: 600px;
    max-height: 75vh;
    min-height: 12rem;
    min-width: 0;
    overflow: auto;
    padding: .75rem;
    border: 1px solid #e5e7eb;
    border-top: 0;
    border-radius: 0 0 .75rem .75rem;
    background: #eef2f7;
    overscroll-behavior: contain;
}

.course-pdf-canvas-wrap {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    direction: ltr;
}

.course-pdf-page {
    display: grid;
    width: max-content;
    max-width: none;
    justify-items: center;
    background: #fff;
    box-shadow: 0 2px 12px rgb(15 23 42 / 18%);
    direction: ltr;
}

.course-pdf-page canvas {
    display: block;
    max-width: none;
    background: #fff;
    direction: ltr;
}

.course-pdf-skeleton {
    position: absolute;
    z-index: 1;
    inset: .75rem;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 1rem;
    border-radius: .5rem;
    background: linear-gradient(110deg, #eef2f6 8%, #f8fafc 18%, #eef2f6 33%);
    background-size: 200% 100%;
    color: #475569;
    animation: course-pdf-shimmer 1.4s linear infinite;
}

.course-pdf-skeleton-line {
    width: min(70%, 34rem);
    height: 1rem;
    border-radius: 1rem;
    background: rgb(148 163 184 / 25%);
}

.course-pdf-skeleton-line:last-child {
    width: min(48%, 24rem);
}

.course-pdf-status,
.course-pdf-error {
    padding: .75rem 1rem;
    color: #334155;
    text-align: center;
}

.course-pdf-error {
    color: #9f1239;
}

.course-pdf-error a {
    color: #1d4ed8;
    text-decoration: underline;
}

.course-pdf-toast {
    position: fixed;
    z-index: 60;
    inset-inline: 1rem;
    bottom: 1rem;
    width: fit-content;
    max-width: calc(100vw - 2rem);
    margin-inline: auto;
    padding: .75rem 1rem;
    border-radius: .75rem;
    background: #173c59;
    color: #fff;
    box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}

@keyframes course-pdf-shimmer {
    to { background-position-x: -200%; }
}

@media (prefers-reduced-motion: reduce) {
    .course-pdf-skeleton { animation: none; }
}

@media (max-width: 640px) {
    .course-pdf-summary {
        align-items: flex-start;
    }

    .course-pdf-summary-info {
        flex: 1 1 100%;
    }

    .course-pdf-summary-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .course-pdf-stage {
        height: 600px;
        max-height: 75vh;
        padding: .5rem;
    }

    .course-pdf-toolbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: .25rem;
        overflow-x: hidden;
        padding: .35rem;
    }

    .course-pdf-toolbar .course-pdf-button,
    .course-pdf-toolbar .course-pdf-download {
        flex-basis: 2.375rem;
        width: 2.375rem;
        height: 2.375rem;
        min-width: 2.375rem;
        min-height: 2.375rem;
    }

    .course-pdf-page-label,
    .course-pdf-zoom-label {
        min-width: 3.25rem;
    }
}
