/* ============================================================
   ФОРУМ — стили
   Без gap, с префиксами для Safari 9+
   ============================================================ */

/* ---------- Заголовок форума ---------- */
.forum-title {
    font-size: 26px;
    font-family: 'Roboto Condensed', sans-serif;
    color: #000000;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.forum-zagolovok-block{
    width: 100%;
    display: flex;
    flex-direction: column;
}
/* ---------- Ссылки под заголовком ---------- */
.forum-title-links {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-top: 5px;
    margin-bottom:5px;
}

.forum-title-link {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-darkblue);
    background: #ffffff;
    border: 1px solid var(--text-grey);
    border-radius: 12px;
    padding: 2px 10px;
    flex-shrink: 0;
    text-transform: uppercase;
    /* Замена gap: margin-right + margin-bottom, у последнего — 0 */
    margin-right: 8px;
    margin-bottom: 8px;
}

.forum-title-link:last-child {
    margin-right: 0;
}

.forum-title-link:hover {
    background: #dbebff;
    color: var(--text-darkblue);
}

/* ---------- Двухколоночный layout ---------- */
.forum-layout {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    /* gap: 20px → margin-right на основной колонке */
}

.forum-main-col {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 1200px;
    margin-right: 20px;
}

.forum-side-col {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 380px;
    -ms-flex: 0 0 380px;
    flex: 0 0 380px;
    min-width: 0;
}

/* ---------- Блоки разделов ---------- */
.forum-block {
    margin-bottom: 20px;
    border: 1px solid #dde4ed;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.forum-block:last-child {
    margin-bottom: 15px;
}

/* Полоска заголовка */
.forum-block-title {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    padding: 8px 16px;
    background: #dbebff;
    text-decoration: none;
    border-bottom: 1px solid #b8d4ee;
    transition: background 0.15s;
    text-transform: uppercase;
}

.forum-block-title:hover {
    background: #b8d4ee;
}

.forum-block-title-text {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #648fc5;
    line-height: 1.2;
}

.forum-block-title-count {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-darkblue);
    background: #ffffff;
    border: 1px solid var(--text-grey);
    border-radius: 12px;
    padding: 2px 10px;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Полоска описания */
.forum-block-desc {
    padding: 10px 18px;
    font-family: 'OpenSans', sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.45;
    border-bottom: 1px solid #d6e6f5;
}

/* ---------- Темы внутри блока ---------- */
.forum-block-temas {
    background: #ffffff;
}

.forum-block-tema {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    padding: 12px 18px;
    color: inherit;
    border-bottom: 1px solid var(--text-lightgrey);
    transition: background 0.15s;
    cursor: pointer;
    /* gap: 14px → margin-right на левой колонке */
}

.forum-block-tema:last-child {
    border-bottom: none;
}

.forum-block-tema:hover {
    background: #f5f9fe;
}

/* Левая колонка: аватар + ник */
.forum-block-tema-left {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 80px;
    -ms-flex: 0 0 80px;
    flex: 0 0 80px;
    width: 80px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-right: 14px;
}

.forum-block-tema-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--text-grey);
    background: var(--text-lightgrey);
}

.forum-block-tema-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    -o-object-fit: cover;
    object-fit: cover;
}

.forum-block-tema-nick {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-darkblue);
    text-align: center;
    margin-top: 5px;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Правая колонка */
.forum-block-tema-content {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}

.forum-block-tema-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #f35c29;
    line-height: 1.35;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.forum-block-tema:hover .forum-block-tema-title {
    color: var(--text-darkblue);
}

/* «к статье: …» в одну строку с названием */
.forum-block-tema-article-inline {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #888;
    margin-left: 4px;
}

.forum-block-tema-meta {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.forum-block-tema-meta-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
    margin: 0 5px;
    opacity: 0.75;
}

.forum-block-tema-author {
    color: var(--text-darkblue);
    font-weight: 600;
}

.forum-block-temas-empty {
    padding: 15px 18px;
    font-family: 'OpenSans', sans-serif;
    font-size: 13px;
    color: #aaa;
}

/* ---------- Бейдж «закрытый» ---------- */
.forum-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    border-radius: 3px;
    margin-left: 6px;
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.forum-badge-closed {
    background-color: #ffe1e2;
    color: #e7515a;
    border: 1px solid #e7515a;
}

/* ---------- Пустое состояние ---------- */
.forum-empty {
    padding: 30px;
    text-align: center;
    color: #888;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
    background-color: var(--text-lightgrey);
    border-radius: 5px;
    margin-top: 15px;
}

