/* Общее обсуждение новостей и сохранённых билдов */
.comments-section{margin-top:32px;padding:24px;border:1px solid var(--color-border);border-radius:12px;background:var(--color-panel);scroll-margin-top:30px;min-width:0}
.news-article .comments-section{padding:24px 0 0;border:0;border-top:1px solid var(--color-border);border-radius:0;background:transparent}
.comments-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.clubslab-page .comments-heading h2{margin:0;font-size:20px;line-height:1.4}
.comments-heading h2 span{margin-left:8px;font-size:12px;padding:4px 8px;border-radius:20px;background:var(--color-success-alpha-10);color:var(--color-brand);vertical-align:middle}
.clubslab-page .comments-section label{display:block;margin-bottom:8px;font-size:12px;color:var(--color-text-caption)}
.clubslab-page .comments-section textarea{box-sizing:border-box;display:block;width:100%;min-height:72px;resize:vertical;padding:12px;border:1px solid var(--color-border);border-radius:8px;background:var(--color-page);color:var(--color-text);font:inherit;font-size:13px;line-height:1.7}
.comments-section textarea:focus{outline:1px solid var(--color-brand);outline-offset:1px}
.comment-form-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px}
.comments-section button{font:inherit;font-size:12px;cursor:pointer}
.comments-section button:disabled{opacity:.5;cursor:wait}
.comments-section button[type=submit]{padding:9px 14px;border:1px solid var(--color-success-alpha-48);border-radius:8px;color:var(--color-brand);background:var(--color-success-alpha-10)}
.comments-section a{color:var(--color-brand);text-decoration:none}
.comments-section a:hover{text-decoration:underline;text-underline-offset:3px}
.comments-login{font-size:13px;line-height:1.8;color:var(--color-text-caption)}
.comment-item:last-child{border-bottom:0;padding-bottom:0}
.comment-content{flex:1;min-width:0}
.comment-meta a{font-size:12px;font-weight:600;overflow-wrap:anywhere}
.comment-actions>button,.comment-actions form>button,.comment-moderate>button,.comment-form-bottom>button[type=button],.comment-replying button{padding:0;border:0;background:none;color:var(--color-text-caption);font-size:11px;line-height:1.8}
.comments-section button:focus-visible,.comments-section a:focus-visible,.comment-report summary:focus-visible{outline:2px solid var(--color-brand);outline-offset:3px}
.comment-actions button:hover,.comment-report summary:hover{color:var(--color-brand)}
.comment-report{font-size:11px;color:var(--color-text-caption)}
.comment-report form{width:min(300px,100%);margin-top:12px}
.comment-report button[type=submit]{margin-top:10px}
.comment-replying{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;padding:8px 12px;background:var(--color-success-alpha-10);color:var(--color-brand);border-radius:8px;font-size:12px}
.comment-replying button{font-size:20px}
.comment-edit-form,.comment-moderate{margin-top:12px}
.comments-section [hidden]{display:none}
.comment-error{color:var(--color-error);font-size:12px;line-height:1.7;margin:10px 0 0}
.comments-pagination{display:flex;justify-content:center;gap:16px;margin-top:24px;margin-bottom:12px;font-size:12px}
@media(max-width:650px){.comments-section{padding:18px 15px}.clubslab-page .comments-heading h2{font-size:18px}.comment-form-bottom{align-items:flex-start}}

.comments-section .comment-actions form>button,.comments-section .comment-moderate>button{padding:0;border:0;background:none;color:var(--color-text-caption);font-size:11px;line-height:1.8}

/* Компактное поле с раскрытием при вводе и кнопкой отправки внутри */
.comment-composer{position:relative;border:1px solid var(--color-border);border-radius:12px;background:var(--color-page)}
.clubslab-page .comments-section .comment-composer textarea{width:100%;min-height:46px;max-height:260px;height:46px;padding:11px 56px 11px 14px;border:0;border-radius:12px;background:transparent;font-size:13px;line-height:24px;resize:vertical;transition:none}

.comment-composer:focus-within{border-color:var(--color-success-alpha-48)}
.clubslab-page .comments-section .comment-composer textarea:focus{outline:none}
.comments-section .comment-composer button[type=submit]{position:absolute;right:6px;bottom:5px;display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:8px;border:0;border-radius:8px;background:var(--color-success-alpha-10);color:var(--color-brand)}
.comment-composer button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(hover:hover){.comments-section .comment-composer button[type=submit]:hover{background:var(--color-success-alpha-18)}}
@media(prefers-reduced-motion:reduce){.clubslab-page .comments-section .comment-composer textarea{transition:none}}

