/* Экран «Диалоги». Всё под .cqa-app. */

/* ---------- Шапка ---------- */
.cqa-app .cv-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.cqa-app .cv-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cqa-app .cv-crumbs__sep { color: var(--text-muted); }
.cqa-app .cv-demo-pill {
  margin-left: 4px;
  padding: 1px 7px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.cqa-app .cv-title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }

.cqa-app .cv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (min-width: 1260px) { .cqa-app .cv-actions { flex-wrap: nowrap; } }
/* Узкие экраны: второй ряд — модель + главная кнопка, справа */
@media (min-width: 641px) and (max-width: 1259px) {
  .cqa-app .cv-actions > * { order: 1; }
  .cqa-app .cv-actions::after { content: ""; flex-basis: 100%; order: 2; }
  .cqa-app .cv-actions .cv-provider, .cqa-app .cv-actions [data-slot="primary"] { order: 3; }
  .cqa-app .cv-actions [data-slot="primary"] { margin-left: 0; }
}
/* Средние экраны: JSON и Звонок — только иконки (подсказки остаются), чтобы ряд не переносился */
@media (min-width: 1181px) and (max-width: 1439px) {
  .cqa-app .cv-actions [data-upload-btn] span,
  .cqa-app .cv-actions [data-upload-audio-btn] span { display: none; }
  .cqa-app .cv-actions [data-upload-btn],
  .cqa-app .cv-actions [data-upload-audio-btn] { width: 40px; padding: 0; }
  .cqa-app .cv-actions .cv-provider .llm-prov { max-width: 190px; }
}
.cqa-app .cv-actions > * { flex: none; }
/* Модель и главная кнопка — справа, вместе */
.cqa-app .cv-actions .cv-provider { margin-left: auto; flex: 0 1 auto; min-width: 150px; }
.cqa-app .cv-actions .cv-provider .llm-prov { width: 100%; max-width: 220px; }
.cqa-app .cv-actions .cv-provider:empty + [data-slot="primary"] { margin-left: auto; }
.cqa-app .cv-actions [data-slot="primary"] .cqa-btn { box-shadow: 0 1px 2px rgba(16,24,40,.08), inset 0 1px 0 rgba(255,255,255,.18); }

.cqa-app .cv-import {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-ctl);
  transition: border-color 150ms ease;
}
.cqa-app .cv-import:focus-within { border-color: #CDD2D8; }
.cqa-app .cv-import label { font-size: 13px; color: var(--text-secondary); }
.cqa-app .cv-import input {
  width: 132px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--bg);
  font-weight: 600;
  font-size: 13px;
}
/* Поле растёт по содержимому — длинный group_id не обрезается */
@supports (field-sizing: content) {
  .cqa-app .cv-import input { width: auto; field-sizing: content; min-width: 96px; max-width: 260px; }
}
.cqa-app .cv-import input::placeholder { color: var(--text-muted); font-weight: 500; }
.cqa-app .cv-import__auto {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px 0 7px;
  border: 1px solid var(--border-control);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cqa-app .cv-import__auto:hover { border-color: #CDD2D8; color: var(--text-body); }
.cqa-app .cv-import__auto:has(input:checked) {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-700);
}
.cqa-app .cv-import .cv-import__auto input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  min-width: 0;
  margin: 0;
  padding: 0;
  field-sizing: fixed;
  border: 1.5px solid #C3C8CE;
  border-radius: 5px;
  background: var(--surface) no-repeat center / 12px 12px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.cqa-app .cv-import .cv-import__auto input:checked {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.cqa-app .cv-import .cv-import__auto input:active { transform: scale(.9); }
.cqa-app .cv-import .cv-import__auto input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cqa-app .cv-import .cqa-btn--text {
  height: 30px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
}
.cqa-app .cv-import .cqa-btn--text:hover:not(:disabled) { background: var(--brand-100); color: var(--brand-700); }

/* ---------- Сводка ---------- */
.cqa-app .cv-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  overflow: hidden;
}
.cqa-app .cv-cell {
  padding: 22px 24px;
  min-width: 0;
  box-shadow: -1px 0 0 var(--border-inner), 0 -1px 0 var(--border-inner);
}
.cqa-app .cv-cell--wide { grid-column: span 2; }
.cqa-app .cv-cell__head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-secondary); }
.cqa-app .cv-cell__head .num { color: var(--text-secondary); }
.cqa-app .cv-big { margin-top: 12px; font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.cqa-app .cv-big small { margin-left: 4px; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--text-muted); }
.cqa-app .cv-num { margin-top: 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.cqa-app .cv-caption { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-body); }