/* ---------- Строка заголовка страницы раздела + кнопка ---------- */
.forum-zagolovok-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.forum-zagolovok-row .forum-title {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    margin-right: 15px;
}

.forum-zagolovok-row .main-button {
    flex-shrink: 0;
}
/* ---------- Список тем в разделе ---------- */
.forum-temas-list {
    border: 1px solid #dde4ed;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

/* ---------- Пагинация ---------- */
.forum-pagination {
    margin-top: 15px;
    text-align: center;
}

/* ---------- Таблица тем (для старых шаблонов) ---------- */
.forum-temas-table {
    width: 100%;
    margin-top: 15px;
}

.forum-temas-table th {
    background-color: var(--text-lightgrey) !important;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    color: var(--text-darkblue);
    text-align: left;
    padding: 10px !important;
}

.forum-temas-table td {
    vertical-align: middle;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    padding: 10px !important;
}

.forum-tema-pinned {
    background-color: #fffbe6 !important;
}

.forum-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 14px;
}

.forum-tema-link {
    color: var(--text-darkblue);
    text-decoration: none;
    border-bottom: none;
    font-weight: 600;
    font-size: 15px;
}

.forum-tema-link:hover {
    color: #f35c29;
}

.forum-tema-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.forum-tema-article-link {
    color: var(--text-darkblue);
    border-bottom: 1px dashed var(--text-darkblue);
    text-decoration: none;
}

.forum-tema-article-link:hover {
    color: #f35c29;
    border-bottom-color: #f35c29;
}

