#pdfViewerTool .drop-zone {
    border: 2px dashed #9bb0c8;
    border-radius: 0.75rem;
    background: #f7fafc;
    padding: 1.25rem;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

#pdfViewerTool .drop-zone.is-dragover {
    border-color: #0d6efd;
    background: #e8f1ff;
}

#pdfViewerTool .stat-box {
    border: 1px solid #dee2e6;
    border-radius: 0.6rem;
    background: #fff;
    padding: 0.8rem;
    height: 100%;
}

#pdfViewerTool .stat-key {
    color: #6c757d;
    font-size: 0.86rem;
}

#pdfViewerTool .stat-value {
    font-weight: 600;
    word-break: break-word;
}

#pdfViewerTool .toolbar-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.7rem;
    align-items: start;
}

#pdfViewerTool .toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

#pdfViewerTool .toolbar-nav {
    grid-column: span 4;
}

#pdfViewerTool .toolbar-zoom {
    grid-column: span 4;
}

#pdfViewerTool .toolbar-search {
    grid-column: span 4;
}

#pdfViewerTool .toolbar-actions {
    grid-column: span 12;
    justify-content: space-between;
    gap: 0.75rem;
}

#pdfViewerTool .toolbar-actions .toolbar-group {
    gap: 0.45rem;
}

#pdfViewerTool .viewer-stage {
    border: 1px solid #d7dce2;
    border-radius: 0.75rem;
    background: #f2f5f8;
    height: min(76vh, 980px);
    overflow: auto;
    padding: 0.9rem;
    scroll-behavior: smooth;
}

#pdfViewerTool .pdf-page {
    position: relative;
    margin: 0 auto 1rem auto;
    background: #fff;
    border: 1px solid #d9dce1;
    box-shadow: 0 0.4rem 1.25rem rgba(33, 37, 41, 0.08);
}

#pdfViewerTool .pdf-page-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 249, 250, 0.92);
    border-bottom: 1px solid #e5e7ea;
    font-size: 0.82rem;
    color: #56606b;
    padding: 0.25rem 0.6rem;
    backdrop-filter: blur(4px);
}

#pdfViewerTool .pdf-canvas-wrap {
    position: relative;
}

#pdfViewerTool .pdf-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

#pdfViewerTool .pdf-text-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 1;
    text-size-adjust: none;
    forced-color-adjust: none;
    transform-origin: 0 0;
}

#pdfViewerTool .pdf-text-layer span,
#pdfViewerTool .pdf-text-layer br {
    color: transparent;
    position: absolute;
    transform-origin: 0 0;
    white-space: pre;
    cursor: text;
}

#pdfViewerTool .pdf-search-hit {
    background: #ffef8f;
    color: #1f2937;
    border-radius: 0.15rem;
    padding: 0;
}

#pdfViewerTool .pdf-search-hit.active {
    background: #f9c927;
    outline: 1px solid #9c6b00;
}

#pdfViewerTool .thumb-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    max-height: min(70vh, 900px);
    overflow: auto;
    padding-right: 0.25rem;
}

#pdfViewerTool .thumb-btn {
    border: 1px solid #ced4da;
    background: #fff;
    border-radius: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.45rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#pdfViewerTool .thumb-btn:hover,
#pdfViewerTool .thumb-btn:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

#pdfViewerTool .thumb-btn.is-active {
    border-color: #198754;
    box-shadow: 0 0 0 0.16rem rgba(25, 135, 84, 0.2);
}

#pdfViewerTool .thumb-btn canvas {
    width: 100%;
    height: auto;
    border: 1px solid #e6e8ea;
    background: #fff;
}

#pdfViewerTool .thumb-meta {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: #5c6670;
}

#pdfViewerTool .related-links a {
    margin-right: 1rem;
    display: inline-block;
    margin-bottom: 0.45rem;
}

@media (max-width: 1199.98px) {
    #pdfViewerTool .viewer-stage {
        height: min(68vh, 760px);
    }
}

@media (max-width: 991.98px) {
    #pdfViewerTool .toolbar-grid {
        grid-template-columns: 1fr;
    }

    #pdfViewerTool .toolbar-nav,
    #pdfViewerTool .toolbar-zoom,
    #pdfViewerTool .toolbar-search,
    #pdfViewerTool .toolbar-actions {
        grid-column: auto;
    }

    #pdfViewerTool .toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #pdfViewerTool .toolbar-actions > div {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    #pdfViewerTool .viewer-stage {
        padding: 0.45rem;
        border-radius: 0.55rem;
    }

    #pdfViewerTool .toolbar-group {
        gap: 0.35rem;
    }

    #pdfViewerTool .toolbar-group .btn,
    #pdfViewerTool .toolbar-group .form-control,
    #pdfViewerTool .toolbar-group .form-select {
        font-size: 0.84rem;
    }
}

@media (prefers-color-scheme: dark) {
    #pdfViewerTool .drop-zone {
        background: #212833;
        border-color: #4d6179;
    }

    #pdfViewerTool .drop-zone.is-dragover {
        background: #1a3a61;
        border-color: #71a6ff;
    }

    #pdfViewerTool .stat-box,
    #pdfViewerTool .thumb-btn,
    #pdfViewerTool .pdf-page {
        background: #1f242b;
        border-color: #3b4552;
    }

    #pdfViewerTool .viewer-stage {
        background: #11151a;
        border-color: #2d3743;
    }

    #pdfViewerTool .thumb-meta,
    #pdfViewerTool .stat-key,
    #pdfViewerTool .pdf-page-header {
        color: #b5c0ca;
    }

    #pdfViewerTool .pdf-page-header {
        background: rgba(38, 46, 56, 0.9);
        border-bottom-color: #3b4552;
    }
}