/* «Грубые ошибки» в сводке — кнопка, включающая фильтр списка */
.cqa-app .cv-cell--action {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  width: 100%; margin: 0; border: 0; border-radius: 0;
  background: transparent; color: inherit; font: inherit; text-align: left;
  cursor: pointer; transition: background-color 150ms ease;
}
.cqa-app .cv-cell--action:hover { background: var(--surface-2); }
.cqa-app .cv-cell--action:focus-visible { outline-offset: -2px; }
.cqa-app .cv-cell--action[aria-pressed="true"] { background: var(--gross-bg); }
.cqa-app .cv-cell__go {
  flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted);
  opacity: 0; transition: opacity 150ms ease, color 150ms ease;
}
.cqa-app .cv-cell__go .cqa-icon { width: 13px; height: 13px; }
.cqa-app .cv-cell--action:hover .cv-cell__go,
.cqa-app .cv-cell--action:focus-visible .cv-cell__go { opacity: 1; color: var(--text-secondary); }
.cqa-app .cv-cell--action[aria-pressed="true"] .cv-cell__go { opacity: 1; color: var(--gross-text); }

.cqa-app .cv-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; }

.cqa-app .cv-segbar { display: flex; gap: 3px; height: 8px; margin-top: 20px; }
.cqa-app .cv-segbar span { border-radius: 4px; min-width: 6px; transition: flex-grow 200ms ease; }
.cqa-app .cv-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12px; color: var(--text-body); }
.cqa-app .cv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cqa-app .cv-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.cqa-app .cv-legend b { font-weight: 600; color: var(--text); }

/* ---------- Карточка таблицы ---------- */
.cqa-app .cv-table-card { overflow: hidden; overflow: clip; position: relative; }