.forum-last-post {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.forum-last-post-user {
    color: var(--text-darkblue);
    font-weight: 600;
}

.forum-muted {
    color: #bbb;
}

/* ---------- Последние сообщения ---------- */
.forum-latest {
    border: 1px solid #dde4ed;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.forum-latest-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--text-lightgrey);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
    color: #648fc5;
    background: #dbebff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-latest-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    padding: 12px 14px;
    border-bottom: 1px solid var(--text-lightgrey);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.forum-latest-item:last-child {
    border-bottom: none;
}

.forum-latest-item:hover {
    background: #f5f9fe;
}

.forum-latest-avatar {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 36px;
    -ms-flex: 0 0 36px;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    border: 1px solid var(--text-grey);
    background: var(--text-lightgrey);
}

.forum-latest-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    -o-object-fit: cover;
    object-fit: cover;
}

.forum-latest-body {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}

.forum-latest-meta {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: baseline;
    -webkit-align-items: baseline;
    -ms-flex-align: baseline;
    align-items: baseline;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin-bottom: 3px;
    /* gap: 8px не нужен, space-between сам разделяет */
}

.forum-latest-author {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-lightblue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.forum-latest-date {
    font-family: 'OpenSans', sans-serif;
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

.forum-latest-text {
    font-family: 'OpenSans', sans-serif;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.forum-latest-empty {
    padding: 25px 16px;
    text-align: center;
    color: #999;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
}

/* ---------- Сообщения в теме ---------- */
.forum-tema-meta-header {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

/* ============================================================
   АДМИН-ПАНЕЛЬ ТЕМЫ
   ============================================================ */

/* Обёртка кнопок уже flex-wrap, но зададим компактный размер */
.forum-tema-admin-panel {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 10px 0;
    padding: 10px;
    background: #f7fafd;
    border: 1px dashed var(--text-grey);
    border-radius: 5px;
}

.forum-tema-admin-panel > * {
    margin-right: 8px;
    margin-bottom: 6px;
}

/* Маленькие кнопки внутри админ-панели.
   Перебиваем размеры .main-button-noback и .main-button2
   только в этом контексте — остальные страницы не затронуты. */
.forum-tema-admin-panel .main-button-noback {
    min-width: 0;
    width: auto;
    padding: 0 12px;
    height: 30px;
    font-size: 13px;
}

.forum-tema-admin-panel .main-button2 {
    width: auto;
    padding: 0 12px;
    height: 30px;
    font-size: 13px;
}

/* Обёртка формы — inline, чтобы кнопки шли в ряд */
.forum-tema-admin-form {
    display: inline;
    margin: 0;
}

/* Плашка «Уведомление отправлено» */
.forum-tema-notify-sent {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    height: 30px;
    font-size: 12px;
    color: #666;
    background: #f7fafd;
    border: 1px dashed var(--text-grey);
    border-radius: 4px;
    font-family: 'Roboto Condensed', sans-serif;
    line-height: 1;
}

/* Модификатор для forum-empty с отступом снизу */
.forum-empty-mb {
    margin-bottom: 15px;
}


.forum-tema-admin-panel > * {
    margin-right: 8px;
    margin-bottom: 6px;
}

.forum-subscribe-row {
    margin: 10px 0;
}

.forum-posts {
    margin-top: 15px;
}

.forum-post {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--text-grey);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Левая колонка: аватар + имя + статус */
.forum-post-left {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 130px;
    -ms-flex: 0 0 130px;
    flex: 0 0 130px;
    width: 130px;
    text-align: center;
    margin-right: 18px;
}

.forum-post-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--text-grey);
    background: var(--text-lightgrey);
}

.forum-post-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    -o-object-fit: cover;
    object-fit: cover;
}

.forum-post-author-name {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    color: var(--text-darkblue);
    font-size: 15px;
    margin-top: 8px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.forum-post-author-status {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 11px;
    color: #888;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Правая колонка */
.forum-post-right {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    padding-right: 32px;   /* место под кнопку в углу */
}

.forum-post-top {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    -webkit-box-align: start;
    -webkit-align-items: start;
    -ms-flex-align: start;
    align-items: start;

}
.forum-post-first {
    border-left: 4px solid var(--text-darkblue);

}


.forum-post-date {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    color: #888;
    line-height: 1.3;
}

.forum-post-edited {

    margin-left: 3px;
}

.forum-post-body {
    font-family: 'OpenSans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #222;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 10px;
    margin-right: 10px;
    margin-top: 6px;
}

/* ---------- Картинки в постах: вписываются в любой экран ---------- */

.forum-post-body img,
.forum-post-body .image-inner img {
    display: block;
    max-width: min(600px, 100%);   /* ← 600px на широких, 100% на узких */
    max-height: 70vh;
    width: auto;
    height: auto;
    box-sizing: border-box;
    border-radius: 4px;
    cursor: zoom-in;
}
.forum-post-body img{
    margin: 10px 0;
}
.forum-post-body .image-inner img {
    margin: 0;
}
.forum-post-body .image-inner {
    display: block;
    max-width: min(600px, 100%);   /* ← 600px на широких, 100% на узких */;
    margin: 0 auto;
}

.image-width-600 {
    width: auto;
}
.forum-post-body blockquote,
.forum-editor-preview blockquote {
    display: block;
    border-left: 3px solid var(--text-grey);
    padding: 8px 15px;
    margin: 10px 0;
    color: #555;
    width: auto;
    text-align: left;
    position: static;
    background: #fafcff;
    border-radius: 0 4px 4px 0;
    flex-direction: row;
    float: none;
}

/* Убираем декоративную кавычку из основного CSS — и в сообщении, и в предпросмотре */
.forum-post-body blockquote::before,
.forum-post-body blockquote::after,
.forum-editor-preview blockquote::before,
.forum-editor-preview blockquote::after {
    content: none;
    display: none;
}


.forum-post-body pre,
.forum-post-body code {
    background: #f4f6f8;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.forum-post-body pre {
    padding: 10px;
    overflow-x: auto;
}

.forum-post-footer {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    border-top: 1px solid var(--text-lightgrey);
    padding-top: 10px;
    margin-top: 5px;
}

/* ---------- Меню сообщения (три точки) ---------- */
.forum-post-menu {
    position: absolute;
    top: -11px;
    right: -12px;

}
.forum-post-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;                    /* ← было 4px */
    border-radius: 4px;
    color: #888;
    line-height: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    min-width: 28px;                 /* ← новый минимум */
    min-height: 28px;
    -webkit-transition: background 0.15s, color 0.15s;
    transition: background 0.15s, color 0.15s;
}

.forum-post-menu-btn:hover {
    background: #f0f4f9;
    color: var(--text-darkblue);
}

.forum-post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: #fff;
    background: #f7fafd;
    border: 1px solid var(--text-grey);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
    margin-top: 2px;
}

.forum-post-menu-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
}

.forum-post-menu-item:hover {
    background: #e8f2fc;
}

.forum-post-menu-item-danger {
    color: #e7515a;
}

.forum-post-menu-item-danger:hover {
    background: #ffe1e2;
}

.forum-post-menu-form {
    margin: 0;
    display: block;
}

/* ---------- Реакции: триггер-сердце ---------- */
.forum-reaction-trigger {
    background: none;
    border: 1px solid var(--text-grey);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #888;
    margin-right: 8px;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.forum-reaction-trigger:hover {
    border-color: var(--text-darkblue);
    color: var(--text-darkblue);
}


/* Увеличенные реакции */


.forum-reaction-emoji {
    font-size: 20px;
    margin-right: 5px;
    line-height: 1;
}

.forum-reaction-count {
    font-size: 14px;
    font-weight: 600;
}


/* ---------- Реакции ---------- */
.forum-reactions {
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    /* Не растягиваться на всю ширину */
    -webkit-box-flex: 0;
    -webkit-flex: 0 1 auto;
    -ms-flex: 0 1 auto;
    flex: 0 1 auto;
}
/* Триггер-сердце */
.forum-reaction-trigger {
    background: none;
    border: 1px solid var(--text-grey);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #888;
    margin-right: 8px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
}

.forum-reaction-trigger:hover {
    border-color: var(--text-darkblue);
    color: var(--text-darkblue);
}

/* Панель выбора реакций: 3 в ряд, иконки 60×60 */
.forum-reaction-picker {
    display: none;
    position: absolute;
    top: -8px;
    left: 46px;
    background: #ffffff;
    border: 1px solid var(--text-grey);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 100;
    width: 162px;            /* 3×(44+4) + padding 16 + border 2 */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;

    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
}

.forum-reactions[data-open="1"] .forum-reaction-picker {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}


.forum-reaction-pick {
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;

    -webkit-box-flex: 0;
    -webkit-flex: 0 0 44px;
    -ms-flex: 0 0 44px;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 2px;

    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;

    -webkit-transition: border-color 0.15s, background 0.15s;
    transition: border-color 0.15s, background 0.15s;
}

.forum-reaction-pick:hover {
    background: #f0f4f9;
    border-color: var(--text-grey);
}

.forum-reaction-pick.is-active {
    border-color: var(--text-darkblue);
    background: #e8f2fc;
}
.forum-reaction-pick img {
    width: 40px;
    height: 40px;
    display: block;
}

/* Пилюли с поставленными реакциями */
.forum-reactions-placed {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

.forum-reaction-btn {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    background: #e8f2fc;

    border-radius: 22px;
    padding: 2px 12px 2px 10px;
    margin-right: 6px;
    cursor: pointer;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
}

.forum-reaction-btn:hover {
    background: #e8f2fc;

}

.forum-reaction-btn.is-active {
    background: #c1dfff;
}

.forum-reaction-btn.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.forum-reaction-img {
    width: 28px;
    height: 28px;
    display: block;
    margin-right: 4px;
}

.forum-reaction-count {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #555;
}

.forum-reaction-btn.is-active .forum-reaction-count {
    color: var(--text-darkblue);
}

/* ---------- «Кто оценил» — разворачивающийся список ---------- */
/* ---------- «Кто оценил» — список в стиле Telegram ---------- */
.forum-reactions-list {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--text-lightgrey);
}

.forum-reactions-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--text-lightgrey);
}

