/* Сообщества: общие стили страниц /c/ (каталог, создание, страница сообщества, настройки).
   Цвета — переменные сайта из 998-style.css. Брейкпоинты как у сайта: 1199 / 991 / 767 / 575 / 480. */

.cm-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0 40px;
    color: #ffffff;
    letter-spacing: .1px;
}

/* Страницы /c/ — в контейнере: на широком экране посты, описания и карточки во всю ширину читать неудобно.
   1200px — колонка ленты сообщества выходит ~780px, как колонка постов в ленте /posts/ (до 800px).
   Блок сообществ на главной (.cm-mainpage) живёт по сетке главной. */
.cm-page:not(.cm-mainpage) {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Сброс отступов — с нулевой специфичностью (:where): внутри страниц стоят общие компоненты сайта
   (пост ленты, карточка теста), их собственные отступы (.post-item__date и т. п.) должны побеждать */
:where(.cm-page) :is(h1, h2, h3, p) {
    margin: 0;
}

.cm-page a {
    color: var(--yellow);
    text-decoration: none;
}

.cm-page a:hover {
    color: var(--orange);
}

.cm-page h1 {
    font-size: 32px;
    line-height: 38px;
    font-weight: 700;
    margin-bottom: 0;
}

.cm-page h2 {
    font-size: 20px;
    line-height: 24px;
    font-weight: 700;
    margin-bottom: 0;
}

#cm-hist-h {
    margin-bottom: 20px;
}

.cm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cm-lg {
    color: var(--lightgray);
}

.cm-small {
    font-size: 14px;
    line-height: 21px;
    font-weight: 400;
}

.cm-note {
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--lightgray);
}

.cm-num {
    font-family: Montserrat, 'Google Sans', sans-serif;
    font-weight: 700;
}

.cm-caps {
    text-transform: uppercase;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--gray);
}

.cm-panel {
    background: var(--bgblack);
    border-radius: 10px;
    padding: 20px;
}

.cm-hr {
    height: 1px;
    background: var(--bggray);
    border: 0;
    margin: 0;
}

/* Кнопки */
.cm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    border: 2px solid var(--bggray);
    background: var(--bgblack);
    color: var(--gray);
    font: 700 12px/18px 'Google Sans', sans-serif;
    letter-spacing: .1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}

.cm-page a.cm-btn, .cm-modal a.cm-btn {
    color: var(--gray);
}

.cm-btn:hover, .cm-page a.cm-btn:hover {
    border-color: var(--lightgray);
    color: #ffffff;
}

.cm-btn--y, .cm-page a.cm-btn--y, .cm-modal a.cm-btn--y {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
}

.cm-btn--y:hover, .cm-page a.cm-btn--y:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--black);
}

.cm-btn--sm {
    min-height: 36px;
    padding: 0 14px;
}

.cm-btn--icon {
    width: 44px;
    padding: 0;
}

.cm-btn--danger, .cm-btn--danger:hover {
    color: var(--red);
    border-color: var(--red);
}

.cm-btn:disabled, .cm-btn[aria-disabled="true"] {
    opacity: .5;
    cursor: default;
    pointer-events: none;
}

.cm-btn.is-loading {
    opacity: .7;
    pointer-events: none;
}

.cm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bggray);
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--gray);
}

/* Переключатель */
.cm-seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: var(--bgblack);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.cm-seg.cm-order {
    margin-left: auto;
}

.cm-seg::-webkit-scrollbar {
    display: none;
}

.cm-seg button, .cm-seg a {
    border: 0;
    background: transparent;
    padding: 10px 18px;
    border-radius: 8px;
    font: 700 12px/18px 'Google Sans', sans-serif;
    letter-spacing: .1px;
    text-transform: uppercase;
    color: var(--gray);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.cm-page .cm-seg a {
    color: var(--gray);
}

.cm-seg .on, .cm-page .cm-seg a.on {
    background: var(--yellow);
    color: var(--black);
}

/* Поля */
.cm-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cm-label {
    text-transform: uppercase;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--gray);
}

.cm-input {
    width: 100%;
    border: 2px solid var(--bggray);
    border-radius: 10px;
    background: var(--bgblack);
    color: #ffffff;
    padding: 11px 14px;
    font: 500 14px/21px 'Google Sans', sans-serif;
    letter-spacing: .1px;
    outline: none;
    transition: border-color .15s;
}

.cm-input:focus {
    border-color: var(--yellow);
}

.cm-input::placeholder {
    color: var(--bglightgray);
}

textarea.cm-input {
    resize: vertical;
    min-height: 120px;
}