.cqa-app .cv-tabs {
  display: flex;
  gap: 24px;
  padding: 4px 20px 0;
  border-bottom: 1px solid var(--border-inner);
  overflow-x: auto;
  scrollbar-width: none;
}
.cqa-app .cv-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.cqa-app .cv-tab:hover { color: var(--text); }
.cqa-app .cv-tab[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--brand-500); }
.cqa-app .cv-tab__count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cqa-app .cv-tab[aria-selected="true"] .cv-tab__count { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

/* Фильтры */
.cqa-app .cv-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; }
.cqa-app .cv-search { position: relative; width: 274px; max-width: 100%; }
.cqa-app .cv-search .cqa-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.cqa-app .cv-input,
.cqa-app .cv-select {
  height: 36px;
  border: 1px solid var(--border-control);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.cqa-app .cv-input { width: 100%; padding: 0 12px 0 34px; }
.cqa-app .cv-input::placeholder { color: var(--text-muted); }
.cqa-app .cv-input:hover, .cqa-app .cv-select:hover { border-color: #D5D9DF; }
.cqa-app .cv-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 30px 0 12px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.cqa-app .cv-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-control);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cqa-app .cv-chip:hover { border-color: #D5D9DF; }
.cqa-app .cv-chip[aria-pressed="true"] { background: var(--chip-bad-bg); border-color: var(--chip-bad-border); color: var(--chip-bad-text); }
.cqa-app .cv-filters__count { margin-left: auto; font-size: 13px; color: var(--text-secondary); }

/* Таблица */
.cqa-app .cv-scroll { overflow-x: auto; }
.cqa-app .cv-table { width: 100%; min-width: 1000px; border-collapse: collapse; table-layout: fixed; }
.cqa-app .cv-table th {
  height: 36px;
  padding: 0 12px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-inner);
  border-bottom: 1px solid var(--border-inner);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}
.cqa-app .cv-table td { height: 64px; padding: 0 12px; border-bottom: 1px solid var(--border-row); vertical-align: middle; }
.cqa-app .cv-table tbody tr:last-child td { border-bottom: 0; }
.cqa-app .cv-col-check { width: 52px; padding-left: 20px !important; padding-right: 0 !important; }
.cqa-app .cv-col-lang { width: 110px; }
.cqa-app .cv-col-score { width: 220px; }
.cqa-app .cv-col-status { width: 170px; }
.cqa-app .cv-col-time { width: 140px; }
.cqa-app .cv-col-chev { width: 44px; }

.cqa-app .cv-row { cursor: pointer; transition: background-color 150ms ease; }
.cqa-app .cv-row:hover { background: var(--surface-2); }
.cqa-app .cv-row.is-selected { background: var(--row-selected); }

/* Чекбокс */
.cqa-app .cv-check {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid #C3C8CE;
  border-radius: 4px;
  background: var(--surface) center / 12px no-repeat;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.cqa-app .cv-check:hover { border-color: #9AA1A9; }
.cqa-app .cv-check:checked {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.cqa-app .cv-check:indeterminate {
  background-color: var(--brand-500);
  border-color: var(--brand-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}

/* Ячейка «Диалог» */
.cqa-app .cv-dlg { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cqa-app .cv-dlg__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-body);
}
.cqa-app .cv-dlg__icon .cqa-icon { width: 16px; height: 16px; }
.cqa-app .cv-dlg__text { min-width: 0; }
.cqa-app .cv-dlg__line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cqa-app .cv-dlg__id {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 4px;
}
.cqa-app .cv-dlg__id:hover { text-decoration: underline; text-underline-offset: 3px; }
.cqa-app .cv-gross { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--gross-text); white-space: nowrap; }
.cqa-app .cv-gross .cqa-icon { width: 13px; height: 13px; }
.cqa-app .cv-dlg__meta { margin-top: 2px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Причина грубой ошибки под мета-строкой: иконка, текст ИИ, цитата «#9 «…»» — ссылка на реплику */
.cqa-app .cv-row--why td { padding-top: 10px; padding-bottom: 10px; }
.cqa-app .cv-row--why .cv-dlg { align-items: flex-start; }
.cqa-app .cv-dlg__text { flex: 1; }
.cqa-app .cv-why {
  display: flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 640px; margin-top: 4px;
  font-size: 13px; line-height: 18px; color: var(--text-body);
}
.cqa-app .cv-why__icon { flex: none; align-self: flex-start; display: inline-flex; padding-top: 2px; color: var(--gross-text); }
.cqa-app .cv-why__icon .cqa-icon { width: 13px; height: 13px; }
.cqa-app .cv-why__reason { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cqa-app .cv-why__quote {
  flex: 0 4 auto; min-width: 80px; max-width: 38%;  /* сжимается быстрее причины — причина важнее */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-style: italic; color: var(--text-secondary); text-decoration: none; border-radius: 4px;
}
.cqa-app a.cv-why__quote:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-control); text-underline-offset: 3px; }
.cqa-app .cv-why__quote q { quotes: "«" "»"; }
.cqa-app .cv-why__idx { margin-right: 4px; font-style: normal; font-weight: 500; color: var(--text-secondary); }
/* Режим фильтра «Грубые ошибки»: причина до 2 строк, цитата — отдельной строкой */
.cqa-app .cv-why--full { flex-wrap: wrap; row-gap: 2px; }
.cqa-app .cv-why--full .cv-why__reason {
  flex: 1 1 0; white-space: normal;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.cqa-app .cv-why--full .cv-why__quote { flex-basis: 100%; max-width: calc(100% - 19px); margin-left: 19px; }

.cqa-app .cv-lang { font-size: 13px; color: var(--text-body); }

/* Итог */
.cqa-app .cv-score { display: flex; align-items: center; gap: 14px; }
.cqa-app .cv-score__val { width: 50px; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.cqa-app .cv-score__bar { position: relative; width: 96px; height: 4px; border-radius: 2px; background: var(--border-inner); overflow: hidden; }
.cqa-app .cv-score__bar span { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }
.cqa-app .cv-running { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--info); }
.cqa-app .cv-running .cqa-icon { width: 15px; height: 15px; }
.cqa-app .cv-row .cqa-btn--outline .cqa-icon { width: 14px; height: 14px; }

/* Статус */
.cqa-app .cv-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-status); white-space: nowrap; }
.cqa-app .cv-status .cv-dot { width: 7px; height: 7px; }
.cqa-app .cv-time { font-size: 13px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }

.cqa-app .cv-chev { display: flex; justify-content: center; color: #C3C8CE; transition: color 150ms ease, transform 150ms ease; }
.cqa-app .cv-chev .cqa-icon { width: 16px; height: 16px; }
.cqa-app .cv-row:hover .cv-chev { color: var(--text-body); transform: translateX(2px); }

/* Скелетоны */
.cqa-app .cv-skel {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #EEF0F3 0%, #F6F7F9 50%, #EEF0F3 100%);
  background-size: 200% 100%;
  animation: cv-shimmer 1.2s ease-in-out infinite;
}
@keyframes cv-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Пусто / ошибка */
.cqa-app .cv-empty { padding: 56px 20px; text-align: center; }
.cqa-app .cv-empty__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--text-muted);
}
.cqa-app .cv-empty__icon .cqa-icon { width: 20px; height: 20px; }
.cqa-app .cv-empty__title { font-size: 15px; font-weight: 600; color: var(--text); }
.cqa-app .cv-empty__text { margin: 4px 0 16px; font-size: 13px; color: var(--text-secondary); }
.cqa-app .cv-empty--error .cv-empty__icon { background: var(--chip-bad-bg); color: var(--bad); }

/* Панель выбора */
.cqa-app .cv-selbar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 16px 16px;
  padding: 10px 10px 10px 18px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow-bar);
  animation: cqa-toast-in 150ms ease;
  z-index: 3;
}
.cqa-app .cv-selbar[hidden] { display: none; }
.cqa-app .cv-selbar__count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cqa-app .cv-selbar__spacer { flex: 1; }
.cqa-app .cv-selbar .cqa-btn--text { color: #D1D5DB; font-weight: 500; }
.cqa-app .cv-selbar .cqa-btn--text:hover { color: #fff; }
.cqa-app .cv-selbar .cqa-btn { height: 36px; }
.cqa-app .cv-selbar :focus-visible { outline-color: var(--neon); }

/* Ссылки в тосте «Файл загружен» (тост тёмный — ссылки светлые) */
.cqa-app .cv-toast-links { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-left: 12px; color: #D1D5DB; }
.cqa-app .cv-toast-links a { color: var(--neon); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 3px; }
.cqa-app .cv-toast-links a:hover { color: #fff; }
.cqa-app .cv-toast-links a:focus-visible { outline-color: var(--neon); }

/* ---------- Адаптив ---------- */
/* Ноутбук ~1024px: сводка — «Средний балл» во всю ширину, под ним три плитки в ряд;
   таблица без горизонтального скролла — колонка «Оценён» скрыта, «Итог», «Язык» и «Статус» уже. */
@media (max-width: 1180px) {
  .cqa-app .cv-actions { flex-wrap: wrap; justify-content: flex-start; }
  .cqa-app .cv-import input { min-width: 64px; }
  .cqa-app .cv-actions > .cqa-btn, .cqa-app .cv-actions .cv-export > .cqa-btn,
  .cqa-app .cv-actions [data-slot="primary"] .cqa-btn { padding: 0 12px; }
  .cqa-app .cv-search { width: 168px; }
  .cqa-app .cv-filters { gap: 6px; }
  .cqa-app .cv-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cqa-app .cv-cell--wide { grid-column: 1 / -1; }
  .cqa-app .cv-table { min-width: 720px; }
  .cqa-app .cv-table .cv-col-time { display: none; }
  .cqa-app .cv-col-lang { width: 96px; }
  .cqa-app .cv-col-score { width: 168px; }
  .cqa-app .cv-col-status { width: 150px; }
  .cqa-app .cv-score { gap: 10px; }
  .cqa-app .cv-score__bar { width: 64px; }
}
@media (max-width: 900px) {
  .cqa-app .cv-cell--wide { grid-column: 1 / -1; }
  .cqa-app .cv-search { width: 100%; }
  .cqa-app .cv-filters__count { margin-left: 0; }
}

/* Оценка сделана по прошлой версии чек-листа (evaluation_outdated) — ненавязчивая пометка рядом со статусом */
.cqa-app .cv-outdated {
  margin-left: 2px; padding: 1px 6px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; line-height: 16px; white-space: nowrap;
  color: var(--mid); background: color-mix(in srgb, var(--mid) 12%, transparent);
  cursor: help;
}

/* ---------- Экспорт результатов (меню в шапке) ---------- */
.cqa-app .cv-export { position: relative; }
.cqa-app .cv-export__chev { color: var(--text-muted); margin-left: -2px; }
.cqa-app .cv-export [aria-busy="true"] { cursor: progress; opacity: .7; }
.cqa-app .cv-export__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 280px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: cv-pop-in 150ms ease;
}
.cqa-app .cv-export__menu[hidden] { display: none; }
@keyframes cv-pop-in { from { opacity: 0; transform: translateY(-4px); } }
.cqa-app .cv-export__head { padding: 8px 10px 0; font-size: 13px; font-weight: 600; color: var(--text); }
.cqa-app .cv-export__sub { padding: 2px 10px 8px; font-size: 12px; color: var(--text-secondary); }
.cqa-app .cv-export__items { padding-top: 4px; border-top: 1px solid var(--border-inner); }
.cqa-app .cv-export__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.cqa-app .cv-export__item .cqa-icon { flex: none; color: var(--text-secondary); }
.cqa-app .cv-export__item:hover:not(:disabled),
.cqa-app .cv-export__item:focus-visible { background: var(--surface-2); }
.cqa-app .cv-export__item:focus-visible { outline-offset: -2px; }
.cqa-app .cv-export__item:disabled { color: var(--text-muted); cursor: not-allowed; }
.cqa-app .cv-export__label { display: flex; flex-direction: column; font-size: 14px; font-weight: 500; line-height: 1.3; }
.cqa-app .cv-export__label small { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.cqa-app .cv-selbar__export { gap: 6px; }
@media (max-width: 600px) {
  .cqa-app .cv-export__menu { right: auto; left: 0; width: min(280px, calc(100vw - 32px)); }
}
@media (max-width: 640px) {
  .cqa-app .cv-summary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* ---------- Выбор модели для оценки (OpenAI / Ollama) — шапка «Диалоги» и карточка диалога ---------- */
.cqa-app .cv-provider:empty { display: none; }
.cqa-app .llm-prov {
  height: 40px;
  max-width: 260px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-ctl);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 150ms ease;
}
.cqa-app .llm-prov:hover:not(:disabled) { border-color: #D5D9DF; }
.cqa-app .llm-prov:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cqa-app .llm-prov:disabled { opacity: 0.6; cursor: default; }
.cqa-app .llm-prov--sm { height: 30px; font-size: 12.5px; border-radius: var(--radius-sm); max-width: 220px; }
@media (max-width: 640px) {
  .cqa-app .llm-prov { max-width: 100%; }
}

/* Очередь «Сначала проблемные» и пометка «ИИ просит проверить» (P3 · 12) */
.cqa-app .cv-select--sort { font-weight: 600; }
.cqa-app .cv-review {
  display: flex; width: fit-content; align-items: center; gap: 4px; margin-top: 4px;
  color: var(--amber-text); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.cqa-app .cv-review .cqa-icon { color: var(--amber-dot); }

/* Пагинация таблицы (только фронт): «1–25 из 65» · ‹ 1 2 3 › · 25 на странице */
.cqa-app .cv-pager {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border-inner);
  font-size: 13px; color: var(--text-secondary);
}
.cqa-app .cv-pager[hidden] { display: none; }
.cqa-app .cv-pager__range { margin-right: auto; color: var(--text-secondary); }
.cqa-app .cv-pager__pages { display: flex; align-items: center; gap: 4px; }
.cqa-app .cv-pager__btn {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--text-body); cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cqa-app .cv-pager__btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.cqa-app .cv-pager__btn--icon { border-color: var(--border-control); padding: 0; }
.cqa-app .cv-pager__btn:disabled { color: var(--text-muted); cursor: default; opacity: .6; }
.cqa-app .cv-pager__btn[aria-current="page"] {
  background: var(--surface); border-color: var(--border-control); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.cqa-app .cv-pager__btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cqa-app .cv-pager__gap { min-width: 20px; text-align: center; color: var(--text-muted); }
.cqa-app .cv-pager__size { display: inline-flex; align-items: center; gap: 8px; }
.cqa-app .cv-select--sm { height: 32px; font-size: 13px; padding: 0 28px 0 10px; border-radius: var(--radius-sm); }
@media (max-width: 640px) {
  .cqa-app .cv-pager { padding: 12px 16px; gap: 12px; }
  .cqa-app .cv-pager__range { width: 100%; }
}

/* ================= Мобильная версия (≤ 640px) =================
   Шапка: заголовок, главная кнопка + «⋯» (импорт, файл, экспорт, модель — раскрываются);
   сводка 2×2; вкладки свайпом; фильтры за кнопкой «Фильтры»; таблица → список карточек. */
.cqa-app .cv-more-toggle,
.cqa-app .cv-filters-toggle,
.cqa-app .cv-pager__compact { display: none; }

@media (max-width: 640px) {
  .cqa-app .cv-header { gap: 12px; }
  .cqa-app .cv-crumbs { display: none; }
  .cqa-app .cv-title { font-size: 26px; }

  .cqa-app .cv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .cqa-app .cv-actions > * { order: 3; }
  .cqa-app .cv-actions [data-slot="primary"] { order: 1; flex: 1 1 0; min-width: 0; margin-left: 0; display: flex; }
  .cqa-app .cv-actions [data-slot="primary"]:empty { display: none; }
  .cqa-app .cv-actions [data-slot="primary"] .cqa-btn { width: 100%; height: 44px; padding: 0 12px; }
  .cqa-app .cv-actions [data-slot="primary"] .cqa-btn span { overflow: hidden; text-overflow: ellipsis; }
  .cqa-app .cv-more-toggle { display: inline-flex; order: 2; width: 44px; height: 44px; padding: 0; flex: none; }
  .cqa-app .cv-header:not(.is-more-open) .cv-actions > :not([data-slot="primary"]):not(.cv-more-toggle) { display: none; }
  .cqa-app .cv-header.is-more-open .cv-more-toggle { background: var(--surface-muted); }
  .cqa-app .cv-header.is-more-open .cv-actions > :not([data-slot="primary"]):not(.cv-more-toggle):not([hidden]) { flex: 1 1 100%; }
  .cqa-app .cv-actions > input[hidden] { display: none !important; }
  .cqa-app .cv-import { height: 48px; padding-left: 14px; }
  .cqa-app .cv-import input { flex: 1 1 auto; min-width: 0; width: 60px; height: 34px; font-size: 15px; }
  @supports (field-sizing: content) { .cqa-app .cv-import input { max-width: none; } }
  .cqa-app .cv-import .cqa-btn--text { height: 40px; }
  .cqa-app .cv-header.is-more-open .cv-actions > .cqa-btn:not(.cv-more-toggle),
  .cqa-app .cv-header.is-more-open .cv-export { flex: 1 1 calc(50% - 4px) !important; }
  .cqa-app .cv-export > .cqa-btn { width: 100%; }
  .cqa-app .cv-actions .cqa-btn { height: 44px; }
  .cqa-app .cv-export__menu { left: auto; right: 0; width: min(300px, calc(100vw - 32px)); }
  .cqa-app .cv-export__item { min-height: 48px; }
  .cqa-app .cv-provider .llm-prov { width: 100%; max-width: none; height: 44px; font-size: 14px; }
  .cqa-app .cv-actions .cv-provider { margin-left: 0; }
  .cqa-app .cv-import__auto { height: 36px; }

  /* Сводка 2×2 */
  .cqa-app .cv-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cqa-app .cv-cell { padding: 14px 16px; }
  .cqa-app .cv-cell--wide { grid-column: auto; }
  .cqa-app .cv-cell__head { font-size: 12.5px; }
  .cqa-app .cv-cell__head .num, .cqa-app .cv-cell__go, .cqa-app .cv-legend, .cqa-app .cv-caption { display: none; }
  .cqa-app .cv-big, .cqa-app .cv-num { margin-top: 6px; font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; }
  .cqa-app .cv-big small { font-size: 13px; margin-left: 2px; }
  .cqa-app .cv-segbar { height: 4px; margin-top: 10px; gap: 2px; }
  .cqa-app .cv-cell--action[aria-pressed="true"] .cv-num { color: var(--gross-text); }

  /* Вкладки — свайп */
  .cqa-app .cv-tabs { gap: 4px; padding: 0 8px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .cqa-app .cv-tabs::-webkit-scrollbar { display: none; }
  .cqa-app .cv-tab { min-height: 48px; padding: 12px 10px 10px; scroll-snap-align: start; }

  /* Фильтры: поиск + «Фильтры», остальное раскрывается */
  .cqa-app .cv-filters { padding: 12px 16px; gap: 8px; }
  .cqa-app .cv-search { flex: 1 1 calc(100% - 140px); width: auto; min-width: 0; }
  .cqa-app .cv-input, .cqa-app .cv-select, .cqa-app .cv-chip { height: 44px; font-size: 15px; }
  .cqa-app .cv-filters-toggle { display: inline-flex; flex: none; height: 44px; padding: 0 14px; font-weight: 500; }
  .cqa-app .cv-filters.is-open .cv-filters-toggle { background: var(--surface-muted); }
  .cqa-app .cv-filters-toggle__count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--brand-500); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
  }
  .cqa-app .cv-filters-toggle__count[hidden] { display: none; }
  .cqa-app .cv-filters:not(.is-open) > .cv-select,
  .cqa-app .cv-filters:not(.is-open) > .cv-chip,
  .cqa-app .cv-filters:not(.is-open) > .cv-filters__count { display: none; }
  .cqa-app .cv-filters.is-open > .cv-select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .cqa-app .cv-filters > .cv-select--sort { flex-basis: 100% !important; }
  .cqa-app .cv-filters > .cv-chip { flex: 1 1 auto; justify-content: center; }
  .cqa-app .cv-drill:empty { display: none; }
  .cqa-app .cv-drill { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }

  /* Таблица → карточки */
  .cqa-app .cv-scroll { overflow: visible; }
  .cqa-app .cv-table, .cqa-app .cv-table tbody { display: block; width: 100%; min-width: 0; }
  .cqa-app .cv-table colgroup, .cqa-app .cv-table thead { display: none; }
  .cqa-app .cv-table tr.cv-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "dlg score" "st lang";
    align-items: center;
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-row);
  }
  .cqa-app .cv-table tbody tr:last-child { border-bottom: 0; }
  .cqa-app .cv-table td { display: block; height: auto; padding: 0 !important; border: 0; }
  .cqa-app .cv-table tr.cv-row > td:nth-child(1),
  .cqa-app .cv-table tr.cv-row > td:nth-child(6),
  .cqa-app .cv-table tr.cv-row > td:nth-child(7) { display: none; }
  .cqa-app .cv-table tr.cv-row > td:nth-child(2) { grid-area: dlg; min-width: 0; }
  .cqa-app .cv-table tr.cv-row > td:nth-child(3) { grid-area: lang; justify-self: end; }
  .cqa-app .cv-table tr.cv-row > td:nth-child(4) { grid-area: score; justify-self: end; }
  .cqa-app .cv-table tr.cv-row > td:nth-child(5) { grid-area: st; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .cqa-app .cv-row:hover { background: transparent; }
  .cqa-app .cv-row:active { background: var(--surface-2); }
  .cqa-app .cv-dlg { gap: 10px; }
  .cqa-app .cv-dlg__icon { width: 30px; height: 30px; border-radius: 9px; }
  .cqa-app .cv-dlg__icon .cqa-icon { width: 15px; height: 15px; }
  .cqa-app .cv-dlg__id { font-size: 15.5px; }
  .cqa-app .cv-dlg__line { flex-wrap: wrap; row-gap: 0; }
  .cqa-app .cv-dlg__meta, .cqa-app .cv-why { display: none; }
  .cqa-app .cv-row--why .cv-dlg { align-items: center; }
  .cqa-app .cv-gross { font-size: 12.5px; }
  .cqa-app .cv-score { flex-direction: column; align-items: flex-end; gap: 6px; }
  .cqa-app .cv-score__val { width: auto; font-size: 17px; line-height: 1; }
  .cqa-app .cv-score__bar { width: 56px; }
  .cqa-app .cv-row .cqa-btn--sm { min-height: 40px; padding: 0 14px; }
  .cqa-app .cv-status { padding-left: 40px; font-size: 13px; }
  .cqa-app .cv-review { display: none; }
  .cqa-app .cv-lang { font-size: 12.5px; color: var(--text-secondary); }
  .cqa-app .cv-table td[colspan] { display: block; }
  .cqa-app .cv-table tbody tr:not(.cv-row) { display: block; }

  /* Пагинация: ‹ 2 / 3 › */
  .cqa-app .cv-pager { justify-content: center; padding: 10px 16px; }
  .cqa-app .cv-pager__range, .cqa-app .cv-pager__size,
  .cqa-app .cv-pager__pages > .cv-pager__btn:not(.cv-pager__btn--icon),
  .cqa-app .cv-pager__gap { display: none; }
  .cqa-app .cv-pager__compact { display: inline-block; min-width: 72px; text-align: center; font-size: 14px; font-weight: 600; color: var(--text); }
  .cqa-app .cv-pager__btn--icon { width: 44px; height: 44px; }

  .cqa-app .cv-selbar { display: none; }
}
