/* Панель комментариев всегда закрыта по умолчанию */
.bxclub-comments-panel {
    display: none !important;
    margin-top: 18px;
    padding: 22px;
    border: 1px solid #e0e5ec;
    border-radius: 16px;
    background: #fff;
}

.bxclub-comments-panel.is-open {
    display: block !important;
}

/* Модалка кода всегда закрыта по умолчанию */
.bxclub-code-modal {
    display: none !important;
    position: fixed;
    z-index: 100500;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.bxclub-code-modal.is-open {
    display: flex !important;
}

.bxclub-modal-open {
    overflow: hidden;
}

.bxclub-comments-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.bxclub-comments-panel__top h3 {
    margin: 0;
    color: #20232a;
    font-size: 18px;
    font-weight: 750;
}

.bxclub-comments-panel__top h3 span {
    color: #8c94a1;
}

.bxclub-comments-panel__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #f3f5f8;
    color: #77808e;
    font-size: 22px;
    cursor: pointer;
}

.bxclub-comments__empty,
.bxclub-comments__auth {
    padding: 18px 0;
    color: #8b94a2;
    font-size: 14px;
}

.bxclub-comment {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #edf0f4;
}

.bxclub-comment--reply {
    margin-left: 42px;
    padding-left: 14px;
    border-left: 2px solid #e5eaf1;
}

.bxclub-comment__avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 50%;
    background: #edf4ff;
}

.bxclub-comment__avatar img,
.bxclub-comment__avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    color: #3b82f6;
    font-weight: 750;
}

.bxclub-comment__body {
    min-width: 0;
    flex: 1;
}

.bxclub-comment__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 12px;
}

.bxclub-comment__meta strong {
    color: #252932;
    font-size: 14px;
}

.bxclub-comment__meta time {
    color: #969eaa;
}

.bxclub-comment__group {
    padding: 3px 7px;
    border-radius: 6px;
    background: #f1f4f8;
    color: #657084;
    font-size: 10px;
    font-weight: 650;
}

.bxclub-comment__text {
    color: #343a46;
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.bxclub-comment__text h2 {
    margin: 16px 0 10px;
    font-size: 20px;
}

.bxclub-comment__text blockquote {
    margin: 14px 0;
    padding: 10px 14px;
    border-left: 3px solid #4f95ed;
    background: #f6f9fd;
    color: #596476;
}

.bxclub-comment__reply-button {
    margin-top: 9px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6f7a89;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.bxclub-comment__reply-button:hover {
    color: #438ef0;
}

.bxclub-comment-editor {
    margin-top: 20px;
}

.bxclub-comment-editor__replying {
    display: none;
    margin-bottom: 9px;
    padding: 9px 12px;
    border-radius: 9px;
    background: #f3f7fc;
    color: #637084;
    font-size: 12px;
}

.bxclub-comment-editor__replying.is-open {
    display: block;
}

.bxclub-comment-editor__replying button {
    float: right;
    border: 0;
    background: transparent;
    color: #6e7887;
    font-size: 18px;
    cursor: pointer;
}

.bxclub-comment-editor__box {
    overflow: hidden;
    border: 1px solid #dfe5ed;
    border-radius: 14px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.bxclub-comment-editor__box:focus-within {
    border-color: #90b9f7;
    box-shadow: 0 0 0 4px rgba(67, 142, 240, .09);
}

.bxclub-comment-editor__toolbar {
    min-height: 54px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid #e7ebf0;
}

.bxclub-comment-editor__toolbar button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #626c7b;
    font: inherit;
    font-size: 18px;
    cursor: pointer;
}

.bxclub-comment-editor__toolbar button:hover {
    background: #f2f5f8;
    color: #2f3742;
}

.bxclub-comment-editor__separator {
    width: 1px;
    height: 27px;
    margin: 0 7px;
    background: #e0e5eb;
}

.bxclub-comment-editor__content {
    min-height: 150px;
    padding: 18px 20px;
    color: #303640;
    font-size: 15px;
    line-height: 1.65;
    outline: none;
}

.bxclub-comment-editor__content:empty::before {
    content: attr(data-placeholder);
    color: #a4acb8;
    pointer-events: none;
}

.bxclub-comment-editor__content h2 {
    margin: 12px 0;
    font-size: 22px;
}

.bxclub-comment-editor__content blockquote {
    margin: 14px 0;
    padding: 10px 14px;
    border-left: 3px solid #4f95ed;
    background: #f6f9fd;
}

.bxclub-comment-editor__content pre,
.bxclub-comment__text pre {
    max-width: 100%;
    overflow: auto;
    border-radius: 10px;
}

.bxclub-comment-editor__footer {
    min-height: 70px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid #e7ebf0;
    background: #fafbfd;
}

.bxclub-comment-editor__footer > button {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #4d93ee;
    color: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.bxclub-comment-editor__footer > button:disabled {
    opacity: .6;
    cursor: default;
}

.bxclub-comment-editor__message {
    color: #748093;
    font-size: 12px;
}

/* счетчик у кнопки "Ответить" */
.bxclub-answer__comments-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    border-radius: 999px;
    background: #eef3fa;
    color: #647084;
    font-size: 11px;
    font-weight: 750;
}

.bxclub-answer__action[aria-expanded="true"] {
    color: #438ef0;
}

.bxclub-answer__action[aria-expanded="true"] .bxclub-answer__comments-count {
    background: #e5f0ff;
    color: #438ef0;
}

/* модальное окно вставки кода */
.bxclub-code-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 28, 36, .74);
    backdrop-filter: blur(3px);
}

