@media screen {
    :root { --preview-toolbar-height: 60px; }
    #mainContainer { min-width: 0; }
    #toolbarContainer, #toolbarViewer { height: var(--preview-toolbar-height); box-sizing: border-box; }
    #toolbarViewer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 7px 12px; }
    #toolbarViewerLeft, #toolbarViewerMiddle, #toolbarViewerRight { position: static; float: none; display: flex; align-items: center; gap: 4px; min-width: 0; padding: 0; margin: 0; transform: none; }
    #toolbarViewerLeft { grid-column: 1; grid-row: 1; }
    #toolbarViewerMiddle { grid-column: 2; grid-row: 1; }
    #toolbarViewerRight { grid-column: 3; grid-row: 1; justify-content: flex-end; }
    #toolbarViewer :is(.splitToolbarButton, .toolbarButton, .toolbarField, .toolbarLabel, .dropdownToolbarButton) { float: none; margin: 0; }
    #toolbarViewer .splitToolbarButton { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
    #toolbarViewer .toolbarButton { position: relative; width: 40px; height: 44px; flex: 0 0 40px; border-radius: 11px; cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease; }
    #toolbarViewer .toolbarButton::before { width: 18px; height: 18px; top: 13px; inset-inline-start: 11px; opacity: 1; }
    #toolbarViewer .toolbarButton:disabled { cursor: default; opacity: .32; }
    #toolbarViewer .toolbarButtonSpacer, #toolbarViewer .splitToolbarButtonSeparator { display: none; }
    #toolbarViewer .verticalToolbarSeparator { height: 22px; margin: 0 3px; }
    #toolbarViewer #pageNumber { width: 48px; height: 38px; box-sizing: border-box; border-radius: 10px; text-align: center; font: 700 14px/1.2 system-ui, sans-serif; padding: 6px 2px; }
    #toolbarViewer #numPages { white-space: nowrap; padding: 0 4px; font: 600 12px/1.2 system-ui, sans-serif; }
    #toolbarViewer #scaleSelectContainer { height: 40px; border-radius: 11px; overflow: hidden; flex-shrink: 1; min-width: 100px; }
    #toolbarViewer #scaleSelect { width: 100%; height: 40px; box-sizing: border-box; padding: 0 26px 0 12px; border-radius: 11px; cursor: pointer; font: 600 13px/1.2 system-ui, sans-serif; }
    #toolbarViewer .dropdownToolbarButton::after { top: 12px; inset-inline-end: 8px; }
    #viewerContainer:not(.pdfPresentationMode) { top: var(--preview-toolbar-height); }
    #sidebarContainer { inset-block-start: var(--preview-toolbar-height); }
    .findbar, .secondaryToolbar, .editorParamsToolbar { top: var(--preview-toolbar-height); border-radius: 12px; }
    .findbar { max-width: calc(100vw - 20px); box-sizing: border-box; }
    #loadingBar { height: 3px; }
    @media (max-width: 980px) {
        :root { --preview-toolbar-height: 108px; }
        #toolbarViewer { grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 44px 44px; gap: 4px; padding: 6px 10px; }
        #toolbarViewerLeft { grid-column: 1 / -1; justify-content: center; }
        #toolbarViewerMiddle { grid-column: 1; grid-row: 2; }
        #toolbarViewerRight { grid-column: 2; grid-row: 2; }
    }
    @media (max-width: 380px) {
        #toolbarViewer { padding-inline: 6px; }
        #toolbarViewer .toolbarButton { width: 36px; flex-basis: 36px; }
        #toolbarViewer .toolbarButton::before { inset-inline-start: 9px; }
        #toolbarViewerLeft { gap: 2px; }
        .findbar { inset-inline-start: 4px; min-width: 0; }
    }
    @media (prefers-reduced-motion: reduce) {
        #toolbarViewer .toolbarButton { transition: none; }
    }
}
@media screen and (forced-colors: none) {
    :root {
        --main-color: #34405b;
        --body-bg-color: #262626;
        --progressBar-color: #f33270;
        --progressBar-bg-color: #f3e8f3;
        --progressBar-blend-color: #c9b9ee;
        --scrollbar-color: #958ba6;
        --scrollbar-bg-color: #262626;
        --toolbar-icon-bg-color: #66718a;
        --toolbar-icon-hover-bg-color: #7952bd;
        --sidebar-narrow-bg-color: #faf7ff;
        --sidebar-toolbar-bg-color: #f3edfb;
        --toolbar-bg-color: #faf8ff;
        --toolbar-border-color: #e6deef;
        --button-hover-color: #eee5fa;
        --toggled-btn-color: #c72763;
        --toggled-btn-bg-color: #ffe6ef;
        --toggled-hover-active-btn-color: #ffd4e4;
        --dropdown-btn-bg-color: #f0e9fa;
        --separator-color: #e1d9eb;
        --field-color: #523f75;
        --field-bg-color: #fff;
        --field-border-color: #ded4eb;
        --treeitem-color: #4d4560;
        --treeitem-bg-color: #eee5fa;
        --treeitem-hover-color: #603b9b;
        --treeitem-selected-color: #a82559;
        --treeitem-selected-bg-color: #ffe6ef;
        --thumbnail-hover-color: #8b6ac544;
        --thumbnail-selected-color: #f3327077;
        --doorhanger-bg-color: #fff;
        --doorhanger-border-color: #e6deef;
        --doorhanger-hover-color: #603b9b;
        --doorhanger-hover-bg-color: #f3edfb;
        --doorhanger-separator-color: #ede6f4;
        --dialog-button-bg-color: #f0e9fa;
        --dialog-button-hover-bg-color: #e6d9f7;
        --loading-icon: url(images/loading.svg);
        color-scheme: light;
    }
    #toolbarContainer { background: linear-gradient(110deg, #fff8fb, #faf8ff 60%, #f5f0fc); border-bottom: 1px solid #e6deef; box-shadow: 0 3px 12px #30264a14; }
    #toolbarViewer .toolbarButton:hover:not(:disabled) { background: #eee5fa; }
    #toolbarViewer .toolbarButton.toggled { background: #ffe6ef; }
    #toolbarViewer #pageNumber { border: 1px solid #ded4eb; box-shadow: 0 2px 4px #38244f06; }
    #toolbarViewer #scaleSelectContainer { border: 1px solid #e3d8f0; }
    #toolbarViewer #download { background: #ffe6ef; }
    #toolbarViewer #download::before { background-color: #d72a64; }
    #toolbarViewer :is(button, input, select):focus-visible { outline: 2px solid #e73576; outline-offset: -2px; }
    .secondaryToolbar, .editorParamsToolbar, .findbar { border: 1px solid #e6deef; box-shadow: 0 8px 24px #30264a24; }
    .secondaryToolbarButton { border-radius: 8px; margin: 2px 5px; }
}
