#search{
    color:#000;
}

:host{
    display:block;
    width:100%;
    min-width:0;
    --viewer-bg:#eef2f6;
    --viewer-panel:#fff;
    --viewer-line:#d9e0e7;
    --viewer-text:#19212b;
    --viewer-muted:#6b7785;
    --viewer-accent:#1769e0;
    --viewer-accent-soft:#eaf2ff;
    --viewer-shadow:0 12px 34px rgba(20,35,55,.13)
}
.viewer-card,
.viewer-card *{
    box-sizing:border-box
}
.viewer-card button,
.viewer-card input{
    font:inherit
}
.viewer-card button{
    cursor:pointer
}

.viewer-card{
    margin-bottom:1.5rem;
    width:100%;
    min-width:0;
    overflow:hidden;
    background:#fff;
    border:1px solid var(--viewer-line);
    border-radius:18px;
    box-shadow:0 12px 35px rgba(20,35,55,.08)
}
.viewer-topbar{
    position:relative;
    min-width:0;
    width:100%;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px 14px;
    padding:14px;
    background:#fff;
    border-bottom:1px solid var(--viewer-line);
    z-index:100
}
.viewer-search-form{
    position:relative;
    flex:1 1 320px;
    width:auto;
    min-width:0;
    max-width:620px;
    margin:0
}
.viewer-search-form svg{
    position:absolute;
    left:12px;
    top:50%;
    transform:translateY(-50%);
    width:18px;
    height:18px;
    stroke:#7b8795;
    fill:none;
    stroke-width:2;
    pointer-events:none
}
.viewer-search-input{
    width:100%;
    height:42px;
    padding:0 40px;
    border:1px solid var(--viewer-line);
    border-radius:11px;
    outline:0;
    background:#f8fafc
}
.viewer-search-input:focus{
    background:#fff;
    border-color:#9abcf0;
    box-shadow:0 0 0 3px var(--viewer-accent-soft)
}
.viewer-clear-search{
    position:absolute;
    right:7px;
    top:7px;
    width:28px;
    height:28px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#7d8894;
    font-size:19px;
    text-decoration:none;
    display:grid;
    place-items:center
}
.viewer-clear-search:hover{background:#edf1f5}

.viewer-tools{
    flex:1 1 auto;
    min-width:0;
    max-width:100%;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-end;
    gap:8px
}
.viewer-group{
    max-width:100%;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px;
    padding:4px;
    border:1px solid var(--viewer-line);
    border-radius:11px;
    background:#fff
}
.viewer-icon-btn,
.viewer-nav-link{
    width:36px;
    height:36px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#364252;
    display:grid;
    place-items:center;
    text-decoration:none
}
.viewer-icon-btn:hover,
.viewer-nav-link:hover{
    background:#f2f5f8
}
.viewer-icon-btn.active{
    color:var(--viewer-accent);
    background:var(--viewer-accent-soft)
}
.viewer-icon-btn svg,
.viewer-nav-link svg{
    width:19px;
    height:19px;
    stroke:currentColor;
    fill:none;
    stroke-width:2
}
.viewer-nav-link.disabled{
    opacity:.32;
    pointer-events:none
}
.viewer-page-box{
    display:flex;
    align-items:center;
    gap:7px;
    padding:0 5px
}
.viewer-page-box input{
    width:58px;
    height:34px;
    border:1px solid var(--viewer-line);
    border-radius:8px;
    text-align:center;
    outline:0
}
.viewer-page-box input:focus{
    border-color:#9abcf0;
    box-shadow:0 0 0 3px var(--viewer-accent-soft)
}
.viewer-page-total,
.viewer-zoom-label{
    font-size:13px;
    color:var(--viewer-muted);
    white-space:nowrap
}

.viewer-main{
    width:100%;
    min-width:0;
    display:block;
    position:relative;
    background:var(--viewer-bg)
}
.viewer-scroll{
    width:100%;
    min-width:0;
    overflow:visible;
    padding:28px;
    display:flex;
    justify-content:center;
    align-items:flex-start
}
.viewer-stage{
    position:relative;
    width:100%;
    max-width:none;
    min-width:0;
    min-height:1px;
    flex:none;
    background:#fff;
    box-shadow:var(--viewer-shadow);
    border-radius:4px;
    overflow:hidden
}
.viewer-page-content{
    position:absolute;
    z-index:1;
    top:0;
    left:0;
    display:block;
    margin:0;
    padding:0;
    transform-origin:0 0;
    background:#fff;
    width:max-content;
    height:max-content
}

/*
 * Critical overrides for pdf2htmlEX.
 * Its original stylesheet expects #page-container to be a fullscreen viewer.
 * Here it lives inside our own viewer.
 */
.viewer-page-content #page-container,
.viewer-lens-content #page-container{
    position:relative!important;
    top:0!important;
    left:0!important;
    right:auto!important;
    bottom:auto!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    overflow:visible!important;
    background:none!important;
    width:max-content!important;
    height:max-content!important
}
.viewer-page-content .pf,
.viewer-lens-content .pf{
    margin:0!important;
    box-shadow:none!important
}

.viewer-page-loading{
    position:absolute;
    inset:0;
    z-index:10;
    display:grid;
    place-items:center;
    color:var(--viewer-muted);
    background:#fff
}
.viewer-page-loading[hidden]{
    display:none!important
}
.viewer-lens-overlay{
    position:absolute;
    inset:0;
    z-index:5;
    pointer-events:none;
    cursor:zoom-in
}
.viewer-lens-overlay.active{
    pointer-events:auto
}