/* Панель оформления текста и локальный выбор эмодзи без вложений */
.comment-composer{overflow:visible}
.comment-editor-toolbar{display:flex;align-items:center;gap:4px;position:relative}
.comment-composer>.comment-editor-toolbar{display:flex;position:absolute;left:8px;right:52px;bottom:6px;opacity:0;visibility:hidden;transform:translateY(6px);transition:opacity 560ms ease,transform 560ms ease,visibility 560ms;pointer-events:none}
.comment-composer.is-expanded>.comment-editor-toolbar,.comment-composer:focus-within>.comment-editor-toolbar{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto}
.clubslab-page .comments-section .comment-composer.is-expanded textarea,.clubslab-page .comments-section .comment-composer:focus-within textarea{padding-bottom:46px}
.comments-section .comment-editor-toolbar button[type=button]{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex:none;padding:5px;border:0;border-radius:6px;background:transparent;color:var(--color-text-caption);font-size:14px;line-height:20px}
.comment-editor-toolbar button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.comment-editor-toolbar button[aria-expanded=true]{background:var(--color-success-alpha-10);color:var(--color-brand)}
.comment-edit-form>.comment-editor-toolbar{margin-top:8px}
.comment-emoji-picker{position:absolute;left:0;bottom:calc(100% + 10px);z-index:20;display:grid;grid-template-columns:repeat(6,1fr);gap:4px;width:232px;max-width:calc(100vw - 88px);padding:8px;border:1px solid var(--color-border);border-radius:10px;background:var(--color-panel);box-shadow:0 8px 24px #0006}
.comments-section .comment-emoji-picker button[type=button]{width:100%;height:32px;padding:3px;font-size:20px;line-height:26px}
.comment-text strong{font-weight:700}
.comment-text em{font-style:italic}
@media(hover:hover){.comments-section .comment-editor-toolbar button[type=button]:hover{background:var(--color-success-alpha-10);color:var(--color-brand)}}

/* Визуальный редактор занимает прежнее место поля и раскрывается общей анимацией */
.comment-rich-field.ql-container{font:inherit;font-size:13px;border:0;min-width:0}
.comment-rich-field .ql-editor{font:inherit;line-height:24px;overflow-wrap:anywhere;white-space:pre-wrap;padding:12px;min-height:72px;color:var(--color-text)}
.comment-rich-field .ql-editor:focus{outline:none}
.comment-rich-field .ql-editor.ql-blank::before{font-style:normal;color:var(--color-text-caption);left:14px;right:56px}
.comment-composer>.comment-rich-field{height:46px;min-height:46px;max-height:260px;overflow:hidden;border-radius:12px}
.comment-composer .ql-editor{height:100%;min-height:0;padding:11px 56px 11px 14px}
.comment-composer.is-expanded .ql-editor{padding-bottom:46px}
.comment-rich-field .ql-editor blockquote{margin:4px 0;padding:2px 10px;border-left:2px solid var(--color-success-alpha-48);color:var(--color-text-caption)}
.comment-rich-field .ql-editor strong{font-weight:700}
.comment-rich-field .ql-editor em{font-style:italic}
.comment-rich-field .ql-editor p{margin:0}
.comment-edit-form>.comment-rich-field{border:1px solid var(--color-border);border-radius:8px;background:var(--color-page);max-height:260px;overflow:auto}
.comment-editor-toolbar button[aria-pressed=true]{background:var(--color-success-alpha-10);color:var(--color-brand)}

/* Ветки остаются целыми при пагинации, глубина отступа ограничена на узких экранах */
.comment-thread{position:relative;--thread-step:28px}
.comment-thread+.comment-thread{margin-top:8px}
.comment-thread:has(.is-reply)>.comment-item::after{content:'';position:absolute;left:calc(18px - var(--comment-depth) * var(--thread-step));top:0;bottom:0;width:1px;background:var(--color-border);pointer-events:none}
.comment-thread:has(.is-reply)>.comment-item:first-child::after{top:48px}
.comment-thread:has(.is-reply)>.comment-item:last-child::after{bottom:auto}
.comment-thread .comment-item{margin-left:calc(var(--comment-depth) * var(--thread-step))}
.comment-thread .is-reply::before{content:'';position:absolute;left:calc(18px - var(--comment-depth) * var(--thread-step));width:calc(var(--comment-depth) * var(--thread-step) - 18px);height:1px;background:var(--color-border)}
@media(max-width:650px){.comment-thread{--thread-step:16px}.comment-thread:has(.is-reply)>.comment-item::after{left:calc(15px - var(--comment-depth) * var(--thread-step))}.comment-thread:has(.is-reply)>.comment-item:first-child::after{top:40px}.comment-thread .is-reply::before{left:calc(15px - var(--comment-depth) * var(--thread-step));width:calc(var(--comment-depth) * var(--thread-step) - 15px)}}

/* Лёгкая лента обсуждения с акцентом на автора и удобными действиями */
.comments-list{margin-top:24px;margin-bottom:12px}
.comment-item{display:flex;border-bottom:1px solid var(--color-border);scroll-margin-top:30px;gap:12px;padding:10px 0;border:0;position:relative}
.comment-item+.comment-item{margin-top:0}
.comment-meta{display:flex;flex-wrap:wrap;align-items:center;color:var(--color-text-caption);gap:8px;min-height:22px;line-height:1.5;font-size:0.6875rem}
.comments-section .comment-meta a{color:var(--color-text);font-size:0.8125rem;font-weight:650}
.comment-meta time{color:var(--color-text-caption);font-size:0.6875rem}
.comment-meta time::before{content:'·';margin-right:8px;opacity:.6}
.comment-meta>span{font-size:0.625rem;opacity:.65}
.comment-text{overflow-wrap:anywhere;margin-top:5px;font-size:0.875rem;line-height:1.65;max-width:75ch}
.comment-actions{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin-top:9px;margin-left:-8px}
.comments-section .comment-actions>button,.comments-section .comment-actions form>button,.comment-report summary{display:inline-flex;align-items:center;gap:5px;min-height:30px;padding:5px 8px;border:0;border-radius:7px;background:transparent;font-size:0.6875rem;line-height:20px;color:var(--color-text-caption);transition:background 160ms,color 160ms}
.comment-actions button svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.comment-report summary{list-style:none;cursor:pointer}
.comment-report summary::-webkit-details-marker{display:none}
.comment-report[open]{flex-basis:100%}
.comment-placeholder{color:var(--color-text-caption);line-height:1.7;margin:6px 0;font-size:0.75rem;opacity:.75}
@media(hover:hover){.comments-section .comment-actions button:hover,.comment-report summary:hover{background:var(--color-success-alpha-10);color:var(--color-brand)}.comments-section .comment-actions [data-comment-delete] button:hover{background:#ed5b6914;color:var(--color-error)}}
@media(max-width:650px){.comment-item{gap:10px;padding:8px 0}.comment-text{font-size:0.8125rem;line-height:1.7}.comment-meta{gap:6px}.comment-meta time{font-size:0.625rem}.comments-section .comment-meta a{font-size:0.75rem}.comment-actions{column-gap:0}.comments-section .comment-actions>button,.comments-section .comment-actions form>button,.comment-report summary{min-height:34px;padding:6px 8px}}

/* Компактные сообщения с аватаром за пределами мягкого блока */
.comment-card{display:flex;align-items:flex-start;gap:12px;width:100%;min-width:0}
.comment-card>.comment-avatar{position:relative;z-index:1}
.comment-card>.comment-content{flex:0 1 auto;box-sizing:border-box;min-width:0;max-width:calc(100% - 50px);padding:10px 14px 7px;border:1px solid #ffffff08;border-radius:4px 14px 14px 14px;background:#ffffff04}
.comment-card .comment-meta{min-height:20px}
.comment-card .comment-actions{margin-top:5px}
.comment-card .comment-text{margin-top:4px}
.comment-thread:has(.is-reply)>.comment-item::after,.comment-thread .is-reply::before{opacity:.55}
.comment-thread .is-reply::before{top:28px}
.comment-thread:has(.is-reply)>.comment-item:last-child::after{height:28px}
@media(max-width:650px){.comment-card{gap:9px}.comment-card>.comment-content{max-width:calc(100% - 41px);padding:9px 10px 1px;border-radius:4px 11px 11px 11px}.comment-card .comment-actions{margin-top:2px}.comment-thread .is-reply::before{top:24px}.comment-thread:has(.is-reply)>.comment-item:last-child::after{height:24px}}

.comment-topline{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.comment-topline .comment-meta{flex-wrap:wrap;min-width:0}
.comment-management{display:flex;align-items:center;gap:2px;margin:-3px -5px 0 0;flex:none}
.comment-management form{margin:0}
.comments-section .comment-management button,.comments-section .comment-moderate>button{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;min-height:0;padding:5px;border:0;border-radius:6px;background:transparent;color:var(--color-text-caption);cursor:pointer}
.comment-management svg,.comment-moderate svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(hover:hover){.comments-section .comment-management button:hover{color:var(--color-brand);background:var(--color-success-alpha-10)}.comments-section .comment-management [data-comment-delete] button:hover{color:var(--color-error)}}
@media(max-width:650px){.comment-topline{gap:6px}.comment-management{gap:0}.comments-section .comment-management button{width:24px;height:26px;padding:4px}}


.comment-compose-row{position:relative;display:flex;align-items:flex-start;min-width:0}
.comment-compose-row>.comment-composer{flex:1;min-width:0}
.comment-compose-row>.comment-compose-avatar{position:absolute;z-index:2;left:11px;top:9px;width:28px;height:28px;margin:0;pointer-events:none}
.comment-compose-row .comment-composer .ql-editor,.clubslab-page .comments-section .comment-compose-row .comment-composer textarea{padding-left:50px}
.comment-compose-row .ql-editor.ql-blank::before{left:50px}
.comment-compose-row .comment-composer>.comment-editor-toolbar{left:44px}

