.tags .tag-link::before,
.tags .tag-link::after {
    content: none !important;
}

/* выстраиваем «пилюли» в ряд и разрешаем перенос */
.tags .tag-item {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
}

/* дубль для уверенности */
.tags .tag-link::before,
.tags .tag-link::after {
    content: none !important;
}

.vote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f5f5f7;
    min-width: 46px;
    font-size: 13px;
}

.vote-box .upvote,
.vote-box .downvote {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.vote-box i {
    font-size: 18px;
    line-height: 1;
}

.vote-box .count {
    font-weight: 600;
    margin: 4px 0;
}

.vote-box .count.positive {
    color: #198754;
}

.vote-box .count.negative {
    color: #dc3545;
}

/* лёгкий визуальный push */
.vote-box .upvote.upvoted i {
    transform: translateY(-1px);
}

.vote-box .downvote.downvoted i {
    transform: translateY(1px);
}

.answer-wrap.accepted {
    border-left: 4px solid #28a745;
    background: #f6fff8;
}

/* ==========================
   QUESTION META BLOCK
========================== */

.question-meta-block {
    border-top: 1px solid #eee;
    margin-top: 24px;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ряд с кнопками */
.qm-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.qm-btn {
    border: none;
    background: #f7f7f8;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.15s ease, transform 0.1s ease;
    padding: 0;
}

.qm-btn:hover {
    background: #ececec;
    transform: translateY(-1px);
}

.qm-btn i {
    pointer-events: none;
}

/* автор вопроса */
.qm-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qm-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.qm-author-info {
    display: flex;
    flex-direction: column;
}

.qm-name {
    font-weight: 600;
    color: #222;
    text-decoration: none;
}

.qm-name:hover {
    text-decoration: underline;
}

.qm-time {
    font-size: 13px;
    color: #6a6f77;
}

/* блок под ответом */
.answer-meta-block {
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* чуть поменьше аватар у ответов */
.qm-avatar-sm {
    width: 36px;
    height: 36px;
}

/* ==============================
   COMMENT THREAD (QCM)
   ============================== */

.qcm-block {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid #e4e7eb;
}

/* кнопка Показать/Скрыть ветку */

.qcm-toggle {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 0 4px 0;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    text-decoration: none;
}

.qcm-toggle:hover {
    color: #343a40;
    text-decoration: underline;
}

/* контейнер с комментариями */

.qcm-list {
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.6);
}

/* один комментарий */

.qcm-item {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    border-bottom: 1px dashed #edf0f2;
    font-size: 13px;
    color: #111827;
}

.qcm-item:last-child {
    border-bottom: none;
}

/* аватар */

.qcm-avatar {
    margin-right: 8px;
    flex-shrink: 0;
}

.qcm-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* основной блок */

.qcm-main {
    flex: 1;
    min-width: 0;
}

.qcm-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1px;
}

.qcm-user {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
}

.qcm-username {
    font-weight: 600;
    font-size: 13px;
    color: #0d6efd;
    text-decoration: none;
}

.qcm-username:hover {
    text-decoration: underline;
}

.qcm-time {
    font-size: 11px;
    color: #9ca3af;
}

/* текст */

.qcm-text {
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.qcm-text p {
    display: inline;
    margin: 0;
}

/* действия */

.qcm-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.qcm-action-link {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 11px;
    color: #6c757d;
    cursor: pointer;
    text-decoration: none;
}

.qcm-action-link:hover {
    text-decoration: underline;
}

.qcm-action-danger {
    color: #d73a49;
}

/* пустые подписи и форма */

.qcm-empty {
    font-size: 12px;
    color: #9ca3af;
}

.qcm-form {
    margin-top: 6px;
}

.qcm-form textarea {
    resize: vertical;
    font-size: 13px;
    padding: 4px 8px;
}

/* кнопки в формах делаем маленькими */

.qcm-form .btn,
.qcm-edit-form .btn {
    font-size: 12px;
    padding: 3px 10px;
    line-height: 1.4;
    border-radius: 4px;
}

/* ссылка-отмена в редактировании, чтобы не была большой */

.qcm-edit-form .btn-link {
    padding: 0;
}

/* форма редактирования */

.qcm-edit-form {
    margin-top: 2px;
}

.qcm-edit-form textarea {
    resize: vertical;
    font-size: 13px;
    padding: 4px 8px;
}

/* ==============================
   QA MODERN FOOTER LAYOUT
============================== */

.qa-item {
  border: 1px solid #eef0f3;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.qa-body {
  font-size: 15px;
  line-height: 1.65;
}

.qa-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qa-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.qa-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qa-vote{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.qa-vote-btn {
  border: 0;
  background: transparent;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
  color: #111827;
}

.qa-vote-btn:hover {
  background: #e9edf2;
}

.qa-vote-btn.is-on {
  background: #dbeafe;
}

.qa-score {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #111827;
}

.qa-score.is-pos { color: #15803d; }
.qa-score.is-neg { color: #b91c1c; }

.qa-accept{
  margin-left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  background: #f3f4f6;
  color: #065f46;
  font-weight: 800;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
}

.qa-accept__icon{
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.qa-accept:hover { background: #e5e7eb; }
.qa-accept.is-on { background: #dcfce7; }

.qa-author-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qa-avatar-mini img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
}

.qa-author-text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
}

.qa-user {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}

.qa-user:hover { text-decoration: underline; }

.qa-more {
  border: 1px solid #eef0f3;
  background: #fff;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 22px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}

.qa-more:hover {
  background: #f6f7f9;
}

.qa-item.is-accepted {
  border-color: #bbf7d0;
  box-shadow: 0 0 0 3px rgba(34,197,94,.08);
}

.qa-badge {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 3px 10px;
  border-radius: 999px;
}

.qa-item.qa-answer.is-accepted {
  transition: box-shadow .2s ease, border-color .2s ease;
}

.qa-item.qa-answer.is-accepted {
  animation: qaPulse 450ms ease;
}

@keyframes qaPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.01); }
  100% { transform: scale(1); }
}

/* ==============================
   QA ACTION LINKS (вместо ⋯)
============================== */

.qa-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.qa-action-link{
  border:0;
  background:transparent;
  padding:0;
  font-size:13px;
  color:#6b7280;
  cursor:pointer;
  text-decoration:none;
  line-height:1;
}

.qa-action-link:hover{
  color:#111827;
  text-decoration:underline;
}

.qa-action-link.is-danger{
  color:#b91c1c;
}

.qa-action-link.is-danger:hover{
  color:#7f1d1d;
}

.qa-action-form{
  display:inline;
  margin:0;
}

.qa-copy-hint{
  font-size:12px;
  color:#9ca3af;
  margin-left:4px;
}

.qa-action-link.is-copied{
  color:#166534; /* зелёный */
}

.qa-action-link.is-error{
  color:#b91c1c; /* красный */
}

/* Контент из TinyMCE на странице просмотра */
.post-content {
  font-size: 15px;
  line-height: 1.75;
  color: #111827;
  word-break: break-word;
}

.post-content p { margin: 0 0 10px; }
.post-content p:last-child { margin-bottom: 0; }

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  margin: 14px 0 8px;
  line-height: 1.25;
  font-weight: 700;
}

.post-content ul, .post-content ol {
  margin: 8px 0 12px 22px;
  padding: 0;
}
.post-content li { margin: 4px 0; }

.post-content blockquote {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 8px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.post-content pre {
  padding: 12px 14px;
  background: #0b1020;
  color: #e5e7eb;
  border-radius: 12px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.55;
}
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}
.post-content p code, .post-content li code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 8px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 14px;
}
.post-content th, .post-content td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  vertical-align: top;
}
.post-content th {
  background: #f9fafb;
  font-weight: 700;
}

.qa-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin: 14px 0 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.qa-section-title{
  font-size: 14px;
  font-weight: 600;
  color: #111;
  line-height: 1.2;
}

/* Если внутри .u-avatar попадает любой <img> — растяни и обрежь */
.u-avatar img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

/* Иконки в голосовалке */
.qa-vote-btn{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}

/* сама svg */
.qa-vote-btn .qa-ico{
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
  opacity: .75;
}

/* hover */
.qa-vote-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}
.qa-vote-btn:hover .qa-ico{ opacity: 1; }