.cm-input-prefix {
    display: flex;
    align-items: center;
    border-radius: 10px;
    background: var(--bggray);
    border: 2px solid var(--bggray);
    transition: border-color .15s;
    min-width: 0;
}

.cm-input-prefix:focus-within {
    border-color: var(--yellow);
}

.cm-input-prefix > span {
    padding-left: 14px;
    font-size: 14px;
    line-height: 21px;
    font-weight: 500;
    color: var(--lightgray);
    white-space: nowrap;
}

.cm-input-prefix .cm-input {
    border: 0;
    padding-left: 2px;
    min-width: 0;
}

.cm-hint {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--lightgray);
}

.cm-hint .is-ok {
    color: var(--green);
}

.cm-hint .is-error {
    color: var(--red);
}

.cm-hint > span:last-child {
    flex-shrink: 0;
    text-align: right;
}

/* Подсказка-текст вместо счётчика (адрес): статус в одну строку, подсказка переносится и не вылезает из блока */
.cm-hint--wrap > span:first-child {
    flex-shrink: 0;
    white-space: nowrap;
}

.cm-hint--wrap > span:last-child {
    flex: 1 1 0;
    min-width: 0;
}

.cm-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 21px;
    font-weight: 500;
    cursor: pointer;
}

.cm-check input {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--lightgray);
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

.cm-check input:checked {
    background: var(--yellow);
}

.cm-check input:checked::before {
    content: '';
    width: 10px;
    height: 5px;
    border-left: 2px solid var(--black);
    border-bottom: 2px solid var(--black);
    transform: translateY(-2px) rotate(-45deg);
}

.cm-check input:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Аватар и обложка */
.cm-ava {
    border-radius: 50%;
    background: var(--bggray);
    flex-shrink: 0;
    display: block;
    object-fit: cover;
}

.cm-cover {
    background: var(--bgblack) center / cover no-repeat;
}

/* Пустое состояние */
.cm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
}

.cm-empty svg {
    opacity: .8;
}

.cm-empty p {
    max-width: 440px;
}

/* Модалка */
.cm-modal {
    position: fixed;
    inset: 0;
    /* выше плашки cookie (1000), ниже модалок gtalert/gtconfirm (bootstrap: 1040+), чтобы ошибки были поверх */
    z-index: 1020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(31, 35, 37, .85);
}

.cm-modal.is-open {
    display: flex;
}

.cm-modal__dialog {
    position: relative;
    width: 600px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: 10px;
    background: var(--bggray);
    color: #ffffff;
}

.cm-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cm-modal__close:hover {
    background: var(--bgblack);
}

.cm-modal__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 40px;
}

.cm-modal__head h3 {
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
}

.cm-modal__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cm-rules {
    background: var(--bgblack);
    border-radius: 10px;
    padding: 18px 20px;
    max-height: 380px;
    overflow: auto;
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
    color: var(--gray);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

body.cm-modal-open {
    overflow: hidden;
}

/* Карточка сообщества (каталог) */
.cm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.cm-card {
    background: var(--bgblack);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 2px solid var(--bgblack);
}

/* Обложка везде 4:1 — как рекомендуемый размер при загрузке */
.cm-card__cover {
    display: block;
    aspect-ratio: 4 / 1;
    background: var(--bggray) center / cover no-repeat;
}

.cm-card__body {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}

/* Шапка карточки выравнивается по верху: длинное название переносится на новые строки вниз,
   а аватарка остаётся на месте — на 11px заходит на обложку, как при названии в одну строку */
.cm-card__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.cm-card__ava {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid var(--bgblack);
    background: var(--bggray);
    margin-top: -11px;
    flex-shrink: 0;
    object-fit: cover;
    display: block;
}

.cm-card__title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Название — всегда целиком: при нехватке места переносится, не обрезается */
.cm-card__title h3 {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 600;
    overflow-wrap: anywhere;
    margin-bottom: 5px;
    margin-top: 8px;
}

.cm-page .cm-card__title a {
    color: #ffffff;
}

.cm-page .cm-card__title a:hover {
    color: var(--yellow);
}

.cm-card__code {
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--lightgray);
}

