/* PDF viewer reference layout */
body.page-home-records .doc-layer.pdf-mode {
    padding: 2rem 2.4rem 1.65rem !important;
    background: #f2f6ff !important;
}

body.page-home-records .doc-layer.pdf-mode .doc-canvas {
    overflow: visible;
}

body.page-home-records .doc-layer.pdf-mode #docHost,
body.page-home-records .doc-layer.pdf-mode #docHostPdf {
    height: 100%;
    min-height: 0;
}

body.page-home-records .xpdf-shell {
    height: 100%;
    padding: 0 !important;
    gap: 1.45rem;
    color: #0b1f42;
}

body.page-home-records .xpdf-breadcrumb-shell {
    flex: 0 0 auto;
    padding: 0 0.25rem;
}

body.page-home-records .xpdf-breadcrumbs {
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #7483a5;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

body.page-home-records .xpdf-hero {
    flex: 0 0 auto;
    overflow: visible;
    padding: 0 0.25rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-home-records .xpdf-hero::after {
    display: none;
}

body.page-home-records .xpdf-hero-main {
    align-items: center;
    gap: 1.25rem;
}

body.page-home-records .xpdf-hero-left {
    align-items: center;
    gap: 1.4rem;
    flex: 1 1 auto;
}

body.page-home-records .xpdf-back-btn {
    width: auto !important;
    min-width: 152px;
    height: 66px !important;
    flex: 0 0 auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    border-radius: 10px !important;
    border: 1px solid #d8e2f2 !important;
    background: #ffffff !important;
    color: #111c34 !important;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(18, 42, 82, 0.1) !important;
}

body.page-home-records .xpdf-back-btn i {
    font-size: 1.55rem;
}

body.page-home-records .xpdf-header-copy {
    gap: 0.55rem;
}

body.page-home-records .xpdf-title {
    color: #0a1d3d;
    font-size: clamp(1.55rem, 1.75vw, 2.05rem);
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: 0;
}

body.page-home-records .xpdf-meta-row {
    gap: 0.75rem;
}

body.page-home-records .xpdf-doc-chip {
    min-height: 30px;
    padding: 0 0.5rem;
    border-radius: 7px;
    background: #ffffff;
    color: #eb2d34;
    box-shadow: inset 0 0 0 1px #e7edf6, 0 5px 12px rgba(20, 45, 86, 0.08);
    font-size: 0.92rem;
}

body.page-home-records .xpdf-doc-chip i {
    font-size: 1.15rem;
}

body.page-home-records .xpdf-meta {
    color: #7381a3;
    font-size: 0.95rem;
}

body.page-home-records .xpdf-header-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0.85rem;
}

body.page-home-records .xpdf-action-btn {
    min-height: 62px;
    padding: 0 1.35rem;
    border-radius: 9px !important;
    font-size: 1rem;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(31, 76, 140, 0.08) !important;
}

body.page-home-records .xpdf-action-btn i {
    font-size: 1.25rem;
}

body.page-home-records .xpdf-action-btn.is-secondary {
    background: #ffffff !important;
    border-color: #8eb0e8 !important;
    color: #126cff !important;
}

body.page-home-records .xpdf-action-btn.is-dark {
    background: #082653 !important;
    color: #ffffff !important;
}

body.page-home-records .xpdf-action-btn.is-primary {
    background: #0d73ff !important;
    color: #ffffff !important;
}

body.page-home-records .xpdf-workspace {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 218px minmax(0, 1fr) 385px;
    border-radius: 22px !important;
    overflow: hidden;
    border: 1px solid #d9e1ef !important;
    background: #ffffff !important;
    box-shadow: 0 20px 50px rgba(17, 45, 91, 0.14) !important;
}

body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
    grid-template-columns: 72px minmax(0, 1fr) 385px;
}

body.page-home-records .xpdf-left-rail,
body.page-home-records .xpdf-right-panel {
    background: #fbfcff !important;
    backdrop-filter: none;
}

body.page-home-records .xpdf-left-head {
    min-height: 82px;
    padding: 1.25rem 1.75rem;
    align-items: center;
    background: #082b5d !important;
}

body.page-home-records .xpdf-left-kicker {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    opacity: 1;
}

body.page-home-records .xpdf-left-count {
    margin-top: 0.45rem;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
}

body.page-home-records .xpdf-rail-toggle {
    width: 48px;
    height: 82px;
    margin: -1.25rem -1.75rem -1.25rem 0;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    background: #061f46;
    color: #ffffff;
    font-size: 1.35rem;
}

body.page-home-records .xpdf-thumbs {
    padding: 1.35rem 1.2rem 1.6rem;
    gap: 1.05rem;
    scrollbar-color: #8b99b4 transparent;
}

body.page-home-records .xpdf-thumb {
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent !important;
    color: #18243a;
    box-shadow: none !important;
    transform: none !important;
}

body.page-home-records .xpdf-thumb-canvas-wrap {
    border-radius: 4px;
    border: 1px solid #dbe3f0;
    box-shadow: none;
}

body.page-home-records .xpdf-thumb:hover .xpdf-thumb-canvas-wrap,
body.page-home-records .xpdf-thumb.is-active .xpdf-thumb-canvas-wrap {
    border-color: #0d73ff;
    box-shadow: 0 0 0 3px #0d73ff;
}

body.page-home-records .xpdf-thumb-label {
    display: block;
    margin-top: 0.55rem;
    color: #172238;
    font-size: 1rem;
    text-align: center;
}

body.page-home-records .xpdf-center {
    background:
        linear-gradient(180deg, #1b3560 0%, #19335e 100%) top/100% 82px no-repeat,
        #dce6f7 !important;
}

body.page-home-records .xpdf-toolbar {
    min-height: 82px;
    padding: 0.75rem 1.3rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 1.1rem;
    overflow: hidden;
}

body.page-home-records .xpdf-toolbar-group {
    gap: 0.65rem;
    flex: 0 0 auto;
}

body.page-home-records .xpdf-toolbar-group + .xpdf-toolbar-group {
    padding-left: 1.1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.24);
}

body.page-home-records .xpdf-toolbar-group.is-search {
    flex: 1 1 auto;
    margin-left: 0;
}

body.page-home-records .xpdf-tool-btn,
body.page-home-records .xpdf-wide-btn,
body.page-home-records .xpdf-zoom-pill,
body.page-home-records .xpdf-page-pill,
body.page-home-records .xpdf-search-box {
    min-height: 52px;
    border-radius: 8px !important;
    border-color: transparent !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 20px rgba(4, 17, 38, 0.12) !important;
}

body.page-home-records .xpdf-tool-btn {
    min-width: 52px;
    padding: 0 0.85rem;
    font-size: 1.25rem;
}

body.page-home-records .xpdf-wide-btn {
    padding: 0 1rem;
    white-space: nowrap;
}

body.page-home-records .xpdf-zoom-pill,
body.page-home-records .xpdf-page-pill {
    padding: 0 0.85rem;
}

body.page-home-records .xpdf-zoom-pill input,
body.page-home-records .xpdf-page-pill input {
    color: #ffffff !important;
    font-size: 1rem;
}

body.page-home-records .xpdf-page-pill input {
    width: 42px;
}

body.page-home-records .xpdf-search-box {
    flex: 1 1 270px;
    min-width: 210px;
    max-width: 360px;
    padding: 0 1rem;
}

/* PDF viewer refinements */
body.page-home-records .xpdf-subtitle {
    display: none !important;
}

body.page-home-records .xpdf-workspace {
    grid-template-columns: 152px minmax(0, 1fr) 385px !important;
}

body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
    grid-template-columns: 56px minmax(0, 1fr) 385px !important;
}

body.page-home-records .xpdf-left-head {
    min-height: 66px !important;
    padding: 0.85rem 0.9rem !important;
}

body.page-home-records .xpdf-left-kicker {
    font-size: 0.82rem !important;
}

body.page-home-records .xpdf-left-count {
    margin-top: 0.25rem !important;
    font-size: 0.84rem !important;
}

body.page-home-records .xpdf-rail-toggle {
    width: 38px !important;
    height: 66px !important;
    margin: -0.85rem -0.9rem -0.85rem 0 !important;
    font-size: 1.05rem !important;
}

body.page-home-records .xpdf-thumbs {
    padding: 0.85rem 0.7rem 1rem !important;
    gap: 0.65rem !important;
}