/* активное состояние (твой класс is-on уже есть) */
.qa-vote-btn.is-on{
  background: rgba(13,110,253,.10); /* мягкий акцент */
}
.qa-vote-btn.is-on .qa-ico{
  opacity: 1;
  fill: #0d6efd;
}

/* если хочешь разнести цвет вверх/вниз */
.qa-vote-btn.downvote.is-on{
  background: rgba(220,53,69,.10);
}
.qa-vote-btn.downvote.is-on .qa-ico{
  fill: #dc3545;
}

.qa-score{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width: 34px;
  height: 28px;
  padding: 0 10px;

  border-radius: 999px;
  background: #f6f7f9;
  border: 1px solid #eef0f3;

  font-weight: 600;
  line-height: 1;
}

.qa-score.is-pos{
  background: rgba(25,135,84,.10);
  border-color: rgba(25,135,84,.18);
  color: #198754;
}

.qa-score.is-neg{
  background: rgba(220,53,69,.10);
  border-color: rgba(220,53,69,.18);
  color: #dc3545;
}

.qa-vote-btn{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
}

.qa-vote-btn:hover{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.06);
}

.question-title{
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.question-highlight .tags{ margin-top: 3px; }

.post-content h2{
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 14px 0 8px;
  font-weight: 700;
}

.post-content ul, .post-content ol{
  padding-left: 1.2rem;
  margin: 10px 0;
}

.post-content li{
  margin: 4px 0;
}

/* Ограничение размера картинок в опубликованном контенте */
.answer-body img,
.question-post-body img,
.post-content img {
  width: auto !important;               /* убивает width:100% */
  max-width: min(100%, 420px) !important;
  height: auto !important;
  display: block;
  border-radius: 12px;
  margin: 10px 0;
}

/* Если TinyMCE вставляет figure */
.answer-body figure,
.question-post-body figure,
.post-content figure {
  max-width: min(100%, 420px) !important;
  margin: 10px 0;
}
.answer-body figure img,
.question-post-body figure img,
.post-content figure img {
  max-width: 100% !important;
  width: auto !important;
}


/* ==========================================================================
   AskUp: CODE STYLE = как в TinyMCE (светлый минимализм)
   ВСТАВИТЬ В САМЫЙ НИЗ question-extra.css
========================================================================== */

.post-content pre,
.post-content.answer-body pre,
.question-post-body pre,
.answer-body pre{
  margin: 8px 0 !important;
  padding: 10px 12px !important;

  background: #f8fafc !important;           /* как в Tiny */
  border: 1px solid #e5e7eb !important;     /* как в Tiny */
  color: #111827 !important;                /* нормальный текст */
  border-radius: 12px !important;

  overflow: auto !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45) !important;
  text-shadow: none !important;
  position: relative;
}