.bxclub-code-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(970px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .32);
}

.bxclub-code-modal__header {
    padding: 25px 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid #e4e8ed;
}

.bxclub-code-modal__header h3 {
    margin: 0 0 6px;
    color: #20242c;
    font-size: 23px;
}

.bxclub-code-modal__header p {
    margin: 0;
    color: #9098a5;
    font-size: 13px;
}

.bxclub-code-modal__header button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 11px;
    background: #f2f4f7;
    color: #77808d;
    font-size: 25px;
    cursor: pointer;
}

.bxclub-code-modal__content {
    padding: 26px 28px;
}

.bxclub-code-modal__content label {
    display: block;
    margin-bottom: 18px;
}

.bxclub-code-modal__content label > span {
    display: block;
    margin-bottom: 8px;
    color: #313743;
    font-size: 13px;
    font-weight: 750;
}

.bxclub-code-modal__content select,
.bxclub-code-modal__content textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8dee7;
    border-radius: 10px;
    font: inherit;
    outline: none;
}

.bxclub-code-modal__content select {
    height: 50px;
    padding: 0 14px;
    background: #fff;
}

.bxclub-code-modal__content textarea {
    min-height: 330px;
    padding: 17px;
    resize: vertical;
    border-color: #6aa4f2;
    background: #202630;
    color: #dfe6ef;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.55;
    box-shadow: 0 0 0 4px rgba(75, 148, 239, .12);
}

.bxclub-code-modal__preview {
    overflow: hidden;
    border-radius: 10px;
    background: #252a32;
}

.bxclub-code-modal__preview > div {
    padding: 10px 15px;
    background: #303641;
    color: #b7bfca;
    font-size: 11px;
    font-weight: 750;
}

.bxclub-code-modal__preview pre {
    min-height: 28px;
    margin: 0;
    border-radius: 0;
}

.bxclub-code-modal__footer {
    padding: 17px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid #e4e8ed;
    background: #fafbfd;
}

.bxclub-code-modal__footer > span {
    color: #939caa;
    font-size: 12px;
}

.bxclub-code-modal__footer > div {
    display: flex;
    gap: 10px;
}

.bxclub-code-modal__footer button {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 10px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.bxclub-code-modal__footer .is-secondary {
    border: 1px solid #d9dfe7;
    background: #fff;
    color: #687382;
}

.bxclub-code-modal__footer .is-primary {
    border: 0;
    background: #4d93ee;
    color: #fff;
}

@media (max-width: 700px) {
    .bxclub-comments-panel {
        padding: 16px;
        border-radius: 13px;
    }

    .bxclub-comment--reply {
        margin-left: 16px;
        padding-left: 9px;
    }

    .bxclub-comment-editor__toolbar {
        padding: 7px;
    }

    .bxclub-comment-editor__separator {
        margin: 0 3px;
    }

    .bxclub-code-modal {
        padding: 10px;
    }

    .bxclub-code-modal__header,
    .bxclub-code-modal__content,
    .bxclub-code-modal__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bxclub-code-modal__content textarea {
        min-height: 240px;
    }

    .bxclub-code-modal__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .bxclub-code-modal__footer > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