body.page-home-records .xpdf-thumb-canvas-wrap {
    max-width: 92px !important;
    margin: 0 auto !important;
}

body.page-home-records .xpdf-thumb-label {
    margin-top: 0.35rem !important;
    font-size: 0.78rem !important;
}

body.page-home-records .xpdf-ai-card .xpdf-card-body,
body.page-home-records .xpdf-rag-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

body.page-home-records .xpdf-rag-body p {
    margin: 0;
}

body.page-home-records .xpdf-ai-btn {
    min-height: 44px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #082653;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-weight: 800;
}

body.page-home-records .xpdf-ai-btn:hover {
    background: #0d3b7b;
}

body.page-home-records .xpdf-ai-btn:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

body.page-home-records .xpdf-summary-refresh {
    margin-top: 0.85rem;
}

body.page-home-records .xpdf-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.page-home-records .xpdf-quick-btn {
    min-height: 82px !important;
}

@media (max-width: 1180px) {
    body.page-home-records .xpdf-workspace,
    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 1fr !important;
    }
}

/* Last-pass dark overrides for PDF viewer surfaces */
html[data-theme="dark"] body.page-home-records .doc-layer.pdf-mode,
body.page-home-records[data-theme="dark"] .doc-layer.pdf-mode {
    background:
        radial-gradient(circle at 88% 8%, rgba(70, 126, 224, 0.18), transparent 34%),
        linear-gradient(180deg, #071a34 0%, #0a2547 100%) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-breadcrumbs,
body.page-home-records[data-theme="dark"] .xpdf-breadcrumbs {
    background: rgba(121, 170, 247, 0.1) !important;
    color: #b7cff5 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero,
body.page-home-records[data-theme="dark"] .xpdf-hero {
    border-color: rgba(75, 111, 169, 0.62) !important;
    background:
        radial-gradient(circle at top right, rgba(72, 140, 255, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(20, 45, 82, 0.98), rgba(16, 37, 66, 0.96)) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(142, 186, 255, 0.09) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-title,
body.page-home-records[data-theme="dark"] .xpdf-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-meta,
html[data-theme="dark"] body.page-home-records .xpdf-meta-row,
body.page-home-records[data-theme="dark"] .xpdf-meta,
body.page-home-records[data-theme="dark"] .xpdf-meta-row {
    color: #9db6dc !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-back-btn,
html[data-theme="dark"] body.page-home-records .xpdf-action-btn.is-secondary,
body.page-home-records[data-theme="dark"] .xpdf-back-btn,
body.page-home-records[data-theme="dark"] .xpdf-action-btn.is-secondary {
    border-color: rgba(97, 134, 192, 0.62) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
    box-shadow:
        inset 0 1px 0 rgba(154, 194, 255, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-workspace,
body.page-home-records[data-theme="dark"] .xpdf-workspace {
    border-color: rgba(76, 114, 177, 0.72) !important;
    background: #0d274b !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-left-rail,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel,
body.page-home-records[data-theme="dark"] .xpdf-left-rail,
body.page-home-records[data-theme="dark"] .xpdf-right-panel {
    border-color: rgba(76, 114, 177, 0.58) !important;
    background: #0b2341 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-center,
html[data-theme="dark"] body.page-home-records .xpdf-stage,
body.page-home-records[data-theme="dark"] .xpdf-center,
body.page-home-records[data-theme="dark"] .xpdf-stage {
    background:
        linear-gradient(180deg, #1a3560 0%, #19335d 100%) top/100% 66px no-repeat,
        #142f56 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tool-btn,
html[data-theme="dark"] body.page-home-records .xpdf-wide-btn,
html[data-theme="dark"] body.page-home-records .xpdf-zoom-pill,
html[data-theme="dark"] body.page-home-records .xpdf-page-pill,
html[data-theme="dark"] body.page-home-records .xpdf-search-box,
body.page-home-records[data-theme="dark"] .xpdf-tool-btn,
body.page-home-records[data-theme="dark"] .xpdf-wide-btn,
body.page-home-records[data-theme="dark"] .xpdf-zoom-pill,
body.page-home-records[data-theme="dark"] .xpdf-page-pill,
body.page-home-records[data-theme="dark"] .xpdf-search-box {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(47, 73, 115, 0.88) !important;
    color: #edf5ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tabs,
html[data-theme="dark"] body.page-home-records .xpdf-tab-panel,
body.page-home-records[data-theme="dark"] .xpdf-tabs,
body.page-home-records[data-theme="dark"] .xpdf-tab-panel {
    border-color: rgba(76, 114, 177, 0.48) !important;
    background: #0b2341 !important;
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-thumbs,
body.page-home-records[data-theme="dark"] .xpdf-thumbs {
    background: #0b2341 !important;
    scrollbar-color: rgba(158, 188, 232, 0.78) rgba(8, 25, 48, 0.72);
}

html[data-theme="dark"] body.page-home-records .xpdf-thumb-label,
body.page-home-records[data-theme="dark"] .xpdf-thumb-label {
    color: #dbeaff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab,
body.page-home-records[data-theme="dark"] .xpdf-tab {
    color: #a8bfdf !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab.is-active,
body.page-home-records[data-theme="dark"] .xpdf-tab.is-active {
    color: #8fc0ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-body,
body.page-home-records[data-theme="dark"] .xpdf-card-body {
    border-color: rgba(97, 134, 192, 0.46) !important;
    background: rgba(16, 43, 78, 0.92) !important;
    color: #dbeaff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-title,
body.page-home-records[data-theme="dark"] .xpdf-card-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-summary-chip,
body.page-home-records[data-theme="dark"] .xpdf-summary-chip {
    background: rgba(128, 92, 210, 0.2) !important;
    color: #c6adff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-ai-btn,
html[data-theme="dark"] body.page-home-records .xpdf-quick-btn,
body.page-home-records[data-theme="dark"] .xpdf-ai-btn,
body.page-home-records[data-theme="dark"] .xpdf-quick-btn {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
}

/* Last-pass dark overrides for PDF viewer surfaces */
html[data-theme="dark"] body.page-home-records .doc-layer.pdf-mode,
body.page-home-records[data-theme="dark"] .doc-layer.pdf-mode {
    background:
        radial-gradient(circle at 88% 8%, rgba(70, 126, 224, 0.18), transparent 34%),
        linear-gradient(180deg, #071a34 0%, #0a2547 100%) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-breadcrumbs,
body.page-home-records[data-theme="dark"] .xpdf-breadcrumbs {
    background: rgba(121, 170, 247, 0.1) !important;
    color: #b7cff5 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero,
body.page-home-records[data-theme="dark"] .xpdf-hero {
    border-color: rgba(75, 111, 169, 0.62) !important;
    background:
        radial-gradient(circle at top right, rgba(72, 140, 255, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(20, 45, 82, 0.98), rgba(16, 37, 66, 0.96)) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(142, 186, 255, 0.09) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-title,
body.page-home-records[data-theme="dark"] .xpdf-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-meta,
html[data-theme="dark"] body.page-home-records .xpdf-meta-row,
body.page-home-records[data-theme="dark"] .xpdf-meta,
body.page-home-records[data-theme="dark"] .xpdf-meta-row {
    color: #9db6dc !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-back-btn,
html[data-theme="dark"] body.page-home-records .xpdf-action-btn.is-secondary,
body.page-home-records[data-theme="dark"] .xpdf-back-btn,
body.page-home-records[data-theme="dark"] .xpdf-action-btn.is-secondary {
    border-color: rgba(97, 134, 192, 0.62) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
    box-shadow:
        inset 0 1px 0 rgba(154, 194, 255, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-workspace,
body.page-home-records[data-theme="dark"] .xpdf-workspace {
    border-color: rgba(76, 114, 177, 0.72) !important;
    background: #0d274b !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-left-rail,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel,
body.page-home-records[data-theme="dark"] .xpdf-left-rail,
body.page-home-records[data-theme="dark"] .xpdf-right-panel {
    border-color: rgba(76, 114, 177, 0.58) !important;
    background: #0b2341 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-center,
html[data-theme="dark"] body.page-home-records .xpdf-stage,
body.page-home-records[data-theme="dark"] .xpdf-center,
body.page-home-records[data-theme="dark"] .xpdf-stage {
    background:
        linear-gradient(180deg, #1a3560 0%, #19335d 100%) top/100% 66px no-repeat,
        #142f56 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tool-btn,
html[data-theme="dark"] body.page-home-records .xpdf-wide-btn,
html[data-theme="dark"] body.page-home-records .xpdf-zoom-pill,
html[data-theme="dark"] body.page-home-records .xpdf-page-pill,
html[data-theme="dark"] body.page-home-records .xpdf-search-box,
body.page-home-records[data-theme="dark"] .xpdf-tool-btn,
body.page-home-records[data-theme="dark"] .xpdf-wide-btn,
body.page-home-records[data-theme="dark"] .xpdf-zoom-pill,
body.page-home-records[data-theme="dark"] .xpdf-page-pill,
body.page-home-records[data-theme="dark"] .xpdf-search-box {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(47, 73, 115, 0.88) !important;
    color: #edf5ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tabs,
html[data-theme="dark"] body.page-home-records .xpdf-tab-panel,
body.page-home-records[data-theme="dark"] .xpdf-tabs,
body.page-home-records[data-theme="dark"] .xpdf-tab-panel {
    border-color: rgba(76, 114, 177, 0.48) !important;
    background: #0b2341 !important;
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab,
body.page-home-records[data-theme="dark"] .xpdf-tab {
    color: #a8bfdf !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab.is-active,
body.page-home-records[data-theme="dark"] .xpdf-tab.is-active {
    color: #8fc0ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-title,
body.page-home-records[data-theme="dark"] .xpdf-card-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-summary-chip,
body.page-home-records[data-theme="dark"] .xpdf-summary-chip {
    background: rgba(128, 92, 210, 0.2) !important;
    color: #c6adff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-body,
body.page-home-records[data-theme="dark"] .xpdf-card-body {
    border: 1px solid rgba(97, 134, 192, 0.46) !important;
    background: rgba(16, 43, 78, 0.92) !important;
    color: #dbeaff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-ai-btn,
html[data-theme="dark"] body.page-home-records .xpdf-quick-btn,
body.page-home-records[data-theme="dark"] .xpdf-ai-btn,
body.page-home-records[data-theme="dark"] .xpdf-quick-btn {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-ai-btn:hover,
html[data-theme="dark"] body.page-home-records .xpdf-quick-btn:hover,
body.page-home-records[data-theme="dark"] .xpdf-ai-btn:hover,
body.page-home-records[data-theme="dark"] .xpdf-quick-btn:hover {
    background: rgba(28, 62, 110, 0.98) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-outline-item,
body.page-home-records[data-theme="dark"] .xpdf-outline-item {
    color: #dbeaff !important;
}

/* Final dark-mode polish for the PDF workspace */
html[data-theme="dark"] body.page-home-records .doc-layer.pdf-mode,
body.page-home-records[data-theme="dark"] .doc-layer.pdf-mode {
    background:
        radial-gradient(circle at 88% 8%, rgba(70, 126, 224, 0.18), transparent 34%),
        linear-gradient(180deg, #071a34 0%, #0a2547 100%) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-shell,
body.page-home-records[data-theme="dark"] .xpdf-shell {
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-breadcrumbs,
body.page-home-records[data-theme="dark"] .xpdf-breadcrumbs {
    background: rgba(121, 170, 247, 0.1) !important;
    color: #b7cff5 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-breadcrumbs .bi,
body.page-home-records[data-theme="dark"] .xpdf-breadcrumbs .bi {
    color: #8dbbff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero,
body.page-home-records[data-theme="dark"] .xpdf-hero {
    border-color: rgba(75, 111, 169, 0.62) !important;
    background:
        radial-gradient(circle at top right, rgba(72, 140, 255, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(20, 45, 82, 0.98), rgba(16, 37, 66, 0.96)) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(142, 186, 255, 0.09) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-title,
body.page-home-records[data-theme="dark"] .xpdf-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-meta,
html[data-theme="dark"] body.page-home-records .xpdf-meta-row,
body.page-home-records[data-theme="dark"] .xpdf-meta,
body.page-home-records[data-theme="dark"] .xpdf-meta-row {
    color: #9db6dc !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-back-btn,
html[data-theme="dark"] body.page-home-records .xpdf-action-btn.is-secondary,
body.page-home-records[data-theme="dark"] .xpdf-back-btn,
body.page-home-records[data-theme="dark"] .xpdf-action-btn.is-secondary {
    border-color: rgba(97, 134, 192, 0.62) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
    box-shadow:
        inset 0 1px 0 rgba(154, 194, 255, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-doc-chip,
body.page-home-records[data-theme="dark"] .xpdf-doc-chip {
    border: 1px solid rgba(255, 123, 123, 0.54) !important;
    background: rgba(128, 31, 31, 0.34) !important;
    color: #ff8a8a !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-workspace,
body.page-home-records[data-theme="dark"] .xpdf-workspace {
    border-color: rgba(76, 114, 177, 0.72) !important;
    background: #0d274b !important;
    box-shadow:
        inset 0 1px 0 rgba(139, 184, 255, 0.08),
        0 22px 50px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-left-rail,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel,
body.page-home-records[data-theme="dark"] .xpdf-left-rail,
body.page-home-records[data-theme="dark"] .xpdf-right-panel {
    border-color: rgba(76, 114, 177, 0.58) !important;
    background: #0b2341 !important;
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-left-head,
body.page-home-records[data-theme="dark"] .xpdf-left-head {
    background: #082b5d !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-rail-toggle,
body.page-home-records[data-theme="dark"] .xpdf-rail-toggle {
    background: #061f46 !important;
    color: #dbeaff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-thumbs,
body.page-home-records[data-theme="dark"] .xpdf-thumbs {
    background: #f6f8fd !important;
    scrollbar-color: rgba(99, 117, 148, 0.78) transparent;
}

html[data-theme="dark"] body.page-home-records .xpdf-thumb-label,
body.page-home-records[data-theme="dark"] .xpdf-thumb-label {
    color: #0f2244 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-center,
body.page-home-records[data-theme="dark"] .xpdf-center {
    background:
        linear-gradient(180deg, #1a3560 0%, #19335d 100%) top/100% 66px no-repeat,
        #142f56 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-toolbar,
body.page-home-records[data-theme="dark"] .xpdf-toolbar {
    background: transparent !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tool-btn,
html[data-theme="dark"] body.page-home-records .xpdf-wide-btn,
html[data-theme="dark"] body.page-home-records .xpdf-zoom-pill,
html[data-theme="dark"] body.page-home-records .xpdf-page-pill,
html[data-theme="dark"] body.page-home-records .xpdf-search-box,
body.page-home-records[data-theme="dark"] .xpdf-tool-btn,
body.page-home-records[data-theme="dark"] .xpdf-wide-btn,
body.page-home-records[data-theme="dark"] .xpdf-zoom-pill,
body.page-home-records[data-theme="dark"] .xpdf-page-pill,
body.page-home-records[data-theme="dark"] .xpdf-search-box {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(47, 73, 115, 0.88) !important;
    color: #edf5ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-zoom-pill input,
html[data-theme="dark"] body.page-home-records .xpdf-page-pill input,
html[data-theme="dark"] body.page-home-records .xpdf-search-box input,
body.page-home-records[data-theme="dark"] .xpdf-zoom-pill input,
body.page-home-records[data-theme="dark"] .xpdf-page-pill input,
body.page-home-records[data-theme="dark"] .xpdf-search-box input {
    color: #ffffff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-stage,
body.page-home-records[data-theme="dark"] .xpdf-stage {
    background: #142f56 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tabs,
body.page-home-records[data-theme="dark"] .xpdf-tabs {
    border-bottom-color: rgba(76, 114, 177, 0.48) !important;
    background: #f7f9fd !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab,
body.page-home-records[data-theme="dark"] .xpdf-tab {
    color: #425a82 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab.is-active,
body.page-home-records[data-theme="dark"] .xpdf-tab.is-active {
    color: #0f6fff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tab-panel,
body.page-home-records[data-theme="dark"] .xpdf-tab-panel {
    background: #f7f9fd !important;
    color: #1d2f54 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-title,
body.page-home-records[data-theme="dark"] .xpdf-card-title {
    color: #0e2244 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-summary-chip,
body.page-home-records[data-theme="dark"] .xpdf-summary-chip {
    background: #e8ddff !important;
    color: #7b55d8 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-body,
body.page-home-records[data-theme="dark"] .xpdf-card-body {
    background: #f0ebff !important;
    color: #3f3268 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-ai-btn,
html[data-theme="dark"] body.page-home-records .xpdf-quick-btn,
body.page-home-records[data-theme="dark"] .xpdf-ai-btn,
body.page-home-records[data-theme="dark"] .xpdf-quick-btn {
    border-color: rgba(185, 204, 236, 0.82) !important;
    background: #e8f0ff !important;
    color: #0d2e65 !important;
}

@media (max-width: 1180px) {
    body.page-home-records .xpdf-workspace,
    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 1fr !important;
    }
}

body.page-home-records .xpdf-toolbar .xpdf-page-pill {
    min-width: 112px;
    justify-content: center;
}

body.page-home-records .xpdf-toolbar .xpdf-page-pill input {
    text-align: center;
}

body.page-home-records .xpdf-search-box input,
body.page-home-records .xpdf-search-box input::placeholder {
    color: #ffffff !important;
    opacity: 1;
}

body.page-home-records .xpdf-search-status {
    min-width: 0;
    max-width: 74px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.85rem;
}

body.page-home-records .xpdf-stage {
    min-height: 0;
    padding: 1.45rem 1.6rem 1.65rem;
}

body.page-home-records .xpdf-scroll {
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-home-records .xpdf-viewer-surface {
    min-height: 100%;
    padding: 0.4rem 1.2rem 1.4rem;
}

body.page-home-records .xpdf-scroll .page {
    border-radius: 7px;
    box-shadow: 0 8px 22px rgba(24, 49, 92, 0.16) !important;
}

body.page-home-records .xpdf-right-panel {
    border-left: 1px solid #d9e1ef !important;
}

body.page-home-records .xpdf-tabs {
    min-height: 82px;
    border-bottom: 1px solid #e4e9f2 !important;
}

body.page-home-records .xpdf-tab {
    min-height: 82px;
    gap: 0.65rem;
    color: #4f5c78;
    font-size: 1rem;
    font-weight: 700;
}

body.page-home-records .xpdf-tab.is-active {
    color: #126cff !important;
    background: #ffffff !important;
    border-bottom-color: #126cff !important;
}

body.page-home-records .xpdf-tab-panel {
    padding: 1.65rem 1.55rem;
}

body.page-home-records .xpdf-tab-panel.is-active {
    gap: 1.55rem;
}

body.page-home-records .xpdf-card {
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.page-home-records .xpdf-card-title {
    margin-bottom: 1rem;
    color: #14213d;
    font-size: 1rem;
    font-weight: 850;
}

body.page-home-records .xpdf-card-head {
    display: block;
    margin-bottom: 0.75rem;
}

body.page-home-records .xpdf-summary-chip {
    min-height: 25px;
    padding: 0 0.7rem;
    background: #eee9ff;
    color: #7162ce;
    font-size: 0.76rem;
}

body.page-home-records .xpdf-card-body {
    padding: 1.1rem;
    border-radius: 4px;
    background: #f7f3ff;
    color: #3d4865;
    line-height: 1.85;
    font-size: 0.88rem;
}

body.page-home-records .xpdf-side-search {
    gap: 0.75rem;
}

body.page-home-records .xpdf-side-search input {
    min-height: 56px;
    border-radius: 8px;
    background: #ffffff;
}

body.page-home-records .xpdf-side-search-btn {
    width: 58px;
    height: 56px;
    border-radius: 8px;
    background: #082653;
    font-size: 1.35rem;
}

body.page-home-records .xpdf-quick-grid {
    gap: 0.45rem;
    padding: 0.55rem;
    border-radius: 8px;
    background: #edf4ff;
}

body.page-home-records .xpdf-quick-btn {
    min-height: 100px;
    border-radius: 8px;
    background: #e7eefb;
    color: #14213d;
    font-weight: 500;
    box-shadow: 0 5px 12px rgba(24, 49, 92, 0.08);
}

body.page-home-records .xpdf-quick-btn i {
    font-size: 1.45rem;
}

body.page-home-records .xpdf-outline-item {
    border-radius: 8px;
}

@media (max-width: 1500px) {
    body.page-home-records .xpdf-workspace {
        grid-template-columns: 190px minmax(0, 1fr) 340px;
    }

    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 72px minmax(0, 1fr) 340px;
    }

    body.page-home-records .xpdf-header-actions {
        flex-wrap: wrap;
    }

    body.page-home-records .xpdf-action-btn {
        min-height: 54px;
    }
}

@media (max-width: 1180px) {
    body.page-home-records .doc-layer.pdf-mode {
        padding: 1rem !important;
    }

    body.page-home-records .xpdf-workspace,
    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 170px minmax(0, 1fr);
    }

    body.page-home-records .xpdf-right-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    body.page-home-records .xpdf-hero-main,
    body.page-home-records .xpdf-hero-left {
        align-items: flex-start;
    }

    body.page-home-records .xpdf-back-btn {
        min-width: 132px;
    }

    body.page-home-records .xpdf-toolbar {
        flex-wrap: wrap;
        height: auto;
    }

    body.page-home-records .xpdf-toolbar-group + .xpdf-toolbar-group {
        border-left: 0;
        padding-left: 0;
    }
}

/* PDF viewer visual refinement pass */
body.page-home-records .doc-layer.pdf-mode {
    padding: 1.55rem 2.15rem 1.25rem !important;
    border-radius: 0 !important;
    background: #eef4ff !important;
}

body.page-home-records .doc-layer.pdf-mode .doc-canvas {
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.page-home-records .xpdf-shell {
    gap: 1.15rem;
}

body.page-home-records .xpdf-breadcrumb-shell,
body.page-home-records .xpdf-hero {
    max-width: none;
}

body.page-home-records .xpdf-breadcrumb-shell {
    padding: 0 0.15rem;
}

body.page-home-records .xpdf-breadcrumbs {
    color: #61729a !important;
    font-size: 0.94rem;
}

body.page-home-records .xpdf-hero {
    padding: 0 0.15rem !important;
}

body.page-home-records .xpdf-hero-main {
    min-height: 72px;
}

body.page-home-records .xpdf-back-btn {
    min-width: 152px;
    height: 64px !important;
    border-radius: 11px !important;
}

body.page-home-records .xpdf-title {
    font-size: clamp(1.65rem, 1.65vw, 2.18rem);
}

body.page-home-records .xpdf-meta-row {
    gap: 0.65rem;
}

body.page-home-records .xpdf-doc-chip {
    min-height: 30px;
}

body.page-home-records .xpdf-header-actions {
    gap: 0.72rem;
}

body.page-home-records .xpdf-action-btn {
    min-height: 60px;
    padding: 0 1.18rem;
    border-radius: 10px !important;
}

body.page-home-records .xpdf-action-btn.is-secondary {
    box-shadow: inset 0 0 0 1px rgba(18, 108, 255, 0.12), 0 10px 20px rgba(17, 65, 138, 0.08) !important;
}

body.page-home-records .xpdf-workspace {
    grid-template-columns: 216px minmax(680px, 1fr) 386px;
    border-radius: 22px !important;
    border-color: #d3deef !important;
    background: #ffffff !important;
    box-shadow: 0 18px 42px rgba(15, 44, 91, 0.13) !important;
}

body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
    grid-template-columns: 64px minmax(760px, 1fr) 386px;
}

body.page-home-records .xpdf-left-head,
body.page-home-records .xpdf-tabs,
body.page-home-records .xpdf-center {
    --xpdf-toolbar-height: 82px;
}

body.page-home-records .xpdf-left-head {
    min-height: var(--xpdf-toolbar-height);
    padding: 1.1rem 1.55rem;
    background: #082b5d !important;
}

body.page-home-records .xpdf-rail-toggle {
    width: 48px;
    height: var(--xpdf-toolbar-height);
    margin: -1.1rem -1.55rem -1.1rem 0;
}

body.page-home-records .xpdf-left-rail.is-collapsed .xpdf-left-head {
    justify-content: center;
    padding-inline: 0;
}

body.page-home-records .xpdf-left-rail.is-collapsed .xpdf-rail-toggle {
    width: 64px;
    margin: -1.1rem 0;
}

body.page-home-records .xpdf-left-rail.is-collapsed .xpdf-thumbs {
    display: none;
}

body.page-home-records .xpdf-thumbs {
    padding: 1.35rem 1rem 1.45rem;
}

body.page-home-records .xpdf-thumb {
    width: 100%;
}

body.page-home-records .xpdf-thumb-canvas-wrap {
    width: min(100%, 162px);
    margin: 0 auto;
    background: #ffffff;
}

body.page-home-records .xpdf-center {
    background:
        linear-gradient(180deg, #1a3560 0%, #19335d 100%) top/100% var(--xpdf-toolbar-height) no-repeat,
        #dce6f7 !important;
}

body.page-home-records .xpdf-toolbar {
    min-height: var(--xpdf-toolbar-height);
    display: grid;
    grid-template-columns: auto auto minmax(330px, 1fr);
    align-items: center;
    gap: 0.95rem;
    padding: 0.75rem 1.25rem;
    overflow: hidden;
}

body.page-home-records .xpdf-toolbar-group {
    min-width: 0;
}

body.page-home-records .xpdf-toolbar-group + .xpdf-toolbar-group {
    padding-left: 0.95rem;
}

body.page-home-records .xpdf-toolbar-group.is-search {
    justify-content: flex-end;
    width: 100%;
}

body.page-home-records .xpdf-tool-btn,
body.page-home-records .xpdf-wide-btn,
body.page-home-records .xpdf-zoom-pill,
body.page-home-records .xpdf-page-pill,
body.page-home-records .xpdf-search-box {
    min-height: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.13) !important;
}

body.page-home-records .xpdf-tool-btn {
    min-width: 52px;
}

body.page-home-records .xpdf-wide-btn {
    min-width: 166px;
}

body.page-home-records .xpdf-zoom-pill {
    min-width: 114px;
    justify-content: center;
}

body.page-home-records .xpdf-page-pill {
    min-width: 96px;
    justify-content: center;
    gap: 0.25rem;
}

body.page-home-records .xpdf-page-pill input {
    width: 34px;
    padding: 0;
}

body.page-home-records .xpdf-page-pill span {
    white-space: pre;
}

body.page-home-records .xpdf-search-box {
    flex: 1 1 auto;
    width: min(100%, 420px);
    max-width: 420px;
    min-width: 280px;
}

body.page-home-records .xpdf-search-box input {
    font-size: 0.95rem;
    min-width: 0;
}

body.page-home-records .xpdf-search-status:empty {
    display: none;
}

body.page-home-records .xpdf-stage {
    padding: 1.35rem 1.45rem 1.45rem;
}

body.page-home-records .xpdf-viewer-surface {
    padding: 0.15rem 0.75rem 1rem;
}

body.page-home-records .xpdf-scroll .page {
    border-radius: 5px;
    box-shadow: 0 10px 26px rgba(22, 47, 91, 0.15) !important;
}

body.page-home-records .xpdf-tabs {
    min-height: var(--xpdf-toolbar-height);
}

body.page-home-records .xpdf-tab {
    min-height: var(--xpdf-toolbar-height);
}

body.page-home-records .xpdf-right-panel {
    background: #fbfcff !important;
}

body.page-home-records .xpdf-tab-panel {
    padding: 1.45rem 1.5rem;
}

body.page-home-records .xpdf-tab-panel.is-active {
    gap: 1.35rem;
}

body.page-home-records .xpdf-side-search input {
    font-size: 0.95rem;
}

body.page-home-records .xpdf-card-body {
    /*max-height: 245px;*/
    overflow: hidden;
}

body.page-home-records .xpdf-quick-grid {
    padding: 0.5rem;
    gap: 0.5rem;
}

body.page-home-records .xpdf-quick-btn {
    min-height: 98px;
}

@media (max-width: 1700px) {
    body.page-home-records .xpdf-workspace {
        grid-template-columns: 216px minmax(560px, 1fr) 386px;
    }

    body.page-home-records .xpdf-toolbar {
        grid-template-columns: auto auto minmax(260px, 1fr);
        gap: 0.75rem;
    }

    body.page-home-records .xpdf-wide-btn {
        min-width: 150px;
    }

    body.page-home-records .xpdf-search-box {
        min-width: 235px;
    }
}

@media (max-width: 1450px) {
    body.page-home-records .xpdf-workspace,
    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 180px minmax(0, 1fr) 330px;
    }

    body.page-home-records .xpdf-toolbar {
        grid-template-columns: 1fr;
        align-content: center;
        min-height: auto;
        overflow: visible;
    }

    body.page-home-records .xpdf-center {
        background:
            linear-gradient(180deg, #1a3560 0%, #19335d 100%) top/100% auto no-repeat,
            #dce6f7 !important;
    }

    body.page-home-records .xpdf-toolbar-group + .xpdf-toolbar-group {
        border-left: 0;
        padding-left: 0;
    }

    body.page-home-records .xpdf-toolbar-group.is-search {
        justify-content: flex-start;
    }
}

/* PDF header follows Expedientes -> Documentos -> Visor pattern */
body.page-home-records .xpdf-shell {
    gap: 1rem;
}

body.page-home-records .xpdf-breadcrumb-shell {
    padding: 0;
}

body.page-home-records .xpdf-breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    background: rgba(16, 54, 115, 0.07) !important;
    color: #5c7297 !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.1em !important;
    line-height: 1;
    text-transform: uppercase !important;
}

body.page-home-records .xpdf-breadcrumbs .bi {
    font-size: 0.95rem;
    color: #0e58d0;
}

body.page-home-records .xpdf-hero {
    position: relative;
    overflow: hidden;
    padding: 20px 24px !important;
    border-radius: 26px !important;
    border: 1px solid rgba(181, 204, 234, 0.84) !important;
    background:
        radial-gradient(circle at top right, rgba(84, 144, 255, 0.18), transparent 26%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 244, 255, 0.94)) !important;
    box-shadow:
        0 20px 42px rgba(12, 39, 76, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

body.page-home-records .xpdf-hero::after {
    display: block;
    content: "";
    position: absolute;
    right: -60px;
    top: -70px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(57, 118, 235, 0.16), transparent 66%);
    pointer-events: none;
}

body.page-home-records .xpdf-hero-main {
    position: relative;
    z-index: 1;
    min-height: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

body.page-home-records .xpdf-hero-left {
    align-items: flex-start;
    gap: 18px;
    min-width: 0;
}

body.page-home-records .xpdf-back-btn {
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    flex: 0 0 56px !important;
    padding: 0;
    border-radius: 18px !important;
    border: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0c3d8f !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow:
        0 12px 24px rgba(15, 44, 88, 0.08),
        inset 0 0 0 1px rgba(182, 205, 237, 0.86) !important;
}

body.page-home-records .xpdf-back-btn i {
    font-size: 1.15rem;
}

body.page-home-records .xpdf-header-copy {
    gap: 0;
}

body.page-home-records .xpdf-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.page-home-records .xpdf-title {
    color: #0d2852 !important;
    font-size: clamp(2rem, 2.2vw, 3rem);
    line-height: 1;
    letter-spacing: -0.05em;
    font-weight: 800;
}

body.page-home-records .xpdf-record-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(29, 111, 255, 0.1);
    color: #1756bd;
    font-size: 0.82rem;
    font-weight: 800;
}

body.page-home-records .xpdf-record-tag[hidden] {
    display: none !important;
}

body.page-home-records .xpdf-meta-row {
    margin-top: 10px;
}

body.page-home-records .xpdf-subtitle {
    margin: 12px 0 0;
    max-width: 720px;
    color: #5c7598;
    font-size: 0.98rem;
    line-height: 1.65;
}

body.page-home-records .xpdf-header-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.page-home-records .xpdf-action-btn {
    min-height: 54px;
    padding: 0 20px;
    border-radius: 18px !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

body.page-home-records .xpdf-hero-meta {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px rgba(187, 208, 236, 0.82);
}

body.page-home-records .xpdf-hero-stat,
body.page-home-records .xpdf-hero-context {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

body.page-home-records .xpdf-hero-label {
    color: #6d82a4;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.page-home-records .xpdf-hero-stat strong,
body.page-home-records .xpdf-hero-context strong {
    color: #0f2c58;
    font-size: 1.08rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.page-home-records .xpdf-hero-stat strong {
    font-size: 1.32rem;
}

body.page-home-records .xpdf-hero-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(163, 185, 219, 0.84), transparent);
}

body.page-home-records .xpdf-workspace {
    border-radius: 26px !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-breadcrumbs,
body.page-home-records[data-theme="dark"] .xpdf-breadcrumbs {
    background: rgba(121, 170, 247, 0.1) !important;
    color: #b7cff5 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero,
body.page-home-records[data-theme="dark"] .xpdf-hero {
    border-color: rgba(75, 111, 169, 0.56) !important;
    background:
        radial-gradient(circle at top right, rgba(72, 140, 255, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(20, 45, 82, 0.98), rgba(16, 37, 66, 0.96)) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(142, 186, 255, 0.09) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-title,
body.page-home-records[data-theme="dark"] .xpdf-title,
html[data-theme="dark"] body.page-home-records .xpdf-hero-stat strong,
html[data-theme="dark"] body.page-home-records .xpdf-hero-context strong,
body.page-home-records[data-theme="dark"] .xpdf-hero-stat strong,
body.page-home-records[data-theme="dark"] .xpdf-hero-context strong {
    color: #eef5ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-subtitle,
html[data-theme="dark"] body.page-home-records .xpdf-hero-label,
body.page-home-records[data-theme="dark"] .xpdf-subtitle,
body.page-home-records[data-theme="dark"] .xpdf-hero-label {
    color: #a9c1e8 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-record-tag,
body.page-home-records[data-theme="dark"] .xpdf-record-tag {
    background: rgba(71, 129, 218, 0.18);
    color: #b7d3ff;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero-meta,
body.page-home-records[data-theme="dark"] .xpdf-hero-meta {
    background: rgba(12, 29, 54, 0.54) !important;
    box-shadow: inset 0 0 0 1px rgba(79, 114, 171, 0.52) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero-divider,
body.page-home-records[data-theme="dark"] .xpdf-hero-divider {
    background: linear-gradient(180deg, transparent, rgba(104, 135, 187, 0.72), transparent) !important;
}

@media (max-width: 1180px) {
    body.page-home-records .xpdf-hero-main {
        flex-direction: column;
    }

    body.page-home-records .xpdf-header-actions {
        justify-content: flex-start;
    }

    body.page-home-records .xpdf-hero-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    body.page-home-records .xpdf-hero {
        padding: 18px !important;
    }

    body.page-home-records .xpdf-title {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }

    body.page-home-records .xpdf-hero-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.page-home-records .xpdf-hero-divider {
        display: none;
    }
}

/* PDF compact header and responsive toolbar */
body.page-home-records .xpdf-hero {
    padding: 16px 20px !important;
}

body.page-home-records .xpdf-hero-main {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
}

body.page-home-records .xpdf-hero-left {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

body.page-home-records .xpdf-back-btn {
    width: 52px !important;
    min-width: 52px !important;
    height: 52px !important;
    flex-basis: 52px !important;
    border-radius: 16px !important;
}

body.page-home-records .xpdf-header-copy {
    min-width: 0 !important;
}

body.page-home-records .xpdf-title {
    font-size: clamp(1.6rem, 1.8vw, 2.45rem) !important;
    line-height: 1.05 !important;
}

body.page-home-records .xpdf-meta-row {
    margin-top: 8px !important;
}

body.page-home-records .xpdf-subtitle {
    margin-top: 8px !important;
    line-height: 1.45 !important;
}

body.page-home-records .xpdf-header-actions {
    align-items: center !important;
    align-self: center !important;
    gap: 10px !important;
}

body.page-home-records .xpdf-action-btn {
    min-height: 48px !important;
    padding: 0 16px !important;
    border-radius: 16px !important;
}

body.page-home-records .xpdf-toolbar {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    min-height: 0 !important;
    gap: 0.65rem !important;
    padding: 0.65rem 0.85rem !important;
    overflow: visible !important;
}

body.page-home-records .xpdf-toolbar-group {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    gap: 0.55rem !important;
}

body.page-home-records .xpdf-toolbar-group + .xpdf-toolbar-group {
    padding-left: 0.65rem !important;
}

body.page-home-records .xpdf-toolbar-group.is-search {
    flex: 1 1 300px !important;
    justify-content: flex-end !important;
}

body.page-home-records .xpdf-tool-btn,
body.page-home-records .xpdf-wide-btn,
body.page-home-records .xpdf-zoom-pill,
body.page-home-records .xpdf-page-pill,
body.page-home-records .xpdf-search-box {
    height: 48px !important;
    min-height: 48px !important;
}

body.page-home-records .xpdf-tool-btn {
    width: 48px !important;
    min-width: 48px !important;
    flex: 0 0 48px !important;
}

body.page-home-records .xpdf-wide-btn {
    min-width: 146px !important;
    max-width: 170px !important;
}

body.page-home-records .xpdf-zoom-pill {
    width: 104px !important;
    min-width: 104px !important;
}

body.page-home-records .xpdf-page-pill {
    width: 94px !important;
    min-width: 94px !important;
}

body.page-home-records .xpdf-search-box {
    flex: 1 1 220px !important;
    width: auto !important;
    min-width: 190px !important;
    max-width: 360px !important;
}

@media (max-width: 1320px) {
    body.page-home-records .xpdf-hero-main {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    body.page-home-records .xpdf-header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    body.page-home-records .xpdf-toolbar-group.is-search {
        flex-basis: 100% !important;
        justify-content: flex-start !important;
    }
}

@media (max-width: 980px) {
    body.page-home-records .xpdf-toolbar-group,
    body.page-home-records .xpdf-toolbar-group.is-search {
        flex: 1 1 100% !important;
        justify-content: flex-start !important;
        padding-left: 0 !important;
        border-left: 0 !important;
    }

    body.page-home-records .xpdf-search-box {
        max-width: none !important;
    }
}

@media (max-width: 640px) {
    body.page-home-records .xpdf-hero {
        padding: 14px !important;
    }

    body.page-home-records .xpdf-hero-left {
        align-items: flex-start !important;
    }

    body.page-home-records .xpdf-action-btn {
        flex: 1 1 100% !important;
        justify-content: center !important;
    }

    body.page-home-records .xpdf-wide-btn span,
    body.page-home-records .xpdf-search-box input::placeholder {
        font-size: 0.85rem !important;
    }
}

/* PDF compact toolbar controls */
body.page-home-records .xpdf-toolbar {
    gap: 0.5rem !important;
    padding: 0.55rem 0.7rem !important;
}

body.page-home-records .xpdf-toolbar-group {
    gap: 0.45rem !important;
}

body.page-home-records .xpdf-toolbar-group + .xpdf-toolbar-group {
    padding-left: 0.5rem !important;
}

body.page-home-records .xpdf-tool-btn,
body.page-home-records .xpdf-wide-btn,
body.page-home-records .xpdf-zoom-pill,
body.page-home-records .xpdf-page-pill,
body.page-home-records .xpdf-search-box {
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 12px !important;
}

body.page-home-records .xpdf-tool-btn {
    width: 42px !important;
    min-width: 42px !important;
    flex-basis: 42px !important;
    font-size: 0.95rem !important;
}

body.page-home-records .xpdf-wide-btn {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding: 0 !important;
    justify-content: center !important;
}

body.page-home-records .xpdf-wide-btn span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

body.page-home-records .xpdf-zoom-pill {
    width: 92px !important;
    min-width: 92px !important;
}

body.page-home-records .xpdf-page-pill {
    width: 86px !important;
    min-width: 86px !important;
}

body.page-home-records .xpdf-search-box {
    min-width: 180px !important;
    max-width: 300px !important;
}

body.page-home-records .xpdf-search-box input {
    font-size: 0.88rem !important;
}

@media (max-width: 1320px) {
    body.page-home-records .xpdf-toolbar-group.is-search {
        flex-basis: auto !important;
    }

    body.page-home-records .xpdf-search-box {
        display: none !important;
    }
}

/* Final PDF viewer overrides for the document workspace */
body.page-home-records .xpdf-subtitle {
    display: none !important;
}

body.page-home-records .xpdf-workspace {
    grid-template-columns: 152px minmax(0, 1fr) 385px !important;
}

body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
    grid-template-columns: 56px minmax(0, 1fr) 385px !important;
}

body.page-home-records .xpdf-left-head {
    min-height: 66px !important;
    padding: 0.85rem 0.9rem !important;
}

body.page-home-records .xpdf-left-kicker {
    font-size: 0.82rem !important;
}

body.page-home-records .xpdf-left-count {
    margin-top: 0.25rem !important;
    font-size: 0.84rem !important;
}

body.page-home-records .xpdf-rail-toggle {
    width: 38px !important;
    height: 66px !important;
    margin: -0.85rem -0.9rem -0.85rem 0 !important;
    font-size: 1.05rem !important;
}

body.page-home-records .xpdf-thumbs {
    padding: 0.85rem 0.7rem 1rem !important;
    gap: 0.65rem !important;
}

body.page-home-records .xpdf-thumb-canvas-wrap {
    max-width: 92px !important;
    margin: 0 auto !important;
}

body.page-home-records .xpdf-thumb-label {
    margin-top: 0.35rem !important;
    font-size: 0.78rem !important;
}

body.page-home-records .xpdf-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.page-home-records .xpdf-quick-btn {
    min-height: 82px !important;
}

/* Final dark-mode pass for the PDF workspace */
html[data-theme="dark"] body.page-home-records .doc-layer.pdf-mode,
body.page-home-records[data-theme="dark"] .doc-layer.pdf-mode {
    background:
        radial-gradient(circle at 88% 8%, rgba(70, 126, 224, 0.18), transparent 34%),
        linear-gradient(180deg, #071a34 0%, #0a2547 100%) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-breadcrumbs,
body.page-home-records[data-theme="dark"] .xpdf-breadcrumbs {
    background: rgba(121, 170, 247, 0.1) !important;
    color: #b7cff5 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-hero,
body.page-home-records[data-theme="dark"] .xpdf-hero {
    border-color: rgba(75, 111, 169, 0.62) !important;
    background:
        radial-gradient(circle at top right, rgba(72, 140, 255, 0.18), transparent 28%),
        linear-gradient(145deg, rgba(20, 45, 82, 0.98), rgba(16, 37, 66, 0.96)) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(142, 186, 255, 0.09) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-title,
body.page-home-records[data-theme="dark"] .xpdf-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-meta,
html[data-theme="dark"] body.page-home-records .xpdf-meta-row,
body.page-home-records[data-theme="dark"] .xpdf-meta,
body.page-home-records[data-theme="dark"] .xpdf-meta-row {
    color: #9db6dc !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-back-btn,
html[data-theme="dark"] body.page-home-records .xpdf-action-btn.is-secondary,
body.page-home-records[data-theme="dark"] .xpdf-back-btn,
body.page-home-records[data-theme="dark"] .xpdf-action-btn.is-secondary {
    border-color: rgba(97, 134, 192, 0.62) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
    box-shadow:
        inset 0 1px 0 rgba(154, 194, 255, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-workspace,
body.page-home-records[data-theme="dark"] .xpdf-workspace {
    border-color: rgba(76, 114, 177, 0.72) !important;
    background: #0d274b !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-left-rail,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel,
body.page-home-records[data-theme="dark"] .xpdf-left-rail,
body.page-home-records[data-theme="dark"] .xpdf-right-panel {
    border-color: rgba(76, 114, 177, 0.58) !important;
    background: #0b2341 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-center,
html[data-theme="dark"] body.page-home-records .xpdf-stage,
body.page-home-records[data-theme="dark"] .xpdf-center,
body.page-home-records[data-theme="dark"] .xpdf-stage {
    background:
        linear-gradient(180deg, #1a3560 0%, #19335d 100%) top/100% 66px no-repeat,
        #142f56 !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tool-btn,
html[data-theme="dark"] body.page-home-records .xpdf-wide-btn,
html[data-theme="dark"] body.page-home-records .xpdf-zoom-pill,
html[data-theme="dark"] body.page-home-records .xpdf-page-pill,
html[data-theme="dark"] body.page-home-records .xpdf-search-box,
body.page-home-records[data-theme="dark"] .xpdf-tool-btn,
body.page-home-records[data-theme="dark"] .xpdf-wide-btn,
body.page-home-records[data-theme="dark"] .xpdf-zoom-pill,
body.page-home-records[data-theme="dark"] .xpdf-page-pill,
body.page-home-records[data-theme="dark"] .xpdf-search-box {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(47, 73, 115, 0.88) !important;
    color: #edf5ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-tabs,
html[data-theme="dark"] body.page-home-records .xpdf-tab-panel,
body.page-home-records[data-theme="dark"] .xpdf-tabs,
body.page-home-records[data-theme="dark"] .xpdf-tab-panel {
    border-color: rgba(76, 114, 177, 0.48) !important;
    background: #0b2341 !important;
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-card-body,
body.page-home-records[data-theme="dark"] .xpdf-card-body {
    border: 1px solid rgba(97, 134, 192, 0.46) !important;
    background: rgba(16, 43, 78, 0.92) !important;
    color: #dbeaff !important;
}

@media (max-width: 1180px) {
    body.page-home-records .xpdf-workspace,
    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 1fr !important;
    }
}

/* Strong final override: PDF viewer right panel in dark mode */
html[data-theme="dark"] body.page-home-records .xpdf-workspace .xpdf-right-panel,
body.page-home-records[data-theme="dark"] .xpdf-workspace .xpdf-right-panel {
    border-color: rgba(76, 114, 177, 0.58) !important;
    background: #0b2341 !important;
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-tabs,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-tab-panel,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-tabs,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-tab-panel {
    border-color: rgba(76, 114, 177, 0.48) !important;
    background: #0b2341 !important;
    color: #eaf2ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-tab,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-tab {
    color: #a8bfdf !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-tab.is-active,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-tab.is-active {
    background: rgba(18, 43, 78, 0.98) !important;
    border-bottom-color: #2f84ff !important;
    color: #75b4ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-tab.is-active::before,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-tab.is-active::after,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-tab.is-active::before,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-tab.is-active::after {
    background: transparent !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-card-title,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-card-title {
    color: #f2f7ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-summary-chip,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-summary-chip {
    background: rgba(128, 92, 210, 0.22) !important;
    color: #cdb8ff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-card-body,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-card-body {
    border-color: rgba(97, 134, 192, 0.46) !important;
    background: rgba(16, 43, 78, 0.92) !important;
    color: #dbeaff !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-ai-btn,
html[data-theme="dark"] body.page-home-records .xpdf-right-panel .xpdf-quick-btn,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-ai-btn,
body.page-home-records[data-theme="dark"] .xpdf-right-panel .xpdf-quick-btn {
    border-color: rgba(97, 134, 192, 0.56) !important;
    background: rgba(18, 43, 78, 0.96) !important;
    color: #edf5ff !important;
}

/* Page-by-page PDF mode: the thumbnail pagination rail is intentionally removed. */
body.page-home-records .xpdf-workspace,
body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
    grid-template-columns: minmax(0, 1fr) 385px !important;
}

body.page-home-records .xpdf-left-rail {
    display: none !important;
}

@media (max-width: 1180px) {
    body.page-home-records .xpdf-workspace,
    body.page-home-records .xpdf-workspace:has(.xpdf-left-rail.is-collapsed) {
        grid-template-columns: 1fr !important;
    }
}

/* Current design pass: record-level AI actions in the PDF viewer header. */
body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"],
body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] {
    position: relative;
    isolation: isolate;
    min-height: 54px !important;
    padding: 0 1.1rem !important;
    border-radius: 14px !important;
    border: 1px solid rgba(118, 154, 212, 0.42) !important;
    overflow: hidden;
    font-size: 0.95rem !important;
    font-weight: 850 !important;
    letter-spacing: 0;
    box-shadow:
        0 14px 28px rgba(28, 72, 139, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.75) !important;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"]::before,
body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.9;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"] {
    background:
        radial-gradient(circle at 18% 0%, rgba(43, 119, 255, 0.2), transparent 35%),
        linear-gradient(135deg, #ffffff 0%, #eef5ff 100%) !important;
    color: #0b58d8 !important;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"]::before {
    background:
        linear-gradient(90deg, rgba(31, 98, 240, 0.16), transparent 38%),
        radial-gradient(circle at 95% 50%, rgba(90, 154, 255, 0.16), transparent 34%);
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] {
    border-color: rgba(12, 55, 125, 0.42) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(88, 186, 255, 0.28), transparent 35%),
        linear-gradient(135deg, #082a5a 0%, #0b3b86 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 16px 32px rgba(16, 64, 140, 0.26),
        inset 0 1px 0 rgba(142, 204, 255, 0.22) !important;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"]::before {
    background:
        linear-gradient(90deg, rgba(95, 212, 255, 0.16), transparent 38%),
        radial-gradient(circle at 95% 50%, rgba(104, 126, 255, 0.24), transparent 34%);
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"] i,
body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] i {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    flex: 0 0 auto;
    font-size: 1rem !important;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"] i {
    background: rgba(31, 98, 240, 0.11);
    color: #0b66f4;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] i {
    background: rgba(255, 255, 255, 0.14);
    color: #dff4ff;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"]:hover,
body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"]:hover {
    transform: translateY(-1px);
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"]:hover {
    border-color: rgba(31, 98, 240, 0.52) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(43, 119, 255, 0.25), transparent 35%),
        linear-gradient(135deg, #ffffff 0%, #e6f0ff 100%) !important;
    box-shadow:
        0 18px 34px rgba(28, 72, 139, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"]:hover {
    border-color: rgba(108, 202, 255, 0.58) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(88, 186, 255, 0.34), transparent 35%),
        linear-gradient(135deg, #09306a 0%, #0c47a0 100%) !important;
    box-shadow:
        0 20px 40px rgba(16, 64, 140, 0.34),
        0 0 26px rgba(46, 139, 255, 0.18),
        inset 0 1px 0 rgba(142, 204, 255, 0.26) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"],
body.page-home-records[data-theme="dark"] .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"] {
    border-color: rgba(111, 169, 255, 0.45) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(75, 157, 255, 0.22), transparent 36%),
        linear-gradient(135deg, rgba(15, 46, 87, 0.96), rgba(18, 58, 103, 0.92)) !important;
    color: #dcecff !important;
    box-shadow:
        0 16px 34px rgba(2, 10, 27, 0.38),
        inset 0 1px 0 rgba(154, 194, 255, 0.12) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"],
body.page-home-records[data-theme="dark"] .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] {
    border-color: rgba(68, 215, 255, 0.38) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(68, 215, 255, 0.24), transparent 36%),
        linear-gradient(135deg, rgba(7, 38, 78, 0.98), rgba(11, 55, 116, 0.94)) !important;
    color: #f5fbff !important;
    box-shadow:
        0 18px 38px rgba(2, 10, 27, 0.48),
        0 0 24px rgba(68, 215, 255, 0.12),
        inset 0 1px 0 rgba(142, 218, 255, 0.16) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"] i,
body.page-home-records[data-theme="dark"] .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"] i {
    background: rgba(75, 157, 255, 0.16);
    color: #8fc3ff;
}

html[data-theme="dark"] body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] i,
body.page-home-records[data-theme="dark"] .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] i {
    background: rgba(68, 215, 255, 0.14);
    color: #a8eeff;
}

html[data-theme="dark"] body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"]:hover,
body.page-home-records[data-theme="dark"] .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"]:hover {
    border-color: rgba(111, 169, 255, 0.64) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(75, 157, 255, 0.28), transparent 36%),
        linear-gradient(135deg, rgba(18, 56, 105, 0.98), rgba(21, 70, 124, 0.94)) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"]:hover,
body.page-home-records[data-theme="dark"] .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"]:hover {
    border-color: rgba(68, 215, 255, 0.58) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(68, 215, 255, 0.32), transparent 36%),
        linear-gradient(135deg, rgba(8, 46, 95, 1), rgba(13, 66, 138, 0.98)) !important;
}

@media (max-width: 980px) {
    body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-sum"],
    body.page-home-records .xpdf-header-actions .xpdf-action-btn[data-act="record-rag"] {
        flex: 1 1 220px;
        justify-content: center;
    }
}
/* Final PDF viewer right-panel layout: Resumen + RAG */
body.page-home-records .xpdf-shell {
    min-height: 0 !important;
    overflow: hidden !important;
    gap: 0.85rem !important;
}

body.page-home-records .xpdf-breadcrumb-shell {
    flex: 0 0 auto !important;
}

body.page-home-records .xpdf-hero {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body.page-home-records .xpdf-hero-main {
    min-width: 0 !important;
    min-height: 0 !important;
    align-items: center !important;
}

body.page-home-records .xpdf-hero-left,
body.page-home-records .xpdf-header-copy,
body.page-home-records .xpdf-title-wrap {
    min-width: 0 !important;
}

body.page-home-records .xpdf-header-copy {
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

body.page-home-records .xpdf-title-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.65rem !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

body.page-home-records .xpdf-title {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: clamp(1.38rem, 1.35vw, 2rem) !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
}

body.page-home-records .xpdf-record-tag {
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.page-home-records .xpdf-meta-row {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body.page-home-records .xpdf-meta {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.page-home-records .xpdf-header-actions {
    max-width: 48% !important;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn {
    min-height: 44px !important;
    max-width: 210px !important;
    padding: 0 0.9rem !important;
}

body.page-home-records .xpdf-header-actions .xpdf-action-btn span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.page-home-records .xpdf-workspace {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

body.page-home-records .xpdf-right-panel {
    min-height: 0 !important;
    overflow: hidden !important;
}

body.page-home-records .xpdf-tabs {
    min-height: 58px !important;
    flex: 0 0 58px !important;
}

body.page-home-records .xpdf-tab {
    min-height: 58px !important;
    font-size: 0.95rem !important;
}

body.page-home-records .xpdf-tab-panel {
    min-height: 0 !important;
    padding: 1rem !important;
    overflow: hidden !important;
}

body.page-home-records .xpdf-tab-panel.is-active {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

body.page-home-records .xpdf-summary-panel-card,
body.page-home-records .xpdf-rag-panel-card {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding: 1rem !important;
    border: 1px solid rgba(186, 205, 232, 0.58) !important;
    border-radius: 18px !important;
    background:
        radial-gradient(circle at 8% 0%, rgba(31, 98, 240, 0.08), transparent 34%),
        rgba(255, 255, 255, 0.74) !important;
    box-shadow: 0 14px 30px rgba(15, 44, 88, 0.08) !important;
}

body.page-home-records .xpdf-summary-panel-card .xpdf-card-head,
body.page-home-records .xpdf-rag-panel-card .xpdf-card-head {
    flex: 0 0 auto !important;
    margin-bottom: 0.85rem !important;
}

body.page-home-records .xpdf-summary-body,
body.page-home-records .xpdf-rag-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    border: 1px solid rgba(190, 205, 232, 0.52) !important;
    border-radius: 14px !important;
    background: rgba(248, 251, 255, 0.82) !important;
}

body.page-home-records .xpdf-summary-refresh {
    flex: 0 0 auto !important;
    margin-top: 0.85rem !important;
}

body.page-home-records .xpdf-rag-body {
    justify-content: center !important;
}

body.page-home-records .xpdf-quick-grid,
body.page-home-records .xpdf-quick-btn,
body.page-home-records .xpdf-outline-list {
    display: none !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-summary-panel-card,
html[data-theme="dark"] body.page-home-records .xpdf-rag-panel-card,
body.page-home-records[data-theme="dark"] .xpdf-summary-panel-card,
body.page-home-records[data-theme="dark"] .xpdf-rag-panel-card {
    border-color: rgba(97, 134, 192, 0.46) !important;
    background:
        radial-gradient(circle at 8% 0%, rgba(68, 215, 255, 0.1), transparent 34%),
        rgba(10, 31, 59, 0.78) !important;
    box-shadow: 0 14px 30px rgba(1, 8, 22, 0.22) !important;
}

html[data-theme="dark"] body.page-home-records .xpdf-summary-body,
html[data-theme="dark"] body.page-home-records .xpdf-rag-body,
body.page-home-records[data-theme="dark"] .xpdf-summary-body,
body.page-home-records[data-theme="dark"] .xpdf-rag-body {
    border-color: rgba(97, 134, 192, 0.42) !important;
    background: rgba(6, 22, 45, 0.72) !important;
    color: #dbeaff !important;
}

@media (max-width: 1440px) {
    body.page-home-records .xpdf-header-actions {
        max-width: 42% !important;
    }

    body.page-home-records .xpdf-header-actions .xpdf-action-btn {
        max-width: 178px !important;
    }
}

@media (max-width: 1180px) {
    body.page-home-records .xpdf-header-actions {
        max-width: none !important;
    }

    body.page-home-records .xpdf-title-wrap {
        grid-template-columns: 1fr !important;
    }
}
