.documents-popup-overlay{
    position:fixed;
    inset:0;
    z-index:12000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:36px;
    background:rgba(0,0,0,.82);
}

.documents-popup-overlay.hidden{
    display:none !important;
}

.documents-popup-window{
    position:relative;
    width:min(1120px,92vw);
    max-height:88vh;
    overflow-y:auto;
    background:#05070a;
    border:2px solid #d4af37;
    padding:30px;
    box-shadow:0 24px 90px rgba(0,0,0,.72);
}

.documents-popup-close{
    position:sticky;
    top:0;
    z-index:5;
    display:grid;
    place-items:center;
    width:30px;
    height:30px;
    margin:0 0 12px auto;
    background:#791a25;
    color:#f6ecd2;
    border:1px solid rgba(212,175,55,.75);
    cursor:pointer;
    font-size:18px;
}

.documents-popup-inner{
    max-width:820px;
    margin:0 auto;
    color:#f1e8d2;
    font-family:Georgia,serif;
}

.documents-popup-meta{
    margin:0 0 18px;
    color:#d4af37;
    font-size:14px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.09em;
}

.documents-popup-title{
    margin:0 0 16px;
    color:#f6ecd2;
    font-size:34px;
    line-height:1.12;
}

.documents-popup-subtitle{
    margin:0 0 34px;
    color:#f1e8d2;
    font-size:18px;
    line-height:1.45;
}

.documents-library-list{
    display:grid;
    gap:14px;
}

.documents-library-card{
    padding:18px 20px;
    border:1px solid rgba(212,175,55,.38);
    background:rgba(212,175,55,.035);
    cursor:pointer;
}

.documents-library-card:hover{
    background:rgba(212,175,55,.08);
}

.documents-library-card h3{
    margin:0 0 10px;
    color:#d4af37;
    font-size:21px;
    line-height:1.18;
}

.documents-library-card p{
    margin:0;
    color:#f1e8d2;
    font-size:15px;
    line-height:1.55;
}

.documents-reader-controls{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:flex-end;
    margin:0 0 32px;
    padding-bottom:18px;
    border-bottom:1px solid rgba(212,175,55,.22);
}

.documents-reader-controls button,
.documents-reader-download{
    min-height:38px;
    padding:8px 14px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#05070a;
    border:1px solid rgba(212,175,55,.55);
    color:#d4af37;
    font-family:Georgia,serif;
    font-size:14px;
    text-decoration:none;
    cursor:pointer;
}

.documents-reader-download{
    background:#d4af37;
    color:#05070a;
    font-weight:700;
}

.documents-reader-body{
    max-width:780px;
    margin:0 auto;
    color:#f1e8d2;
    font-family:Georgia,serif;
    font-size:18px;
    line-height:1.82;
}

.document-reader-text{
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    padding:0;
    margin:0;
    background:transparent;
    border:0;
    color:#f1e8d2;
    font-family:Georgia,serif;
    font-size:inherit;
    line-height:1.82;
}

.documents-reader-body p{
    margin:0 0 1.45em;
}

.documents-reader-body h1,
.documents-reader-body h2,
.documents-reader-body h3,
.documents-reader-body h4{
    color:#d4af37;
    line-height:1.2;
    margin:2.3em 0 .8em;
    padding-top:.85em;
    border-top:1px solid rgba(212,175,55,.24);
}

.document-reader-image-frame{
    margin:0 0 24px;
    border:1px solid rgba(212,175,55,.45);
}

.document-reader-image-frame img{
    display:block;
    width:100%;
    height:auto;
}

@media (max-width:760px){
    .documents-popup-overlay{
        padding:14px;
    }

    .documents-popup-window{
        width:96vw;
        max-height:90vh;
        padding:18px;
    }

    .documents-popup-title{
        font-size:25px;
    }

    .documents-popup-subtitle{
        font-size:16px;
    }

    .documents-reader-body{
        max-width:100%;
        font-size:16px;
        line-height:1.72;
    }

    .document-reader-text{
        line-height:1.72;
    }
}

.documents-qa-list{
    display:grid;
    gap:14px;
}