/* Важно: code внутри pre НЕ должен получать фон/паддинги inline-кода */
.post-content pre code,
.post-content.answer-body pre code,
.question-post-body pre code,
.answer-body pre code{
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;

  color: inherit !important;
  font-size: .93rem !important;
  line-height: 1.35 !important;

  display: block !important;
  white-space: pre !important;
  word-break: normal !important;
}

/* Inline code (в тексте), но только если НЕ внутри pre */
.post-content :not(pre) > code,
.post-content.answer-body :not(pre) > code,
.question-post-body :not(pre) > code,
.answer-body :not(pre) > code{
  background: #f3f4f6 !important;
  padding: .12em .3em !important;
  border-radius: 6px !important;
  color: #111827 !important;
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace !important;
}

/* Бейдж языка (если ты ставишь data-language) */
.post-content pre[data-language]::after,
.post-content.answer-body pre[data-language]::after,
.question-post-body pre[data-language]::after,
.answer-body pre[data-language]::after{
  content: attr(data-language);
  position: absolute;
  top: 6px; right: 8px;
  font-size: 11px; line-height: 1;
  color: #475569;
  background: #eef2ff;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 6px;
  pointer-events: none;
}

/* ============================================================================
   AskUp — Answer Collapse (smooth) + buttons + small UX helpers
   Вставь целиком в question-extra.css (или любой css, подключённый на detail)
============================================================================ */

/* --- базовый контейнер ответа (у тебя .answer-body) --- */
.answer-body.qa-collapsible{
  position: relative;
  overflow: hidden;
  max-height: none;                   /* в раскрытом состоянии */
  transition: max-height .28s ease;   /* плавность */
  will-change: max-height;
}

/* --- свернутое состояние --- */
.answer-body.qa-collapsible.qa-is-collapsed{
  /* max-height задаётся JS-ом (COLLAPSE_HEIGHT) */
}

/* --- градиент “обрыва” снизу, чтобы было красиво видно, что контент скрыт --- */
.answer-body.qa-collapsible.qa-is-collapsed::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height:110px;
  pointer-events:none;
  /* фон подстрой под свой (если у карточки другой — скажи, поменяем) */
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,.92) 55%,
    rgba(255,255,255,1)
  );
}