.forum-reactions-row:last-child {
    border-bottom: none;
}

.forum-reactions-row-avatar {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 32px;
    -ms-flex: 0 0 32px;
    flex: 0 0 32px;
    width:32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    border: 1px solid var(--text-grey);
    background: var(--text-lightgrey);
}

.forum-reactions-row-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    -o-object-fit: cover;
    object-fit: cover;
}

.forum-reactions-row-info {
    -webkit-box-flex: 0;
    -webkit-flex: 0 1 auto;
    -ms-flex: 0 1 auto;
    flex: 0 1 auto;
    min-width: 0;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1px;
}
.forum-reactions-row-name {
    color: var(--text-darkblue);

}

.forum-reactions-row-date {
    color: #999;
    margin-left: 4px;
    font-weight: 400;
}

.forum-reactions-row-icon {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 26px;
    -ms-flex: 0 0 26px;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    display: block;
    margin-left: 8px;
}

/* Пункт «Кто оценил» в меню трёх точек */
.reactions-toggle-count {
    color: #888;
    margin-left: 4px;
    font-weight: 400;
}
/* ---------- Блок ответа ---------- */
.forum-reply-block {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--text-grey);
}

.forum-reply-title {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-darkblue);

}

/* ---------- Редактор ---------- */
.forum-editor {
    border: 1px solid var(--text-grey);
    border-radius: 6px;
    background: #fff;
    margin-top: 10px;
}

.forum-editor-tabs {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    border-bottom: 1px solid var(--text-grey);
    background: #f7fafd;
    border-radius: 6px 6px 0 0;
}

