/* ============================================================
   PUBLIC DOCUMENTATION PAGE
   Catalog cards, modal category tree, files and publications
   ============================================================ */

.documents-statistics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.documents-statistics span {
    padding: 9px 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    font-size: 14px;
}

.documentation-section {
    background: #fffaf5;
}

/* Main category cards */

.docs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 24px;
}

.doc-card {
    display: flex;
    min-width: 0;
    min-height: 390px;
    flex-direction: column;
    padding: 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.doc-card:hover {
    transform: translateY(-4px);
    border-color: rgba(128, 130, 70, .4);
    box-shadow: 0 20px 46px rgba(110, 82, 55, .12);
}

.doc-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.doc-card-title-row h2 {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-size: 21px;
    line-height: 1.3;
}

.doc-card-count {
    display: inline-flex;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 0 11px;
    color: #fff;
    background: var(--secondary);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
}

.doc-card-count small {
    font-size: 10px;
    font-weight: 700;
    opacity: .8;
}

.doc-card-description {
    min-height: 44px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.doc-card-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.doc-preview-caption {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.doc-preview-row {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    background: #fffaf5;
    border: 1px solid #f6ead9;
    border-radius: 12px;
}

.doc-preview-triangle {
    width: 0;
    height: 0;
    flex: 0 0 auto;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid var(--secondary);
}

.doc-preview-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-preview-number {
    display: grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    color: var(--secondary-dark);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.doc-card-empty {
    display: grid;
    min-height: 100px;
    padding: 18px;
    place-items: center;
    color: var(--muted);
    background: #fffaf5;
    border: 1px dashed var(--line);
    border-radius: 14px;
    text-align: center;
}

.doc-card-open {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
    padding: 0 18px;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s ease;
}

.doc-card-open:hover {
    background: var(--primary-dark);
}

/* Large modal */

.documents-dialog {
    width: min(1380px, calc(100% - 20px));
    height: 94vh;
    max-width: none;
    max-height: 94vh;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(11, 35, 45, .3);
}

.documents-dialog::backdrop {
    background: rgba(13, 31, 42, .68);
    backdrop-filter: blur(5px);
}

.documents-dialog-panel {
    display: flex;
    height: 94vh;
    max-height: 94vh;
    flex-direction: column;
}

.documents-dialog-header {
    display: flex;
    min-height: 68px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 20px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--secondary),
        var(--secondary-dark)
    );
}

.documents-dialog-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.documents-dialog-title h2 {
    overflow: hidden;
    margin: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.documents-dialog-title > span {
    flex: 0 0 auto;
    padding: 6px 10px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.documents-dialog-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
    font-size: 25px;
    cursor: pointer;
}

.documents-dialog-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
    background: #fffaf5;
    border-bottom: 1px solid var(--line);
}

.documents-dialog-search {
    display: flex;
    width: min(420px, 100%);
    min-height: 40px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.documents-dialog-search svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--secondary);
    stroke-width: 2;
}

.documents-dialog-search input {
    width: 100%;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 14px;
}

.documents-dialog-actions {
    display: flex;
    gap: 7px;
}

.documents-dialog-toolbar button {
    padding: 8px 13px;
    color: var(--secondary-dark);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.documents-dialog-body {
    min-height: 0;
    flex: 1 1 auto;
    padding: 12px 18px 20px;
    overflow-y: auto;
}

/* Recursive category tree */

.documents-tree {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.documents-tree-node {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.documents-tree-node > summary {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 11px;
    padding: 7px 11px;
    list-style: none;
    cursor: pointer;
    transition: background .2s ease;
}

.documents-tree-node > summary::-webkit-details-marker {
    display: none;
}

.documents-tree-node > summary:hover {
    background: var(--soft);
}

.documents-tree-node[open] > summary {
    background: var(--soft);
    border-bottom: 1px solid var(--line);
}

.documents-tree-triangle {
    width: 0;
    height: 0;
    flex: 0 0 auto;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--secondary);
    transition: transform .2s ease;
}

.documents-tree-node[open] > summary .documents-tree-triangle {
    transform: rotate(90deg);
}

.documents-tree-triangle.is-disabled {
    opacity: .25;
}

.documents-tree-folder {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--accent);
    background: rgba(255, 155, 32, .1);
    border-radius: 9px;
}

.documents-tree-folder svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.documents-tree-title {
    min-width: 0;
    flex: 1;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.documents-tree-count {
    display: grid;
    min-width: 27px;
    height: 27px;
    padding: 0 8px;
    place-items: center;
    color: var(--secondary-dark);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.documents-tree-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px 8px 8px 22px;
    background: #fffaf5;
}

.documents-tree-empty-category {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 11px;
    padding: 7px 11px;
    color: var(--muted);
    background: #fffaf5;
    border: 1px dashed var(--line);
    border-radius: 14px;
}

/* File rows */

.documents-file-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.documents-material {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.documents-material-main {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 6px 9px;
}

.document-format {
    display: inline-grid;
    min-width: 58px;
    min-height: 27px;
    flex: 0 0 auto;
    padding: 4px 7px;
    place-items: center;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .03em;
}

.format-pdf {
    color: #c73535;
    background: #fff0f0;
}

.format-word {
    color: #808246;
    background: #fff5e8;
}

.format-excel {
    color: #808246;
    background: #f1eddb;
}

.format-powerpoint {
    color: #c45325;
    background: #fff1e9;
}

.format-video {
    color: #fff;
    background: #e04444;
}

.format-post {
    color: #a85a00;
    background: #fff1da;
}

.format-image {
    color: #808246;
    background: #f3edff;
}

.format-link {
    color: var(--secondary-dark);
    background: var(--soft);
}

.format-archive,
.format-file {
    color: #686b5c;
    background: #f8eedf;
}

.documents-material-info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.documents-material-info strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.documents-material-info span {
    color: var(--muted);
    font-size: 12px;
}

.documents-storage-warning,
.documents-size-warning {
    margin-top: 7px;
    padding: 8px 10px;
    border: 1px solid #f1c56b;
    border-radius: 8px;
    color: #6e4b00;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    background: #fff7df;
}

.documents-size-warning {
    border-color: #efa38f;
    color: #823825;
    background: #fff0ec;
}

.documents-material-action a,
.documents-material-action button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    color: var(--secondary-dark);
    background: var(--soft);
    border: 1px solid #eadcc8;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.documents-material-unavailable {
    color: var(--muted);
    font-size: 12px;
}

/* Publication list */

.documents-post-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.documents-post-list-item {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.documents-post-list-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px;
}

.documents-post-thumbnail {
    width: 130px;
    height: 82px;
    flex: 0 0 auto;
    overflow: hidden;
    background: #fff5e8;
    border-radius: 11px;
}

.documents-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.documents-video-placeholder,
.documents-post-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #fff;
    background: var(--secondary);
    font-size: 12px;
    font-weight: 800;
}

.documents-video-placeholder {
    background: #e14848;
}

.documents-video-placeholder span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    background: rgba(255, 255, 255, .2);
    border-radius: 50%;
}

.documents-post-summary {
    min-width: 0;
    flex: 1;
}

.documents-post-meta,
.documents-post-full-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
}