.documents-qa-item{
    border:1px solid rgba(212,175,55,.28);
    background:rgba(212,175,55,.025);
}

.documents-qa-question{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:16px 18px;
    background:#05070a;
    border:0;
    color:#d4af37;
    font-family:Georgia,serif;
    font-size:18px;
    font-weight:700;
    text-align:left;
    cursor:pointer;
}

.documents-qa-question strong{
    flex:0 0 auto;
    color:#f6ecd2;
    font-size:20px;
}

.documents-qa-answer{
    padding:0 18px 18px;
    color:#f1e8d2;
}

.documents-qa-answer.hidden{
    display:none;
}

.documents-qa-answer p{
    margin:0 0 1.1em;
}

.documents-library-group{
    margin:0 0 30px;
}

.documents-library-group-title{
    margin:0 0 14px;
    padding:0 0 8px;
    color:#d4af37;
    border-bottom:1px solid rgba(212,175,55,.35);
    font-family:Georgia,serif;
    font-size:22px;
    line-height:1.2;
    letter-spacing:.03em;
}

.documents-library-group-list{
    display:grid;
    gap:14px;
}

.documents-library-toolbar{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    margin:0 0 22px;
    padding-bottom:14px;
    border-bottom:1px solid rgba(212,175,55,.28);
    color:#d4af37;
    font-family:Georgia,serif;
    font-size:14px;
    font-weight:700;
}

.documents-library-toolbar button{
    min-height:34px;
    padding:7px 12px;
    background:#05070a;
    border:1px solid rgba(212,175,55,.55);
    color:#d4af37;
    font-family:Georgia,serif;
    cursor:pointer;
}

.documents-library-toolbar button.active{
    background:#d4af37;
    color:#05070a;
}

.documents-library-group{
    margin:0 0 22px;
}

.documents-library-group-toggle{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin:0 0 14px;
    padding:10px 0 9px;
    background:transparent;
    border:0;
    border-bottom:1px solid rgba(212,175,55,.35);
    color:#d4af37;
    font-family:Georgia,serif;
    font-size:22px;
    font-weight:700;
    line-height:1.2;
    text-align:left;
    cursor:pointer;
}

.documents-library-group-toggle strong{
    color:#f6ecd2;
    font-size:20px;
}

.documents-library-group-list{
    display:grid;
    gap:14px;
}

.documents-library-group-list.hidden{
    display:none;
}

.documents-library-size-large .documents-library-card{
    padding:18px 20px;
}

.documents-library-size-large .documents-library-card h3{
    font-size:21px;
}

.documents-library-size-large .documents-library-card p{
    display:block;
    font-size:15px;
}

.documents-library-size-medium .documents-library-card{
    padding:13px 16px;
}

.documents-library-size-medium .documents-library-card h3{
    margin-bottom:6px;
    font-size:18px;
}

.documents-library-size-medium .documents-library-card p{
    display:block;
    font-size:13px;
    line-height:1.45;
}

.documents-library-size-small .documents-library-card{
    padding:10px 13px;
}

.documents-library-size-small .documents-library-card h3{
    margin:0;
    font-size:15px;
    line-height:1.25;
}

.documents-library-size-small .documents-library-card p{
    display:none;
}

.documents-reader-back{
    margin-right:auto;
}

.documents-reader-window{
    width:min(1220px,94vw);
}

.documents-reader-top-actions{
    position:sticky;
    top:0;
    z-index:20;
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin:0 0 12px;
}

.documents-reader-top-actions .documents-popup-close{
    position:static;
    margin:0;
}

.documents-reader-layout{
    display:grid;
    grid-template-columns:220px 1fr;
    gap:28px;
}

.documents-reader-nav{
    position:sticky;
    top:52px;
    align-self:start;
    max-height:74vh;
    overflow-y:auto;
    padding-right:10px;
    border-right:1px solid rgba(212,175,55,.22);
}