.cm-card__desc {
    font-size: 14px;
    line-height: 21px;
    font-weight: 500;
    color: var(--lightgray);
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

.cm-card__foot {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: auto;
}

.cm-card__stat {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    line-height: 18px;
    color: var(--lightgray);
}

.cm-card__stat .cm-num {
    font-size: 18px;
    line-height: 1.3;
    color: #ffffff;
}

.cm-card__action {
    margin-left: auto;
}

@media (max-width: 1199px) {
    .cm-grid {
        gap: 16px;
    }

    .cm-card__body {
        padding: 0 16px 16px;
    }
}

@media (max-width: 991px) {
    .cm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .cm-page {
        padding-top: 10px;
    }

    .cm-page h1 {
        font-size: 26px;
        line-height: 32px;
    }

    .cm-page h2 {
        font-size: 18px;
        line-height: 22px;
    }

    .cm-panel {
        padding: 16px;
    }

    .cm-modal {
        padding: 10px;
        align-items: flex-end;
    }

    .cm-modal__dialog {
        padding: 20px 16px;
        max-height: calc(100vh - 20px);
    }
}

@media (max-width: 575px) {
    .cm-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cm-modal__actions .cm-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 480px) {
    .cm-card__foot {
        gap: 10px;
    }

    .cm-card__stat .cm-num {
        font-size: 16px;
    }
}

/* «Мои сообщества»: бейдж новых работ и последняя работа вместо описания */
.cm-fresh {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    padding: 2px 9px;
    border-radius: 10px;
    background: var(--yellow);
    color: var(--black);
    font-size: 12px;
    line-height: 18px;
    font-weight: 700;
    white-space: nowrap;
}

/* Бейдж новых работ — вровень с первой строкой названия */
.cm-mine .cm-fresh {
    align-self: flex-start;
    margin-top: 10px;
}

.cm-mine__latest {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    margin: 0;
    border-radius: 10px;
    background: var(--bggray);
    min-width: 0;
    transition: background-color .15s;
}

.cm-page a.cm-mine__latest:hover {
    background: #46535a;
}

.cm-mine__latest-name {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cm-mine__latest-type {
    flex-shrink: 0;
    margin-right: 6px;
    vertical-align: -2px;
}

.cm-mine__latest-meta,
.cm-mine__latest--empty {
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--lightgray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Телефон: строка без обложки, как в макете */
@media (max-width: 575px) {
    .cm-mine .cm-card__cover {
        display: none;
    }

    .cm-mine .cm-card__body {
        padding: 12px;
        gap: 6px;
    }

    .cm-mine .cm-card__ava {
        width: 48px;
        height: 48px;
        margin-top: 0;
        border: 0;
    }

    .cm-mine .cm-card__title h3 {
        font-size: 16px;
        line-height: 20px;
    }

    .cm-mine .cm-fresh {
        margin-top: 9px;
        padding: 0 7px;
        font-size: 11px;
        line-height: 17px;
    }

    .cm-mine__latest {
        padding: 0 0 0 60px;
        background: transparent;
    }

    .cm-page a.cm-mine__latest:hover {
        background: transparent;
    }

    .cm-mine__latest-name {
        font-size: 13px;
        line-height: 18px;
        font-weight: 500;
        color: #dfdfdf;
    }
}

/* Формы (создание и настройки): двухколоночная раскладка, загрузка картинок */
.cm-form-page__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-form-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.cm-form-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cm-form-side {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cm-form fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cm-form fieldset:disabled {
    opacity: .55;
}

.cm-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cm-form__images {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
}

.cm-form__submit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid var(--bggray);
}

.cm-image .image-dropzone {
    background-color: var(--bggray);
    border-radius: 10px;
}

.cm-image--circle .image-dropzone {
    width: 160px;
    height: 160px;
    flex: none;
    border-radius: 50%;
}

.cm-image--rectangle .image-dropzone {
    height: auto;
    aspect-ratio: 4 / 1;
}

.cm-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-status h2 {
    font-size: 18px;
    line-height: 24px;
}

.cm-status--pending {
    border: 2px solid var(--yellow);
}

.cm-status--rejected {
    border: 2px solid var(--red);
}

.cm-status--rejected .cm-caps {
    color: var(--red);
}

.cm-status p {
    overflow-wrap: anywhere;
}

@media (max-width: 1199px) {
    .cm-form-side {
        width: 340px;
    }
}

@media (max-width: 991px) {
    .cm-form-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .cm-form-side {
        width: auto;
    }
}

@media (max-width: 767px) {
    .cm-form__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .cm-form__images {
        grid-template-columns: minmax(0, 1fr);
    }

    .cm-image--circle .image-dropzone {
        width: 132px;
        height: 132px;
    }

    .cm-image--rectangle .image-dropzone {
        width: 100%;
        height: auto;
        aspect-ratio: 1306 / 220;
        min-height: 90px;
    }

    .cm-hint {
        flex-direction: column;
        gap: 2px;
    }

    .cm-hint > span:last-child {
        text-align: left;
    }

    .cm-hint--wrap > span:last-child {
        flex: none;
    }
}

@media (max-width: 575px) {
    .cm-form__submit .cm-btn {
        width: 100%;
    }
}

/* Счётчик на кнопке («Предложено 4») */
.cm-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 7px;
    border-radius: 10px;
    background: var(--yellow);
    color: var(--black);
    font-size: 12px;
    line-height: 18px;
    font-weight: 700;
    text-align: center;
}

/* Шапка сообщества (CmHero.vue) — одна на ленту, участников, предложенное и настройки.
   Обложка 4:1, аватар, название и описание на всю ширину; внизу полоса: вкладки слева, до двух кнопок справа.
   Описание не делит строку с кнопками, поэтому его ширина не зависит от роли зрителя. */
.cm-hero {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    background: var(--bgblack);
}

/* Обложка всегда 4:1 — как рекомендуемый размер при загрузке (Config::COVER_WIDTH × COVER_HEIGHT) */
.cm-hero__cover {
    aspect-ratio: 4 / 1;
    border-radius: 10px 10px 0 0;
    background-color: var(--bggray);
    border-top: 2px solid var(--bgblack);
    border-right: 2px solid var(--bgblack);
    border-left: 2px solid var(--bgblack);
}

.cm-hero__panel {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 0 30px 20px;
}

.cm-hero__ava {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    margin-top: -20px;
    border: 6px solid var(--bgblack);
    box-sizing: border-box;
}

.cm-hero__info {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cm-hero__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-width: 0;
}

.cm-hero__name {
    margin: 0;
    font-size: 28px;
    line-height: 34px;
    font-weight: 700;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.cm-page .cm-hero__name a {
    color: #ffffff;
}

.cm-page .cm-hero__name a:hover {
    color: var(--yellow);
}

.cm-hero__desc {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    max-width: 860px;
    overflow-wrap: anywhere;
}

/* Вкладки не сжимаются: если рядом с ними нет места для кнопок, кнопки уходят строкой ниже, вправо */
.cm-hero__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 16px;
    min-height: 60px;
    padding: 0 30px;
    border-top: 1px solid var(--bggray);
}

.cm-hero__tabs {
    flex: 1 1 auto;
    align-self: stretch;
    min-height: 58px;
    display: flex;
    gap: 28px;
}

.cm-page a.cm-hero__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-top: 2px;
    font-size: 14px;
    line-height: 21px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    transition: color .15s;
}

.cm-page a.cm-hero__tab:hover {
    color: #ffffff;
}

.cm-page a.cm-hero__tab.on {
    color: var(--yellow);
    border-bottom-color: var(--yellow);
}

.cm-hero__actions {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

/* Подстраницы: без обложки и описания, аватар маленький */
.cm-hero--compact .cm-hero__panel {
    align-items: center;
    gap: 16px;
    padding: 16px 30px;
}

.cm-hero--compact .cm-hero__ava {
    width: 48px;
    height: 48px;
    margin-top: 0;
    border: 0;
}

.cm-hero--compact .cm-hero__info {
    padding-top: 0;
}

.cm-hero--compact .cm-hero__name {
    font-size: 20px;
    line-height: 26px;
}

.cm-chip--warn {
    background: rgba(255, 202, 40, .15);
    color: var(--yellow);
}

/* Роль зрителя — плашкой у названия (слот role в CmHero): владелец, участник и куратор (с меню «Покинуть»), бан */
.cm-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: center;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--bggray);
    border-radius: 8px;
    background: transparent;
    font: 500 10px/18px 'Google Sans', sans-serif;
    letter-spacing: .1px;
    text-transform: uppercase;
    color: var(--gray);
    white-space: nowrap;
    box-sizing: border-box;
}

