body {
    overflow-x: hidden;
    overflow-y: auto;
}

.template {
    /* background-color: #fff; */
    border-top: 1px solid #e8e9ed;
    min-height: calc(100vh - 60px);
    display: flex;
}

.template .template_catalogue {
    background-color: #f9fafc;
    max-height: calc(100vh - 60px);
    width: clamp(240px, 16.6667vw, 320px);
    padding: 15px 12px;
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
}

.template .template_catalogue .first-level {
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
}

.template .template_catalogue .catalogue_svg {
    margin: 10px;
    cursor: pointer;
    transition: all .2s;
}



.template .template_catalogue .catalogue_svg {
    transform: rotateZ(-90deg);
}

.template .template_catalogue .secondary-level {
    display: none;
}

.template .template_catalogue .unfold .secondary-level {
    display: block;
}

.template .template_catalogue .unfold .catalogue_svg {

    transform: rotateZ(0deg);
}

.template .template_content {
    background: #fff;
    flex: 1;
    box-sizing: border-box;
    padding: clamp(36px, 3.3333vw, 64px) clamp(24px, 4.0625vw, 78px);
    min-width: 0;
    overflow-x: hidden;
    overflow-y: visible;
}

.secondary-level>div {
    cursor: pointer;
    height: 46px;
    line-height: 46px;
    border-radius: 6px;
}

.secondary-level>div a {
    width: 100%;
    display: block;
    padding-left: 44px;
    padding-right: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secondary-level>div.active {
    background-color: #edeff2;
}

.app .template .template_catalogue {
    display: none;
}

.app .template .template_content {
    padding: 24px 16px;
}

#help_preview {
    position: fixed;
    top: 0px;
    left: 0px;
    background-color: rgba(0, 0, 0, 0.5);
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 99;
}

#help_preview .help_preview_content {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50vw;
    max-width: min(1200px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    object-fit: contain;
    transform: translate(-50%, -50%);
}

.template_content img {
    cursor: pointer;
    max-width: 100% !important;
    height: auto !important;
}

.template_content p,
.template_content li,
.template_content td,
.template_content th,
.template_content blockquote,
.template_content code,
.template_content pre {
    overflow-wrap: break-word;
    word-break: break-word;
}

.template_content table {
    width: max-content;
    min-width: 100%;
    max-width: none;
}

.template_content .editor-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.template_content .data-codeblock-content {
    width: 100%;
    max-width: 100% !important;
    overflow-x: auto;
}

.template_content .data-codeblock-content > div {
    overflow-x: auto !important;
}

.template_content pre {
    white-space: pre-wrap;
}

@media (max-width: 1200px) {
    .template .template_catalogue {
        width: 260px;
    }

    .template .template_content {
        padding: 32px 24px;
    }
}

@media (max-width: 905px) {
    .template {
        display: block;
        min-height: auto;
    }

    .template .template_catalogue {
        display: none;
    }

    .template .template_content {
        width: 100%;
        padding: 24px 16px 32px;
    }

    .template_content h1 {
        font-size: 28px;
        line-height: 1.3;
    }

    .template_content h2 {
        font-size: 22px;
        line-height: 1.35;
    }

    .template_content h3 {
        font-size: 18px;
        line-height: 1.4;
    }

    .template_content table {
        min-width: 640px;
    }

    .template_content .data-codeblock-content {
        min-width: 100%;
    }

    #help_preview .help_preview_content {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}