/* если у ответа фон не белый (например серый), можно перебить так:
.qa-item.qa-answer .answer-body.qa-collapsible.qa-is-collapsed::after{
  background: linear-gradient(to bottom, rgba(248,250,252,0), rgba(248,250,252,.95), rgba(248,250,252,1));
}
*/

/* --- блок с кнопкой под ответом --- */
.qa-collapse-actions{
  display:flex;
  justify-content:center;
  margin-top:10px;
}

/* --- кнопка "Показать полностью/Свернуть" --- */
.qa-collapse-btn{
  border: 1px solid rgba(229,231,235,.95);
  background: rgba(255,255,255,.92);
  color: #111827;
  font-size: 13px;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 6px 16px rgba(17,24,39,.06);
  user-select:none;
}

.qa-collapse-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17,24,39,.10);
  background: rgba(255,255,255,1);
}

.qa-collapse-btn:active{
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(17,24,39,.08);
}

.qa-collapse-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,.25), 0 6px 16px rgba(17,24,39,.10);
}

/* --- уважение к настройке "меньше анимаций" --- */
@media (prefers-reduced-motion: reduce){
  .answer-body.qa-collapsible{
    transition: none;
  }
  .qa-collapse-btn{
    transition: none;
  }
}

/* ============================================================================
   Доп. приятности (не обязательно, но обычно полезно)
============================================================================ */

/* флеш-подсветка ответа после inline-save (у тебя в JS: .qa-flash) */
.qa-item.qa-answer.qa-flash{
  animation: qaFlash .8s ease;
}
@keyframes qaFlash{
  0%   { box-shadow: 0 0 0 0 rgba(99,102,241,.0); }
  25%  { box-shadow: 0 0 0 4px rgba(99,102,241,.18); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,.0); }
}

/* состояния кнопки "Ссылка" (у тебя JS добавляет .is-copied / .is-error) */
.qa-action-link.is-copied{
  color:#059669;
}
.qa-action-link.is-error{
  color:#dc2626;
}

.breadcrumb .breadcrumb-item.active {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qa-admin-dropdown .dropdown-toggle.is-danger {
  color: #dc3545;               /* bootstrap danger */
  background: transparent;
  border: 0;
  padding: 0;
}

.qa-admin-dropdown .dropdown-toggle::after {
  margin-left: .35rem;
  vertical-align: middle;
}


/* Фолбэк: когда img НЕ внутри a/figure */
.post-content img:hover,
.answer-body img:hover,
.question-post-body img:hover{
  transform: scale(1.04);
}

.post-content img,
.answer-body img,
.question-post-body img{
  transition: transform .22s ease;
  will-change: transform;
  clip-path: inset(0 round 12px); /* удерживает скругление при scale */
}

/* --- Collapse long comments --- */
.qcm-text.qcm-collapsed{
  max-height: 160px;    /* “половина” — подстрой */
  overflow: hidden;
  position: relative;
}

.qcm-text.qcm-collapsed::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 44px;
  background: linear-gradient(to bottom, rgba(0,0,0,0), var(--qcm-bg));
  pointer-events: none;
}

.qcm-more{
  margin-top: 6px;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  color: var(--qcm-muted);
  cursor: pointer;
}
.qcm-more:hover{
  color: var(--qcm-text);
  text-decoration: underline;
}

/* бейдж "в ответ" */
.qcm-replyto{
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 2px 8px;
  border-radius: 999px;

  background: rgba(100,116,139,.10);
  border: 1px solid rgba(100,116,139,.18);

  font-size: 11px;
  line-height: 1.1;

  color: var(--qcm-muted) !important;
  text-decoration: none !important;
}

/* маленькая стрелка/маркер перед текстом */
.qcm-replyto::before{
  content: "↩";
  font-size: 12px;
  opacity: .85;
}

.qcm-replyto:hover{
  background: rgba(100,116,139,.14);
  border-color: rgba(100,116,139,.24);
  text-decoration: none !important;
}

/* Вернуть маркеры списков в опубликованном контенте */
.post-content ul{
  list-style: disc outside !important;
  padding-left: 1.2rem !important;
  margin: 10px 0 !important;
}

.post-content ol{
  list-style: decimal outside !important;
  padding-left: 1.2rem !important;
  margin: 10px 0 !important;
}

/* На случай, если тема ломает li */
.post-content li{
  display: list-item !important;
  margin: 4px 0 !important;
}