button.cm-role-chip {
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

button.cm-role-chip:hover, button.cm-role-chip:focus-visible, .cm-menu.is-open > button.cm-role-chip {
    border-color: var(--lightgray);
    color: #ffffff;
    outline: none;
}

.cm-role-chip--owner {
    border-color: rgba(255, 202, 40, .45);
    color: var(--yellow);
}

.cm-role-chip--ban {
    border-color: rgba(255, 87, 87, .45);
    background: rgba(255, 87, 87, .12);
    color: var(--red);
}

.cm-role-menu {
    align-self: center;
}

.cm-role-menu .cm-menu__list {
    left: 0;
    right: auto;
}

@media (max-width: 1199px) {
    .cm-hero__panel {
        gap: 20px;
        padding: 0 24px 18px;
    }

    .cm-hero__ava {
        width: 104px;
        height: 104px;
        margin-top: -15px;
    }

    .cm-hero__bar {
        padding: 0 24px;
    }

    .cm-hero__name {
        font-size: 24px;
        line-height: 30px;
    }

    .cm-hero--compact .cm-hero__panel {
        padding: 14px 24px;
    }
}

/* Телефон: действие — кнопкой на всю ширину над вкладками, вкладки прокручиваются вбок */
@media (max-width: 767px) {
    .cm-hero__panel {
        gap: 14px;
        padding: 0 16px 14px;
    }

    .cm-hero__ava {
        width: 80px;
        height: 80px;
        border-width: 4px;
    }

    .cm-hero__info {
        padding-top: 8px;
    }

    .cm-hero__name {
        font-size: 20px;
        line-height: 26px;
    }

    .cm-hero__desc {
        font-size: 14px;
        line-height: 21px;
    }

    .cm-hero--compact .cm-hero__panel {
        padding: 12px 16px;
    }

    .cm-hero--compact .cm-hero__ava {
        width: 40px;
        height: 40px;
    }

    .cm-hero--compact .cm-hero__name {
        font-size: 18px;
        line-height: 24px;
    }

    .cm-hero__bar {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        padding: 0;
        border-top: 0;
    }

    .cm-hero__actions {
        order: -1;
        margin-left: 0;
        padding: 0 16px 14px;
    }

    .cm-hero__actions > .cm-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .cm-hero__tabs {
        min-width: 0;
        min-height: 50px;
        gap: 22px;
        padding: 0 32px 0 16px;
        border-top: 1px solid var(--bggray);
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    }

    .cm-hero__tabs::-webkit-scrollbar {
        display: none;
    }

    .cm-hero__actions:empty {
        display: none;
    }
}

/* Плашка роли (участники, чат) */
.cm-role {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--yellow);
    color: var(--yellow);
    font-size: 10px;
    line-height: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Поле поиска (CmSearch.vue): своя кнопка очистки вместо системного крестика type=search */
.cm-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin: 0;
    padding: 0 6px 0 14px;
    border-radius: 10px;
    background: var(--bggray);
    border: 2px solid var(--bgblack);
    min-width: 0;
    transition: border-color .15s;
}