.forum-editor-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.forum-editor-tab.is-active {
    color: var(--text-darkblue);
    border-bottom-color: var(--text-darkblue);
    font-weight: 700;
}

.forum-editor-toolbar {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 6px 8px;
    background: #fafcff;
    border-bottom: 1px solid var(--text-lightgrey);
}

.forum-editor-btn {
    background: #fff;
    border: 1px solid var(--text-grey);
    border-radius: 4px;
    width: 32px;
    height: 30px;
    margin-right: 4px;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    color: #444;
    padding: 0;
    line-height: 1;
}

.forum-editor-btn:hover {
    background: #e8f2fc;
    border-color: var(--text-darkblue);
}

.forum-editor-hint {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

.forum-editor-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0 0 6px 6px;
    padding: 12px;
    font-family: 'OpenSans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #222;
    resize: vertical;
    min-height: 150px;
    outline: none;
}

.forum-editor-textarea:focus {
    background: #fdfefe;
}

.forum-editor-preview {
    padding: 12px;
    min-height: 150px;
    font-family: 'OpenSans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #222;
}

.forum-editor-preview img {
    max-width: 100%;
    height: auto;
}

.forum-editor-preview-empty {
    color: #aaa;

    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.forum-editor-actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 10px 0;
    margin-top: 10px;
    margin-left: 10px;
}

.forum-editor-status {
    margin-left: 12px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    color: var(--text-darkgrey);
}

/* ---------- HTML-режим редактора (только у админа) ---------- */
.forum-editor-btn-html {
    font-family: Consolas, monospace;
    font-weight: 700;
    width: 44px;
}

.forum-editor.is-html-mode .forum-editor-btn:not(.forum-editor-btn-html) {
    display: none;
}

.forum-editor.is-html-mode .forum-editor-btn-html {
    background: var(--text-darkblue);
    color: #ffffff;
    border-color: var(--text-darkblue);
}

.forum-editor.is-html-mode .forum-editor-btn-html:hover {
    background: #2a7ab0;
    border-color: #2a7ab0;
}

.forum-editor-html-badge {
    display: none;
    padding: 6px 10px;
    background: #fff8e6;
    border-bottom: 1px solid #f4d27a;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    color: #8a5c00;
    line-height: 1.4;
}

.forum-editor.is-html-mode .forum-editor-html-badge {
    display: block;
}

.forum-editor.is-html-mode .forum-editor-textarea {

    background: #ffffff;
    min-height: 250px;

    font-family: 'OpenSans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #222;
}

.forum-editor.is-html-mode .forum-editor-hint {
    display: none;
}

/* ============================================================
   ОТВЕТ НА СООБЩЕНИЕ (как в ВК)
   ============================================================ */

/* ---------- Блок цитаты в редакторе (над полем ввода) ---------- */
.forum-editor-reply-quote {
    background: #f0f6fc;
    border: 1px solid var(--text-grey);
    border-left: 4px solid var(--text-darkblue);
    border-radius: 6px;
    padding: 10px 14px;
    margin: 10px 10px 0;
    font-family: 'Roboto Condensed', sans-serif;
    position: relative;
}

