/* Разборы из чата — new-design/Chat Digest.dc.html */

.nd-chat-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, 0);
    outline: none;
    outline-offset: 2px;
    transition: box-shadow .15s, color .15s;
}

.nd-chat-card:hover {
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .08);
    color: #0B5DD7;
}

.nd-chat-card:focus-visible {
    outline: 2px solid #0B5DD7;
}

.nd-chat-card-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #000;
}

.nd-chat-cover {
    margin-top: 14px;
    height: 280px;
    display: grid;
    gap: 4px;
}

.nd-chat-cover--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nd-chat-cover--3 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.nd-chat-cover--3 .nd-chat-cover-cell:first-child {
    grid-row: 1 / span 2;
}

.nd-chat-cover-cell {
    position: relative;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #F2F2F2;
}

.nd-chat-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nd-chat-cover-cell--video {
    background: #16202B;
    cursor: pointer;
}

.nd-chat-cover-cell--video .nd-chat-cover-img {
    opacity: .85;
}

.nd-chat-cover-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    padding: 0 0 0 3px;
    border: 0;
    border-radius: 50%;
    background: rgba(22, 32, 43, .72);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s, background .15s;
}

.nd-chat-cover-cell--video:hover .nd-chat-cover-play {
    transform: scale(1.08);
    background: #0B5DD7;
}

.nd-chat-cover-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.nd-chat-cover-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 32, 43, .4);
    color: #fff;
    font: 500 24px/1 var(--nd-font);
    z-index: 1;
}

/* Страница поста */

.nd-chat-post {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
}

.nd-chat-post-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nd-chat-h1 {
    margin: 14px 0 0;
    font: 500 26px/32px var(--nd-font);
    text-wrap: pretty;
}

@media (max-width: 700px) {
    .nd-chat-h1 {
        font-size: 22px;
        line-height: 28px;
    }
}

.nd-chat-h2 {
    margin: 0 0 14px;
    font: 500 20px/26px var(--nd-font);
}

.nd-chat-section {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-top: 8px;
}

/* Плашка «Коротко» */

.nd-chat-plot {
    background: #EDF3FC;
}

/* Ситуация — пузыри */

.nd-chat-bubble-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.nd-chat-avatar {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #EDF1F6;
    color: #33393F;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 500 13px/1 var(--nd-font);
}

.nd-chat-avatar--expert {
    background: #16202B;
    color: #fff;
}

.nd-chat-avatar--author {
    background: #EDF1F6;
    color: #33393F;
}

.nd-chat-avatar--in {
    width: 24px;
    height: 24px;
    font-size: 10px;
    flex: none;
}

.nd-chat-bubble {
    flex: 1;
    min-width: 0;
    max-width: 88%;
    padding: 10px 14px 8px;
    border-radius: 4px 16px 16px 16px;
    background: #F2F3F5;
    border: none;
    box-sizing: border-box;
}

.nd-chat-bubble--author {
    background: #F2F3F5;
}

/* Галерея */

.nd-chat-gallery {
    margin-top: 10px !important;
}

.nd-chat-photo-thumb {
    cursor: pointer;
}

.nd-chat-photo-expand {
    transition: background .15s;
}

.nd-chat-photo-expand:hover {
    background: rgba(27, 31, 36, 1) !important;
}

.nd-chat-photo-expand:focus-visible {
    outline: 2px solid #0B5DD7;
    outline-offset: 2px;
}

/* Фильтр */

.nd-chat-filters {
    display: flex;
    gap: 6px;
}

.nd-chat-filter-btn {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #F2F3F5;
    color: #33393F;
    font: 500 14px/1 var(--nd-font);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.nd-chat-filter-btn:hover {
    background: #E8EAEE;
}

.nd-chat-filter-btn.is-active {
    background: #0B5DD7;
    color: #fff;
}

.nd-chat-filter-btn:focus-visible {
    outline: 2px solid #0B5DD7;
    outline-offset: 2px;
}

/* Поток сообщений */

.nd-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nd-chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* Свёрнутые реплики */

.nd-chat-fold-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px dashed #E0E0E0;
    border-radius: 999px;
    background: #fff;
    color: #595959;
    font: 400 14px/1 var(--nd-font);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s;
}

.nd-chat-fold-btn:hover {
    border-color: #B9B9B9;
}

.nd-chat-fold-btn:focus-visible {
    outline: 2px solid #0B5DD7;
    outline-offset: 2px;
}

.nd-chat-fold-items {
    display: none;
}

.nd-chat-fold-btn[aria-expanded="true"] ~ .nd-chat-fold-items {
    display: flex;
}

/* Плашка-внимание */

.nd-chat-warning {
    background: #FDF0E6;
    color: #8A4B12;
}

/* Лайтбокс */

.nd-chat-lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    background: rgba(22, 32, 43, .96);
    display: flex;
    flex-direction: column;
    padding: 16px;
    box-sizing: border-box;
}

.nd-chat-lb-close,
.nd-chat-lb-prev,
.nd-chat-lb-next {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}

.nd-chat-lb-close:hover,
.nd-chat-lb-prev:hover,
.nd-chat-lb-next:hover {
    background: rgba(255, 255, 255, .2);
}

.nd-chat-lb-close:focus-visible,
.nd-chat-lb-prev:focus-visible,
.nd-chat-lb-next:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.nd-chat-lb-img {
    max-width: 900px;
    max-height: 70vh;
    object-fit: contain;
}

/* Адаптив */

@media (max-width: 700px) {
    .nd-chat-card {
        padding: 16px;
    }

    .nd-chat-post {
        padding: 16px;
    }

    .nd-chat-section {
        padding: 16px;
    }

    .nd-chat-cover {
        height: 200px;
    }

    .nd-chat-bubble {
        max-width: 100%;
    }

    .nd-chat-avatar {
        display: none;
    }

    .nd-chat-avatar--in {
        display: inline-flex;
        width: 24px;
        height: 24px;
    }

    .nd-chat-plot {
        padding: 16px;
    }

    /* «Коротко» перед «Ситуацией» */
    .nd-chat-plot {
        order: -1;
    }
}

/* Движение */

@media (prefers-reduced-motion: no-preference) {
    .nd-chat-card {
        transition: box-shadow .15s cubic-bezier(.2, .8, .2, 1), color .15s cubic-bezier(.2, .8, .2, 1);
    }

    .nd-chat-filter-btn {
        transition: background .15s cubic-bezier(.2, .8, .2, 1), color .15s cubic-bezier(.2, .8, .2, 1);
    }

    .nd-chat-fold-btn {
        transition: border-color .15s cubic-bezier(.2, .8, .2, 1);
    }

    .nd-chat-photo-expand {
        transition: background .15s cubic-bezier(.2, .8, .2, 1);
    }

    .nd-chat-lb-close,
    .nd-chat-lb-prev,
    .nd-chat-lb-next {
        transition: background .15s cubic-bezier(.2, .8, .2, 1);
    }
}

/* Доступность */

.nd-chat-lightbox[hidden] {
    display: none;
}

.nd-chat-fold-items[hidden] {
    display: none;
}

.nd-chat-avatar img,
.nd-chat-card-inner span > img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
}