.cm-search:focus-within {
    border-color: var(--yellow);
}

.cm-search--dark {
    background: var(--bgblack);
}

.cm-search__icon {
    flex-shrink: 0;
}

.cm-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #ffffff;
    font: 500 14px/21px 'Google Sans', sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.cm-search input::placeholder {
    color: var(--bglightgray);
}

.cm-search input::-webkit-search-cancel-button,
.cm-search input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.cm-search__clear {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bggray);
    color: var(--lightgray);
    cursor: pointer;
    transition: color .15s, background-color .15s;
}

.cm-search__clear:hover, .cm-search__clear:focus-visible {
    color: var(--black);
    background: var(--yellow);
    outline: none;
}

/* Свой скроллбар у прокручиваемых списков: чат, работы в «Предложить», смайлики, поиск участников, правила */
.cm-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--bglightgray) transparent;
}

.cm-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.cm-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cm-scroll::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: var(--bglightgray);
}

.cm-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--lightgray);
}

.cm-modal__dialog {
    scrollbar-width: thin;
    scrollbar-color: var(--bglightgray) transparent;
}

/* Обязательная картинка не загружена (форма создания, настройки) */
.cm-image.is-invalid .image-dropzone {
    box-shadow: 0 0 0 2px #ff5757;
}

.cm-note.cm-note--error {
    color: #ff5757;
}

/* Подгрузка порций при прокрутке (community/more.js): датчик под лентой и списком участников,
   пока грузится — «Загрузка…» с крутилкой, если не вышло — кнопка «Показать ещё» */
.cm-more {
    display: flex;
    justify-content: center;
    min-height: 1px;
}

.cm-more:empty {
    padding: 0 !important;
}

.cm-more__loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font: 500 14px/21px 'Google Sans', sans-serif;
    color: var(--lightgray);
}

.cm-more__loader:before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--bggray);
    border-top-color: var(--yellow);
    box-sizing: border-box;
    animation: cm-more-spin .8s linear infinite;
}

@keyframes cm-more-spin {
    to {
        transform: rotate(360deg);
    }
}


@media screen and (max-width: 460px) {
    .cm-hero__panel {
        position: relative;
    }

    .cm-hero__cover {
        aspect-ratio: auto;
        height: 120px;
    }

    .cm-hero__ava {
        position: absolute;
        top: -93px;
        left: calc(50% - 50px);
        height: 100px;
        width: 100px;
        border-width: 3px;
    }

    .cm-page a.cm-hero__tab {
        font-size: 12px;
    }

    .cm-hero__tabs,
    .cm-layout {
        gap: 15px
    }
}