.forum-editor-reply-quote-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.forum-editor-reply-quote-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-editor-reply-quote-label b {
    color: var(--text-darkblue);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.forum-editor-reply-clear {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

.forum-editor-reply-clear:hover {
    background: #ffe1e2;
    color: #e7515a;
}

.forum-editor-reply-quote-text {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ---------- Блок цитаты в сообщении (над текстом) ---------- */
.forum-post-reply-quote {
    display: block;
    width: 100%;                 /* ← гарантированно на всю ширину родителя */
    box-sizing: border-box;      /* ← padding не выходит за 100% */
    background: #f0f6fc;
    border-left: 4px solid var(--text-darkblue);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 5px;
    margin-top: 4px;
    overflow: hidden;            /* ← ничего не вылезает */
}

.forum-post-reply-quote-head {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    margin-bottom: 4px;
}

.forum-post-reply-quote-label {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.forum-post-reply-quote-author {
    color: var(--text-darkblue);
    font-weight: 400;
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
}

.forum-post-reply-quote-body {
    display: flex;
    align-items: baseline;
    width: 100%;                 /* ← растянуть на всю ширину блока */
    box-sizing: border-box;
    font-family: 'OpenSans', sans-serif;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    min-width: 0;                /* ← разрешить flex-сжатие */
    overflow: hidden;
}

.forum-post-reply-quote-text {
    flex: 0 1 auto;              /* ← было 1 1 auto — не растягивать */
    min-width: 0;                /* ← но сжиматься при нехватке */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.forum-post-reply-quote-link {
    flex: 0 0 auto;
    margin-left: 8px;
    color: var(--text-darkblue);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px dashed var(--text-darkblue);
    white-space: nowrap;
    cursor: pointer;

}

.forum-post-reply-quote-link:hover {
    color: #f35c29;
    border-bottom-color: #f35c29;
}

/* ---------- Подсветка оригинала при скролле ---------- */
.forum-post-highlight {
    animation: forum-post-highlight-pulse 1.5s ease-out;
}

@keyframes forum-post-highlight-pulse {
    0%   { background-color: #fff3c4; }
    100% { background-color: #ffffff; }
}

/* ---------- Формы ---------- */
.forum-form-hint {
    font-family: 'OpenSans', sans-serif;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    line-height: 1.5;
}

.forum-form-cancel {
    margin-left: 15px;
    color: #888;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px dashed #888;
    cursor: pointer;
}

.forum-form-cancel:hover {
    color: #f35c29;
    border-bottom-color: #f35c29;
}

/* ---------- Страница темы: «К статье» + строка действий ---------- */
.forum-tema-article-header {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

.forum-tema-actions-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 5px;
}

.forum-tema-actions-row > * {
    margin-right: 8px;
    margin-bottom: 8px;
}

/* ============================================================
   INLINE-РЕДАКТИРОВАНИЕ СООБЩЕНИЯ
   ============================================================ */

.forum-post-body-edit {
    margin-bottom: 10px;
    margin-right: 10px;
}

.forum-post-body-edit-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 150px;
    padding: 10px 12px;
    font-family: 'OpenSans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #222;
    background: #fbfcfe;
    border: 1px solid var(--text-grey);
    border-radius: 6px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.forum-post-body-edit-textarea:focus {
    border-color: var(--text-darkblue);
    background: #ffffff;
}

.forum-post-body-edit-actions {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.forum-post-body-edit-actions > * {
    margin-right: 8px;
}
/* ---------- Плашка «Важный ответ» ---------- */
.forum-post-important-badge {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 4px 12px 4px 8px;
    margin-bottom: 8px;
    background: #fff8e1;
    border: 1px solid #f4c95d;
    border-radius: 16px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #8a5c00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 145px;
}

.forum-post-important-icon {
    width: 14px;
    height: 14px;
    display: block;
    margin-right: 6px;
    color: #d99b00;
}

.forum-post-important-text {
    line-height: 1;
}

/* ---------- Рейтинг автора: звезда + число ---------- */
.forum-post-author-rating {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-top: 5px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #d99b00;
    line-height: 1;
}

.forum-post-author-rating-icon {
    width: 12px;
    height: 12px;
    display: block;
    margin-right: 3px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.forum-post-author-rating-count {
    line-height: 1;
}

/* ---------- Бейдж «Подписчиков темы» (только админ) ---------- */
.forum-tema-subs-badge {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    margin-bottom: 8px;
    background: #e8f2fc;
    border: 1px solid var(--text-grey);
    border-radius: 15px;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-darkblue);
    line-height: 1;
    cursor: help;
    white-space: nowrap;
}
/* Мобильный */
@media (max-width: 600px) {
    .forum-post-body-edit {
        margin-right: 0;
    }

    .forum-post-body-edit-textarea {
        font-size: 13px;
        min-height: 120px;
    }
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

/* ---------- Планшет (≤1100px): одна колонка ---------- */
@media (max-width: 1100px) {
    .forum-layout {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .forum-main-col {
        -webkit-flex: 1 1 auto;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .forum-side-col {
        -webkit-flex: 1 1 auto;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ---------- Мобильный (≤600px) ---------- */
@media (max-width: 600px) {
    .forum-title {
        font-size: 22px;
    }

    .forum-title-link {

        padding: 2px 8px;
    }

    /* Блоки разделов */
    .forum-block {
        margin-bottom: 15px;
    }

    .forum-block-title {
        padding: 8px 12px;
    }

    .forum-block-title-text {
        font-size: 14px;
    }

    .forum-block-title-count {
        font-size: 10px;
        padding: 2px 8px;
        margin-left: 8px;
    }

    .forum-block-desc {
        padding: 8px 14px;
        font-size: 14px;
    }

    /* Темы в блоке */
    .forum-block-tema {
        padding: 10px 12px;
    }

    .forum-block-tema-left {
        -webkit-flex: 0 0 70px;
        -ms-flex: 0 0 70px;
        flex: 0 0 70px;
        width: 70px;
        margin-right: 10px;
    }

    .forum-block-tema-avatar {
        width: 40px;
        height: 40px;
    }



    .forum-block-tema-title {
        font-size: 16px;
    }

    .forum-block-tema-article-inline {
        display: block;
        margin-left: 0;
        margin-top: 2px;
        font-size: 11px;
    }

    .forum-block-tema-meta {
        font-size: 12px;
        flex-wrap: wrap;
    }

    /* Последние сообщения */
    .forum-latest-header {
        padding: 8px 14px;
        font-size: 14px;
    }

    .forum-latest-item {
        padding: 10px 12px;
    }

    .forum-latest-avatar {
        -webkit-flex: 0 0 42px;
        -ms-flex: 0 0 42px;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        margin-right: 12px;
    }

    .forum-latest-author {
        font-size: 13px;
    }

    .forum-latest-text {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }

    /* Заголовок страницы + кнопка на мобильном */
    .forum-zagolovok-row {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: start;
        -webkit-align-items: flex-start;
        -ms-flex-align: start;
        align-items: flex-start;
    }

    .forum-zagolovok-row .forum-title {
        margin-right: 0;
    }

    .forum-zagolovok-row .main-button {
        margin-top: 8px;
    }

    /* Сообщения в теме */


    .forum-post-footer {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-box-pack: start;
        -webkit-justify-content: flex-start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
        border-top: 1px solid var(--text-lightgrey);
        padding-top: 10px;
        margin-top: 5px;
    }

    .forum-post-actions {
        margin-top: 8px;
    }

    .forum-post-actions > * {
        margin-left: 0;
        margin-right: 10px;
    }

    .forum-post-body {
        font-size: 14px;
    }

    /* Реакции */

    .forum-reaction-emoji {
        font-size: 13px;
    }

    /* Редактор */
    .forum-editor-hint {
        display: none;
    }

    .forum-editor-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .forum-editor-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .forum-editor-textarea {

        min-height: 120px;
    }

    /* Таблица тем — на мобильном горизонтальный скролл */
    .forum-temas-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }


}
/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ СООБЩЕНИЯ (≤480px) — без gap
   ============================================================ */
@media (max-width: 480px) {

    @supports (-webkit-touch-callout: none) {
        .forum-editor-textarea,
        .forum-post-body-edit-textarea {
            font-size: 16px;
        }
    }

    .forum-main-col {

        margin-bottom: 0px;
    }


    /* ---------- Кнопки действий темы: 2 строки ---------- */

    /* Контейнер — block, чтобы кнопка заняла свою строку */
    .forum-tema-actions-row {
        display: block;
    }

    /* «Подписаться» — block-level, по ширине контента.
       display: table — самый совместимый способ:
       block-level box + сжимается по содержимому.
       Работает в Safari с 4-й версии. */
    .forum-tema-actions-row .forum-subscribe-btn {
        display: table;
        width: auto;
        margin: 0 0 8px 0;
        padding: 0 16px;
        text-align: center;
        /* Перебиваем flex из .main-button-noback */
        -webkit-box-pack: initial;
        -webkit-justify-content: initial;
        -ms-flex-pack: initial;
        justify-content: initial;
        -webkit-box-align: initial;
        -webkit-align-items: initial;
        -ms-flex-align: initial;
        align-items: initial;
    }

    /* Чипы — inline-block, идут после кнопки в одну строку */
    .forum-tema-actions-row .forum-title-link {
        display: inline-block;
        vertical-align: middle;
        margin-bottom: 4px;
    }

    .forum-reply-block {
        margin-top: 0px;
        padding-top: 20px;
    }
    .pagination {

        margin-top: 5px;
    }
    /* У пагинации сверху — отступ снизу, чтобы не прилипала к постам */
    .content-area-page > .forum-pagination {
        margin-top: 0px;
        margin-bottom: 0;
    }


    .forum-post-menu-item {
        font-size: 16px;
        padding: 10px 14px;
    }

    /* Контейнер — grid 60px + остальное. Без gap. */
    .forum-post {
        display: -ms-grid;
        display: grid;
        -ms-grid-columns: 60px 1fr;
        grid-template-columns: 60px 1fr;
        padding: 12px;
        position: relative;
    }

    /* Раскрываем обёртки, чтобы дети стали прямыми потомками grid */
    .forum-post-left,
    .forum-post-right,
    .forum-post-top {
        display: contents;
    }

    /* ---------- ЛЕВАЯ КОЛОНКА: аватар ---------- */
    .forum-post-avatar {
        -ms-grid-column: 1;
        grid-column: 1;
        -ms-grid-row: 1;
        -ms-grid-row-span: 3;
        grid-row: 1 / 4;
        width: 60px;
        height: 60px;
        min-height: 60px;
        margin: 0;
        align-self: start;
    }

    /* ---------- ПРАВАЯ КОЛОНКА: дата → имя → статус ---------- */

    .forum-post-date {
        -ms-grid-column: 2;
        grid-column: 2;
        -ms-grid-row: 1;
        grid-row: 1;
        padding-left: 12px;      /* отступ от аватара */
        padding-right: 28px;     /* место под ⋮ */
        margin: 0 0 3px 0;       /* отступ до имени */
        text-align: left;
        line-height: 1;
        font-size: 13px;
    }

    /* Строка «имя + звезда» — grid-item на месте старого имени */
    .forum-post-author-name-line {
        -ms-grid-column: 2;
        grid-column: 2;
        -ms-grid-row: 2;
        grid-row: 2;
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: start;
        -webkit-justify-content: flex-start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        padding-left: 12px;
        padding-right: 28px;
        margin: 0 0 2px 0;
        min-width: 0;
    }

    .forum-post-author-name-line .forum-post-author-name {
        -webkit-box-flex: 0;
        -webkit-flex: 0 1 auto;
        -ms-flex: 0 1 auto;
        flex: 0 1 auto;
        min-width: 0;
        padding: 0;
        margin: 0 6px 0 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
        font-size: 15px;
        line-height: 1;
    }

    .forum-post-author-rating {
        -webkit-box-flex: 0;
        -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        margin-top: 0;
        margin-left: 0;
    }
    .forum-post-author-status {
        -ms-grid-column: 2;
        grid-column: 2;
        -ms-grid-row: 3;
        grid-row: 3;
        padding-left: 12px;
        margin: 0;
        text-align: left;
        font-size: 11px;
        line-height: 1;
    }

    /* ---------- ВСЁ ОСТАЛЬНОЕ — на всю ширину, ниже метаданных ---------- */
    .forum-post-reply-quote,
    .forum-post-body,
    .forum-post-body-edit,
    .forum-post-footer,
    .forum-reactions-list {
        -ms-grid-column: 1;
        -ms-grid-column-span: 2;
        grid-column: 1 / -1;
        margin-right: 0;
        margin-left: 0;
    }

    /* Список «Кто оценил» — на мобильном даём больше места имени и дате */
    .forum-reactions-row-info {
        -ms-flex: 1 1 auto;
        -webkit-box-flex: 1;
        -webkit-flex: 1 1 auto;
        flex: 1 1 auto;
    }

    .forum-reactions-row-name {
        font-size: 13px;
    }

    .forum-reactions-row-date {
        font-size: 11px;
    }

    .forum-post-body {
        margin-top: 10px;
        font-size: 14px;
    }

    .forum-post-reply-quote {
        margin-top: 8px;
        margin-bottom: 4px;
    }

    .forum-post-body-edit {
        margin-right: 0;
    }

    /* Кнопка ⋮ — правый верхний угол сообщения */
    .forum-post-menu {
        top: 6px;
        right: 6px;
    }

    .forum-posts {
        margin-top: 7px;
    }

    /* Кнопка ⋮ — большая зона для пальца */
    .forum-post-menu {
        top: 0px;
        right: -4px;
    }

    .forum-post-menu-btn {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 6px;
    }

    /* SVG — крупнее, но не на всю кнопку */
    .forum-post-menu-btn svg {
        width: 22px;
        height: 22px;
    }


}
/* ---------- Узкий мобильный (≤400px) ---------- */
@media (max-width: 400px) {
    .forum-title {
        font-size: 22px;
        margin-top: 10px;
    }

    .forum-block-tema {
        padding: 10px;
    }

    .forum-block-tema-left {
        -webkit-flex: 0 0 70px;
        -ms-flex: 0 0 70px;
        flex: 0 0 70px;
        width: 70px;
        margin-right: 8px;
    }



    .forum-block-tema-meta {
        font-size: 11px;
    }


    .forum-latest-text {
        -webkit-line-clamp: 1;
    }
}
/* ---------- Узкий мобильный (≤360px) ---------- */
@media (max-width: 360px) {
    .forum-reaction-img {
        width: 26px;
        height: 26px;
    }
}