.viewer-search-panel{
    position:absolute;
    top:12px;
    right:12px;
    width:min(450px,calc(100% - 24px));
    max-height:min(70vh,720px);
    display:flex;
    flex-direction:column;
    background:rgba(255,255,255,.98);
    border:1px solid var(--viewer-line);
    border-radius:14px;
    box-shadow:0 18px 45px rgba(20,35,55,.18);
    z-index:50;
    overflow:hidden
}
.viewer-search-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:13px 14px;
    border-bottom:1px solid var(--viewer-line)
}
.viewer-search-summary{
    font-size:13px;
    color:var(--viewer-muted)
}
.viewer-search-results{
    overflow:auto;
    padding:8px
}
.viewer-result{
    display:block;
    text-decoration:none;
    color:inherit;
    border-radius:10px;
    padding:10px 11px
}
.viewer-result:hover{background:#f4f7fa}
.viewer-result.active{background:var(--viewer-accent-soft)}
.viewer-result-page{
    font-size:12px;
    font-weight:700;
    color:var(--viewer-accent);
    margin-bottom:4px
}
.viewer-result-text{
    font-size:13px;
    line-height:1.45;
    color:#35404d
}
.viewer-result-text mark{
    background:#ffe991;
    padding:0 1px;
    border-radius:2px
}
.viewer-empty{
    padding:28px 18px;
    text-align:center;
    color:var(--viewer-muted);
    font-size:14px
}

.viewer-lens{
    position:fixed;
    width:230px;
    height:230px;
    border-radius:50%;
    border:4px solid #fff;
    box-shadow:
        0 12px 34px rgba(0,0,0,.28),
        0 0 0 1px rgba(0,0,0,.14);
    pointer-events:none;
    display:none;
    z-index:200;
    overflow:hidden;
    background:#fff
}
.viewer-lens.visible{display:block}
.viewer-lens-content{
    position:absolute;
    left:0;
    top:0;
    transform-origin:0 0;
    pointer-events:none;
    background:#fff;
    width:max-content;
    height:max-content
}
.viewer-toast{
    position:fixed;
    left:50%;
    bottom:22px;
    transform:translate(-50%,20px);
    padding:9px 13px;
    border-radius:10px;
    background:#17202a;
    color:#fff;
    opacity:0;
    pointer-events:none;
    transition:.18s ease;
    z-index:250;
    font-size:13px
}
.viewer-toast.show{
    opacity:1;
    transform:translate(-50%,0)
}
.viewer-error-banner{
    position:fixed;
    left:50%;
    top:82px;
    transform:translateX(-50%);
    z-index:300;
    background:#a82626;
    color:#fff;
    padding:10px 14px;
    border-radius:10px;
    box-shadow:0 8px 25px rgba(0,0,0,.18)
}


.bottom-pagination-wrap{
    padding:22px 18px 24px;
    background:#fff;
    border-top:1px solid var(--viewer-line)
}
.bottom-pagination{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:center;
    gap:6px;
    margin:0;
    padding:0;
    list-style:none
}
.bottom-pagination a,
.bottom-pagination span{
    min-width:38px;
    height:38px;
    padding:0 11px;
    border-radius:8px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    line-height:1;
    text-decoration:none;
    border:1px solid transparent;
    color:#374151;
    background:#fff
}
.bottom-pagination a:hover{
    color:var(--viewer-accent);
    background:#f7f9fc;
    border-color:#dbe3ec
}
.bottom-pagination .current{
    color:#fff;
    background:var(--viewer-accent);
    border-color:var(--viewer-accent);
    font-weight:700
}
.bottom-pagination .ellipsis{
    min-width:28px;
    padding:0 4px;
    color:#9aa4b2;
    background:transparent
}
.bottom-pagination .prev,
.bottom-pagination .next{
    min-width:auto;
    padding-inline:14px;
    font-weight:600
}
.bottom-pagination .disabled{
    color:#b7bec8;
    pointer-events:none;
    background:#fafbfc
}

@media(max-width:520px){
    .bottom-pagination-wrap{
        padding:16px 8px 18px
    }
    .bottom-pagination{
        gap:4px
    }
    .bottom-pagination a,
    .bottom-pagination span{
        min-width:34px;
        height:36px;
        padding-inline:8px;
        font-size:13px
    }
    .bottom-pagination .prev,
    .bottom-pagination .next{
        flex:1 1 auto;
    }
}

@media(max-width:900px){
    .viewer-topbar{
        align-items:stretch
    }
    .viewer-search-form{
        flex:1 1 100%;
        max-width:none
    }
    .viewer-tools{
        flex:1 1 100%;
        width:100%;
        justify-content:flex-start
    }
    .viewer-scroll{
        padding:16px
    }
}

@media(max-width:620px){
    .viewer-card{
        border-radius:12px
    }
    .viewer-topbar{
        padding:10px
    }
    .viewer-tools{
        gap:6px
    }
    .viewer-group{
        max-width:100%
    }
    .viewer-scroll{
        padding:10px
    }
    .viewer-lens{
        width:180px;
        height:180px
    }
    .viewer-zoom-label{
        display:none
    }
    .viewer-search-panel{
        top:8px;
        right:8px;
        width:calc(100% - 16px);
        max-height:calc(100% - 16px)
    }
}

@media(max-width:420px){
    .viewer-topbar{
        padding:8px
    }
    .viewer-tools{
        align-items:flex-start
    }
    .viewer-group{
        flex:1 1 auto
    }
    .viewer-page-box{
        padding-inline:2px
    }
    .viewer-page-box input{
        width:48px
    }
    .viewer-scroll{
        padding:6px
    }
}