.documents-reader-nav h3{
    margin:0 0 12px;
    color:#d4af37;
    font-family:Georgia,serif;
    font-size:16px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.documents-reader-nav-list{
    display:grid;
    gap:6px;
}

.documents-reader-nav-list button{
    width:100%;
    padding:7px 8px;
    background:transparent;
    border:0;
    color:rgba(246,236,210,.48);
    font-family:Georgia,serif;
    font-size:12px;
    line-height:1.25;
    text-align:left;
    cursor:pointer;
}

.documents-reader-nav-list button:hover,
.documents-reader-nav-list button.active{
    color:#d4af37;
    background:rgba(212,175,55,.06);
}

.documents-reader-search{
    min-height:38px;
    width:min(260px,100%);
    padding:8px 11px;
    background:#05070a;
    border:1px solid rgba(212,175,55,.55);
    color:#f6ecd2;
    font-family:Georgia,serif;
}

.documents-reader-search.hidden{
    display:none;
}

.documents-search-hidden{
    display:none !important;
}

@media (max-width:900px){
    .documents-reader-layout{
        display:block;
    }

    .documents-reader-nav{
        position:relative;
        top:auto;
        max-height:160px;
        margin:0 0 22px;
        padding:0 0 16px;
        border-right:0;
        border-bottom:1px solid rgba(212,175,55,.22);
    }
}

.documents-library-window{
    width:min(1220px,94vw);
}

.documents-library-layout{
    display:grid;
    grid-template-columns:220px 1fr;
    gap:28px;
}

.documents-library-main{
    max-width:860px;
}

.documents-library-nav{
    position:sticky;
    top:52px;
    align-self:start;
    max-height:74vh;
    overflow-y:auto;
    padding-right:10px;
    border-right:1px solid rgba(212,175,55,.22);
}

.documents-library-nav h3{
    margin:0 0 12px;
    color:#d4af37;
    font-family:Georgia,serif;
    font-size:16px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.documents-library-nav-list{
    display:grid;
    gap:6px;
}

.documents-library-nav-list button{
    width:100%;
    padding:7px 8px;
    background:transparent;
    border:0;
    color:rgba(246,236,210,.48);
    font-family:Georgia,serif;
    font-size:12px;
    line-height:1.25;
    text-align:left;
    cursor:pointer;
}

.documents-library-nav-list button:hover{
    color:#d4af37;
    background:rgba(212,175,55,.06);
}

.documents-library-card.active{
    outline:1px solid rgba(212,175,55,.9);
    background:rgba(212,175,55,.09);
}

.documents-library-search{
    min-height:38px;
    width:min(340px,100%);
    margin-right:auto;
    padding:8px 11px;
    background:#05070a;
    border:1px solid rgba(212,175,55,.55);
    color:#f6ecd2;
    font-family:Georgia,serif;
}

@media (max-width:900px){
    .documents-library-layout{
        display:block;
    }

    .documents-library-nav{
        position:relative;
        top:auto;
        max-height:160px;
        margin:0 0 22px;
        padding:0 0 16px;
        border-right:0;
        border-bottom:1px solid rgba(212,175,55,.22);
    }
}

/* Tighten long-document reader spacing */
.documents-reader-body{
    line-height:1.62;
}

.document-reader-text{
    line-height:1.62;
}

.documents-reader-body p{
    margin:0 0 .9em;
}

.documents-reader-body .document-reader-text{
    white-space:pre-wrap;
}

.documents-reader-body br + br{
    display:block;
    content:"";
    margin:.45em 0;
}

.documents-qa-answer p{
    margin:0 0 .75em;
}

.documents-qa-question{
    padding:13px 16px;
}

.documents-qa-answer{
    padding:0 16px 14px;
}

/* Plain-text document paragraph renderer */
.document-reader-paragraph{
    margin:0 0 .72em;
    line-height:1.58;
}

.document-reader-section-title{
    margin:0 0 1.05em;
    color:#d4af37;
    font-weight:700;
}

.document-reader-roman-heading{
    margin:1.35em 0 .55em;
    color:#f6ecd2;
    font-weight:700;
}

.document-reader-numbered{
    margin:0 0 .48em;
}

.document-reader-bullet{
    margin:0 0 .42em;
    padding-left:1.15em;
}

.document-reader-text{
    display:none;
}