.documents-post-meta span,
.documents-post-full-meta span {
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
}

.documents-post-summary h3 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.35;
}

.documents-post-summary p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.documents-post-open {
    display: inline-flex;
    min-height: 38px;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    color: var(--secondary-dark);
    background: var(--soft);
    border: 1px solid #eadcc8;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* Full publication and rich content */

.documents-post-preview {
    padding: 12px;
    background: #fffaf5;
    border-top: 1px solid var(--line);
}

.documents-post-preview[hidden],
.documents-material[hidden],
.documents-tree-node[hidden] {
    display: none !important;
}

.documents-post-full {
    overflow: hidden;
    background: #fff;
    border-radius: 15px;
}

.documents-post-full-image {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    background: #f8eedf;
}

.documents-post-full-body {
    padding: 20px;
}

.documents-post-full-body h2 {
    margin: 0 0 17px;
    color: var(--ink);
    font-size: clamp(20px, 3vw, 30px);
    line-height: 1.3;
}

.documents-post-empty {
    color: var(--muted);
}

.documents-video {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
    overflow: hidden;
    background: #373b2c;
    border-radius: 15px;
    aspect-ratio: 16 / 9;
}

.documents-video iframe,
.documents-video video {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.documents-post-content {
    width: min(100%, 1050px);
    margin: 0 auto;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.75;
}

.documents-post-content > :last-child {
    margin-bottom: 0;
}

.documents-post-content img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto !important;
    max-height: 720px;
    margin: 18px auto;
    object-fit: contain;
    background: #f8eedf;
    border-radius: 14px;
}

.documents-post-content figure {
    max-width: 100%;
    margin: 20px auto;
}

.documents-post-content figure img {
    margin: 0 auto;
}

.documents-post-content figcaption {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.documents-post-content iframe {
    display: block;
    width: min(100%, 960px) !important;
    height: auto !important;
    margin: 20px auto;
    background: #373b2c;
    border: 0;
    border-radius: 15px;
    aspect-ratio: 16 / 9;
}

.documents-post-content video {
    display: block;
    width: min(100%, 960px) !important;
    max-height: 75vh;
    margin: 20px auto;
    background: #373b2c;
    border-radius: 15px;
}

.documents-post-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.documents-post-content a {
    color: var(--secondary-dark);
    text-decoration: underline;
}

.documents-source-link {
    display: inline-flex;
    gap: 7px;
    margin-top: 16px;
    color: var(--secondary-dark);
    font-weight: 800;
}

/* Empty states */

.documents-tree-empty,
.documents-empty {
    padding: 35px;
    color: var(--muted);
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 20px;
    text-align: center;
}

/* Responsive */

@media (max-width: 1000px) {
    .docs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .documents-post-list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .documents-post-thumbnail {
        width: 100%;
        height: 180px;
    }

    .documents-post-open {
        justify-content: center;
    }

    .documents-post-full-body {
        padding: 15px;
    }
}

/* Images and videos precede the document list in each category. */
.documents-media-gallery { margin-bottom: 20px; }
.documents-media-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.documents-media-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; padding: 0; border: 1px solid #cbb08a; border-radius: 13px; background: #fffaf0; color: var(--ink); text-align: left; box-shadow: 0 7px 18px rgba(76, 53, 25, .12); }
button.documents-media-card { cursor: zoom-in; }
.documents-media-card[data-gallery-extra][hidden] { display: none !important; }
.documents-media-card--video { border-color: #d49b5c; background: #fff0d9; }
.documents-media-frame { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #ddc7a8; }
.documents-media-card--video .documents-media-frame { background: #a96c35; }
.documents-media-blur { position: absolute; inset: -15%; width: 130%; height: 130%; max-width: none; object-fit: cover; filter: blur(17px) brightness(.8); }
.documents-media-main { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.documents-media-frame video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; background: #473327; }
.documents-media-symbol { position: absolute; z-index: 2; right: 8px; top: 8px; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #fff9ec; color: #90401f; font-size: 24px; line-height: 1; }
.documents-media-title { display: block; min-width: 0; padding: 10px 11px 12px; font-size: 12px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.documents-media-title > span { color: #a05224; }
.documents-media-actions { display: flex; justify-content: center; margin-top: 16px; }
.documents-media-toggle { min-height: 40px; padding: 9px 19px; border: 1px solid #a45b30; border-radius: 9px; background: #fff6e8; color: #7d391b; font-size: 13px; font-weight: 800; }
.documents-media-toggle:hover { background: #f4dec0; }

.documents-gallery-open { overflow: hidden; }
.documents-gallery-lightbox { position: fixed; inset: 0; z-index: 10000; display: grid; width: 100vw; max-width: none; height: 100vh; max-height: none; grid-template-columns: 60px minmax(0, 1fr) 60px; align-items: center; gap: 10px; padding: 25px; border: 0; background: rgba(28, 25, 19, .96); color: #fff; }
.documents-gallery-lightbox:not([open]) { display: none; }
.documents-gallery-lightbox::backdrop { background: rgba(24, 21, 17, .8); }
.documents-gallery-stage { display: grid; width: 100%; height: min(86vh, 950px); min-width: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; margin: 0; }
.documents-gallery-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.documents-gallery-stage figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; color: #fff; font-size: 13px; text-align: center; }
.documents-gallery-stage figcaption a { color: #f1ba72; font-weight: 800; }
.documents-gallery-arrow, .documents-gallery-close { border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.documents-gallery-arrow { width: 50px; height: 50px; border-radius: 50%; font-size: 35px; line-height: 1; }
.documents-gallery-close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; font-size: 26px; }
.documents-gallery-arrow:hover, .documents-gallery-close:hover { background: #a95b30; }
@media (max-width: 1050px) { .documents-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .documents-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .documents-gallery-lightbox { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 5px; padding: 15px 5px; }
    .documents-gallery-arrow { width: 36px; height: 36px; font-size: 28px; }
    .documents-gallery-stage { height: 78vh; }
}

@media (max-width: 650px) {
    .docs-grid {
        grid-template-columns: 1fr;
    }

    .doc-card {
        min-height: 0;
        padding: 21px;
    }

    .documents-dialog {
        width: calc(100% - 16px);
        max-height: 94vh;
        border-radius: 18px;
    }

    .documents-dialog-panel {
        max-height: 94vh;
    }

    .documents-dialog-header,
    .documents-dialog-body {
        padding-left: 17px;
        padding-right: 17px;
    }

    .documents-dialog-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding-right: 17px;
        padding-left: 17px;
    }

    .documents-dialog-search,
    .documents-dialog-actions {
        width: 100%;
    }

    .documents-dialog-actions button {
        flex: 1;
    }

    .documents-dialog-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .documents-dialog-title h2 {
        font-size: 18px;
        white-space: normal;
    }

    .documents-tree-content {
        padding-left: 12px;
    }

    .documents-material-main {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .documents-material-info {
        width: calc(100% - 76px);
    }

    .documents-material-action {
        width: 100%;
        padding-left: 71px;
    }

    .documents-post-preview {
        padding: 12px;
    }
}






.documents-material-title {
    display: inline;
    width: fit-content;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    text-overflow: ellipsis;
    cursor: pointer;
}

button.documents-material-title:hover,
a.documents-material-title:hover {
    color: var(--secondary-dark);
    /*text-decoration: underline;*/
}

.line-document {
    width: 0;
    height: 4px;
    margin-top: 8px;
    border-radius: 3px;
    background-color: var(--secondary-dark);
    transition: width 0.4s ease;
}

.documents-material-main:has(.documents-material-title:hover) .line-document,
.documents-material-main:has(.documents-material-action a:hover) .line-document,
.documents-material-main:has(.documents-material-action button:hover) .line-document {
    width: 20%;
}


.documents-file-preview {
    padding: 12px;
    background: #fff8ef;
    border-top: 1px solid var(--line);
}

.documents-file-preview[hidden] {
    display: none !important;
}

.documents-file-viewer {
    width: 100%;
    height: min(72vh, 820px);
    overflow: hidden;
    background: #f6ead9;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.documents-file-viewer iframe {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 0;
}

.documents-file-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 4px 0;
    color: var(--muted);
    font-size: 12px;
}

.documents-file-preview-footer a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: var(--secondary-dark);
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 650px) {
    .documents-file-viewer {
        height: 65vh;
    }

    .documents-file-preview {
        padding: 7px;
    }

    .documents-file-preview-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}






/* Блокировка страницы */

html.documents-page-locked {
    overflow: hidden;
}

body.documents-page-locked {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

/* Внутри панели размещается полноэкранный слой */

.documents-dialog-panel {
    position: relative;
}

.documents-dialog.is-document-view {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
}

.documents-dialog.is-document-view .documents-dialog-panel {
    height: 100dvh;
    max-height: none;
}

/* Полноэкранный просмотр */

.document-viewer-layer {
    position: absolute;
    z-index: 50;
    inset: 0;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    background: #373b2c;
}

.document-viewer-layer[hidden] {
    display: none !important;
}

.document-viewer-header {
    display: flex;
    min-height: 62px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 16px;
    color: #fff;
    background: #373b2c;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.document-viewer-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.document-viewer-heading h2 {
    overflow: hidden;
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-viewer-format {
    flex: 0 0 auto;
    padding: 6px 9px;
    color: #fff;
    background: var(--primary);
    border-radius: 7px;
    font-size: 10px;
    font-weight: 900;
}

.document-viewer-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.document-viewer-original,
.document-viewer-close {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.document-viewer-original {
    display: none !important;
}

.document-viewer-original {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
}

.document-viewer-close {
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
}

.document-viewer-close:hover {
    background: var(--primary-dark);
}

.document-viewer-body {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    background: #686b5c;
}

.document-viewer-body iframe {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 0;
}

.document-viewer-loading {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    background: #686b5c;
    font-size: 14px;
    font-weight: 700;
}

.document-viewer-loading[hidden] {
    display: none !important;
}

.document-viewer-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, .22);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: documentViewerSpin .8s linear infinite;
}

@keyframes documentViewerSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 700px) {
    .document-viewer-header {
        min-height: 58px;
        gap: 8px;
        padding: 7px 9px;
    }

    .document-viewer-heading {
        flex: 1;
    }

    .document-viewer-heading h2 {
        font-size: 14px;
    }



    .document-viewer-close {
        width: 42px;
        padding: 0;
        justify-content: center;
        font-size: 0;
    }

    .document-viewer-close span {
        font-size: 20px;
    }
}


