@import url('/vendor/fonts/inter.css');

/* client/trendly/trends.css
   Light cream/beige + orange theme. Trends UI scoped under .trends-shell.
   The standalone /trendly page (+ report.html / how-to-analyze.html) load ONLY
   this stylesheet, so it also carries the page font (Inter) — they don't pull
   admin.css / components.css. */

/* Page font for the standalone Trendly pages — matches the product's Inter. */
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif; }

.trends-shell {
  --cream: #FBF7F0;
  --surface: #FFFFFF;
  --line: #ECE4D6;
  --text: #1C1B18;
  --muted: #8A8170;
  --accent: #FF6A1A;

  /* virality tier colors (viralityTier keys) */
  --tier-fire: #E8431C;   /* fire >=1  red-orange */
  --tier-high: #FF6A1A;   /* high >=0.3 orange   */
  --tier-mid:  #F0A500;   /* mid  >=0.1 amber    */
  --tier-low:  #B7AE9C;   /* low  <0.1  gray     */

  background: var(--cream);
  color: var(--text);
  border-radius: 14px;
  padding: 20px;
  margin-top: 4px;
}

.trends-shell * { box-sizing: border-box; }

.trends-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
}
.trends-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 700;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.trends-tab:hover { color: var(--text); }
.trends-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.trends-body { min-height: 200px; }

.trends-empty {
  padding: 60px; text-align: center; color: var(--muted); font-size: 14px;
}

/* virality badge tiers (used from Phase 2/3 onward) */
.trends-shell .virality-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.trends-shell .virality-badge--fire { background: var(--tier-fire); }
.trends-shell .virality-badge--high { background: var(--tier-high); }
.trends-shell .virality-badge--mid  { background: var(--tier-mid); }
.trends-shell .virality-badge--low  { background: var(--tier-low); }

.trends-insights-placeholder {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 56px 32px; text-align: center; max-width: 560px;
  margin: 24px auto;
}
.trends-insights-placeholder__icon { font-size: 40px; margin-bottom: 12px; }
.trends-insights-placeholder h2 {
  margin: 0 0 10px; font-size: 22px; font-weight: 800; color: var(--text);
}
.trends-insights-placeholder p {
  margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6;
}

/* ===== P1c: Jobs view ===== */
.trends-shell .trends-jobs { display: flex; flex-direction: column; gap: 18px; }

.trends-shell .tj-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px;
}
.trends-shell .tj-form__title { font-weight: 700; color: var(--text); margin-bottom: 12px; }
.trends-shell .tj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px;
}
.trends-shell .tj-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.trends-shell .tj-field--wide { grid-column: 1 / -1; }
.trends-shell .tj-field--check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.trends-shell .tj-field input,
.trends-shell .tj-field select,
.trends-shell .tj-field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font: inherit; color: var(--text); background: var(--cream);
}
.trends-shell .tj-field input:focus,
.trends-shell .tj-field select:focus,
.trends-shell .tj-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.trends-shell .tj-form__actions { margin-top: 14px; }

.trends-shell .tj-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 9px 16px; font: inherit; cursor: pointer;
}
.trends-shell .tj-btn:hover { background: var(--cream); }
.trends-shell .tj-btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.trends-shell .tj-btn--accent:disabled { opacity: .5; cursor: not-allowed; }
.trends-shell .tj-btn--sm { padding: 5px 11px; font-size: 12px; }
.trends-shell .tj-btn--danger { color: #9B2030; }

/* Карточки заданий — сетка, а не колонка: карточка держит два смысловых блока
   (метрика + запрос) и в одну колонку на всю ширину читается пустой. */
.trends-shell .tj-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 14px;
}
.trends-shell .tj-list > .tj-err,
.trends-shell .tj-list > .tj-empty { grid-column: 1 / -1; }
@media (max-width: 560px) { .trends-shell .tj-list { grid-template-columns: 1fr; } }

.trends-shell .tj-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px 14px 19px;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.trends-shell .tj-card:hover {
  border-color: #DCD2C0; box-shadow: 0 6px 20px rgba(28,27,24,.09); transform: translateY(-1px);
}
/* Цветная полоса статуса слева — статус читается до чтения текста. */
.trends-shell .tj-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #D8D0C0;
}
.trends-shell .tj-card[data-status="running"]::before   { background: var(--accent); }
.trends-shell .tj-card[data-status="done"]::before      { background: #2E7D32; }
.trends-shell .tj-card[data-status="partial"]::before   { background: #F0A500; }
.trends-shell .tj-card[data-status="failed"]::before    { background: #9B2030; }
.trends-shell .tj-card[data-status="cancelled"]::before { background: #C8C0B0; }

.trends-shell .tj-card__head { display: flex; align-items: center; gap: 10px; }
.trends-shell .tj-card__ident { flex: 1 1 auto; min-width: 0; }
.trends-shell .tj-card__name {
  font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trends-shell .tj-card__id { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Ключевой блок: слева крупная метрика, справа сам запрос. */
.trends-shell .tj-card__key {
  display: flex; align-items: stretch; gap: 14px; margin-top: 12px;
  background: var(--cream); border-radius: 10px; padding: 10px 12px;
}
.trends-shell .tj-metric {
  flex: 0 0 auto; min-width: 74px; text-align: center;
  border-right: 1px solid var(--line); padding-right: 12px;
  display: flex; flex-direction: column; justify-content: center;
}
.trends-shell .tj-metric__v {
  font-size: 26px; font-weight: 800; line-height: 1.05; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.trends-shell .tj-metric__l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.trends-shell .tj-card__q { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.trends-shell .tj-query {
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trends-shell .tj-query--empty { color: var(--muted); font-weight: 400; }
.trends-shell .tj-query--chips { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; }
.trends-shell .tj-chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: 12px; font-weight: 500; color: var(--text);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trends-shell .tj-chip--more { color: var(--muted); }
.trends-shell .tj-card__qmeta {
  display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted);
}
.trends-shell .tj-seg { color: var(--accent); }

.trends-shell .tj-card__actions { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.trends-shell .tj-card__spacer { flex: 1 1 auto; }
.trends-shell .tj-btn--go { font-weight: 600; }
.trends-shell .tj-btn--go:not(:disabled):hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.trends-shell .tj-btn:disabled { opacity: .45; cursor: not-allowed; }
.trends-shell .tj-icobtn {
  border: 1px solid transparent; background: none; color: var(--muted);
  border-radius: 8px; width: 28px; height: 28px; font: inherit; font-size: 13px;
  cursor: pointer; line-height: 1;
}
.trends-shell .tj-icobtn:hover { background: var(--cream); border-color: var(--line); color: var(--text); }
.trends-shell .tj-icobtn--danger:hover { color: #9B2030; }

.trends-shell .tj-card__meta { font-size: 11px; color: var(--muted); margin-top: 8px; word-break: break-word; line-height: 1.5; }
.trends-shell .tj-card__params { margin-top: 10px; }

/* Расписание задания и история прогонов. Строка расписания — акцентная: это
   единственное на карточке, что тратит деньги само, без нажатия. */
.trends-shell .tj-icobtn--on { background: var(--cream); border-color: var(--line); }
.trends-shell .tj-card__sched { color: var(--text); font-weight: 500; }
.trends-shell .tj-card__sched--off { color: var(--muted); font-weight: 400; }
.trends-shell .tj-runs { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.trends-shell .tj-run {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  font-size: 11px; color: var(--muted); padding: 3px 0;
}
.trends-shell .tj-run + .tj-run { border-top: 1px dashed var(--line); }
.trends-shell .tj-run__when { min-width: 104px; color: var(--text); }
.trends-shell .tj-run__cost { margin-left: auto; }
.trends-shell .tj-run__err { flex-basis: 100%; color: #9B2030; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trends-shell .tj-stats { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.trends-shell .tj-stats span { background: var(--cream); border-radius: 6px; padding: 3px 8px; }
.trends-shell .tj-stats .tj-stats__warn { background: #FFF3CD; color: #946A00; }
/* Цена прогона: тот же чип, но подсвечен — это единственное число в блоке,
   которое стоит денег. */
.trends-shell .tj-stats .tj-stats__cost { background: #EDF3EA; color: #3B6B3E; font-weight: 600; }
.trends-shell .tj-field--off > span { opacity: .55; }
.trends-shell .tj-field input:disabled,
.trends-shell .tj-field select:disabled { opacity: .55; cursor: not-allowed; background: var(--cream); }
.trends-shell .tj-field .tj-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.trends-shell .tj-field .tj-hint--warn { color: var(--warn, #b26a00); }

/* Логотипы соцсетей (platform-icon.js) */
.trends-shell .tr-plat-icon { display: block; flex: 0 0 auto; }
.trends-shell .tr-plat-icon--unknown {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--line); color: var(--muted); font-size: 11px;
}
.trends-shell .tr-plat-badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--cream); border: 1px solid var(--line);
}

.trends-shell .tj-badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; }
.trends-shell .tj-badge--queued    { background: #EFEAE0; color: #6B6453; }
.trends-shell .tj-badge--running   { background: #FFE6D2; color: #B5470F; }
.trends-shell .tj-badge--done      { background: #DDF0DC; color: #2E7D32; }
.trends-shell .tj-badge--partial   { background: #FFF3CD; color: #946A00; }
.trends-shell .tj-badge--failed    { background: #FBE0E0; color: #9B2030; }
.trends-shell .tj-badge--cancelled { background: #ECE4D6; color: #8A8170; }

/* ===== Архив «по запускам» ===== */
/* Панель над списком заданий: вход в режим выделения + показ архивных. */
.trends-shell .tj-listbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 12px;
}
.trends-shell .tj-listbar__check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.trends-shell .tj-listbar__note { font-size: 12px; color: var(--muted); }

.trends-shell .tj-card__check { flex: 0 0 auto; width: 16px; height: 16px; cursor: pointer; }
/* Архивная карточка приглушена, но читаема: она в списке только по галке. */
.trends-shell .tj-card--archived { opacity: .62; background: var(--cream); }
.trends-shell .tj-card--archived::before { background: #8A8170; }
.trends-shell .tj-card--picked { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(232,67,28,.14); }
.trends-shell .tj-badge--archived { background: #E4DED2; color: #6B6453; white-space: nowrap; }
.trends-shell .tj-metric__arch { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* ===== Цена прогона (см. спеку 2026-08-19 trendly-job-cost-design) ===== */
/* Строка под числом видео. Прочерк намеренно тише цифры: «цену взять неоткуда»
   — это не ошибка задания, а свойство старых прогонов; почему — в title. */
.trends-shell .tj-metric__cost {
  font-size: 12px; font-weight: 700; color: var(--text); margin-top: 4px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.trends-shell .tj-metric__cost--none { font-weight: 400; color: var(--muted); cursor: help; }

/* Сводка по деньгам в панели над списком. */
.trends-shell .tj-listbar__spend {
  display: inline-flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.trends-shell .tj-listbar__spend b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.trends-shell .tj-listbar__cov { font-size: 12px; color: var(--muted); }

/* Массовое действие — липкая полоса снизу, чтобы не терялась при скролле. */
.trends-shell .tj-bulkbar {
  position: sticky; bottom: 12px; z-index: 5; margin-top: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; box-shadow: 0 8px 24px rgba(28,27,24,.14);
}
.trends-shell .tj-bulkbar__n { font-size: 13px; color: var(--text); margin-right: 4px; }

/* Плашка режима «Видео → 📦 Архив». */
.trends-shell .tr-archived-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #F4EFE5; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin: 10px 0; font-size: 13px; color: #6B6453;
}
/* Кнопка возврата на плитке: плитка целиком — ссылка, поэтому клик по кнопке
   гасится в обработчике (preventDefault + stopPropagation). */
.trends-shell .tr-tile__unarch {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  border: none; border-radius: 8px; padding: 4px 8px; cursor: pointer;
  background: rgba(28,27,24,.72); color: #fff; font-size: 13px; line-height: 1;
}
.trends-shell .tr-tile__unarch:hover { background: rgba(28,27,24,.9); }
.trends-shell .tr-tile__unarch:disabled { opacity: .5; cursor: default; }

.trends-shell .tj-warn { margin-top: 10px; font-size: 13px; color: #946A00; }
.trends-shell .tj-err  { margin-top: 10px; font-size: 13px; color: #9B2030; }
.trends-shell .tj-empty { color: var(--muted); padding: 24px; text-align: center; }

/* ===== Channels table (P2) ===== */
.trends-shell .trends-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.trends-shell .trends-pills { display: flex; gap: 6px; }
.trends-shell .trends-pill {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: all .12s ease;
}
.trends-shell .trends-pill:hover { border-color: var(--accent); color: var(--text); }
.trends-shell .trends-pill.active {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.trends-shell .trends-input {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 11px; font-size: 13px; min-width: 220px;
}
.trends-shell .trends-input--sm { min-width: 140px; }
.trends-shell .trends-input:focus { outline: none; border-color: var(--accent); }
.trends-shell .trends-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.trends-shell .trends-btn:hover { filter: brightness(1.05); }

.trends-shell .trends-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.trends-shell .trends-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.trends-shell .trends-table th, .trends-shell .trends-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.trends-shell .trends-table thead th {
  position: sticky; top: 0; background: var(--cream); color: var(--muted);
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; z-index: 1;
}
.trends-shell .trends-th--sortable { cursor: pointer; user-select: none; }
.trends-shell .trends-th--sortable:hover { color: var(--accent); }
.trends-shell .trends-sort-ar { margin-left: 4px; color: var(--accent); font-size: 10px; }
.trends-shell .trends-table tbody tr:hover { background: var(--cream); }
.trends-shell .trends-num { text-align: right; font-variant-numeric: tabular-nums; }

.trends-shell .trends-creator { display: flex; align-items: center; gap: 10px; }
.trends-shell .trends-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--cream);
}
.trends-shell .trends-avatar--ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 700; font-size: 14px; border: 1px solid var(--line);
}
.trends-shell .trends-creator__txt { display: flex; flex-direction: column; gap: 1px; }
.trends-shell .trends-creator__name { color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; }
.trends-shell .trends-creator__name:hover { color: var(--accent); text-decoration: underline; }
.trends-shell .trends-avatar-link { display: inline-flex; cursor: pointer; }
.trends-shell .trends-creator__handle { color: var(--muted); font-size: 11px; text-decoration: none; }
.trends-shell .trends-creator__handle--link { cursor: pointer; }
.trends-shell .trends-creator__handle--link:hover { color: var(--accent); text-decoration: underline; }
.trends-shell .trends-creator__verified { color: var(--accent); font-size: 11px; }

.trends-shell .trends-pbadge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); background: var(--cream); color: var(--text);
}
.trends-shell .trends-pbadge--tiktok { border-color: #111; }
.trends-shell .trends-pbadge--youtube { border-color: #c00; color: #c00; }

.trends-shell .trends-vbadge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  font-weight: 700; border: 1px solid currentColor; font-variant-numeric: tabular-nums;
}
.trends-shell .trends-muted { color: var(--muted); }

.trends-shell .trends-td--tags { white-space: normal; max-width: 180px; }
.trends-shell .trends-tag {
  display: inline-block; padding: 1px 7px; margin: 1px 3px 1px 0; border-radius: 999px;
  background: var(--cream); border: 1px solid var(--line); color: var(--muted); font-size: 11px;
}

.trends-shell .trends-empty { padding: 32px; text-align: center; color: var(--muted); }
.trends-shell .trends-empty--err { color: #9B2030; }

/* ── Phase P3: «Видео» tab — toolbar, pills, vertical 9:16 tiles, table ── */
.trends-shell .tr-videos { }

.trends-shell .tr-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; }
.trends-shell .tr-seg { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.trends-shell .tr-seg__btn {
  background:var(--surface); color:var(--text); border:none; padding:6px 12px; cursor:pointer; font:inherit;
}
.trends-shell .tr-seg__btn + .tr-seg__btn { border-left:1px solid var(--line); }
.trends-shell .tr-seg__btn:hover { background:var(--cream); }
.trends-shell .tr-seg__btn.active { background:var(--accent); color:#fff; }
.trends-shell .tr-seg__btn--off { opacity: .45; cursor: not-allowed; }
.trends-shell .tr-dir { border:1px solid var(--line); border-radius:8px; }
.trends-shell .tr-select, .trends-shell .tr-input {
  background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:6px 10px; font:inherit; color:var(--text);
}
.trends-shell .tr-input--sm { max-width:130px; }
.trends-shell .tr-search { display:inline-flex; flex-wrap:wrap; gap:6px; align-items:center; }

/* Поиск по тексту уходит на сервер, поэтому применяется кнопкой, а не на каждый
   символ. Чтобы это было видно, «пуск» приклеен к правому краю поля и подсвечен
   акцентом; пока введённое не применено — он ещё и пульсирует. */
.trends-shell .tr-q { display:inline-flex; align-items:stretch; }
.trends-shell .tr-q .tr-input { border-top-right-radius:0; border-bottom-right-radius:0; border-right:none; }
.trends-shell .tr-go {
  display:inline-flex; align-items:center; justify-content:center; min-width:38px;
  padding:0 12px; cursor:pointer; font:inherit; font-size:12px; line-height:1;
  background:var(--accent); color:#fff; border:1px solid var(--accent);
  border-radius:0 8px 8px 0;
}
.trends-shell .tr-go:hover { filter:brightness(1.08); }
.trends-shell .tr-go--dirty { animation:tr-go-pulse 1.3s ease-in-out infinite; }
@keyframes tr-go-pulse {
  0%, 100% { box-shadow:0 0 0 0 rgba(255,106,26,.55); }
  50%      { box-shadow:0 0 0 5px rgba(255,106,26,0); }
}
@media (prefers-reduced-motion: reduce) { .trends-shell .tr-go--dirty { animation:none; } }
.trends-shell .tr-q-hint { color:var(--accent); font-size:12px; white-space:nowrap; }

/* Даты — своя группа с подписью: они применяются сразу, «пуск» на них не влияет. */
.trends-shell .tr-period { display:inline-flex; flex-wrap:wrap; gap:6px; align-items:center; }
.trends-shell .tr-period__lbl { color:var(--muted); font-size:12px; white-space:nowrap; }
.trends-shell .tr-period .tr-seg__btn { border:1px solid var(--line); border-radius:8px; }
.trends-shell .tr-period .tr-seg__btn + .tr-seg__btn { border-left:1px solid var(--line); }

.trends-shell .tr-pills { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.trends-shell .tr-pill {
  background:var(--surface); border:1px solid var(--line); border-radius:999px;
  padding:4px 12px; cursor:pointer; font:inherit; font-size:13px; color:var(--muted);
}
.trends-shell .tr-pill:hover { color:var(--text); }
.trends-shell .tr-pill.active { background:var(--accent); color:#fff; border-color:var(--accent); }

.trends-shell .tr-empty { padding:32px; text-align:center; color:var(--muted); }
.trends-shell .tr-empty--err { color:#9B2030; }
.trends-shell .tr-muted { color:var(--muted); }

/* virality badge tiers — driven by viralityTier().key, colored from --tier-* tokens */
.trends-shell .tr-badge {
  display:inline-block; color:#fff; font-size:12px; font-weight:700;
  padding:2px 8px; border-radius:6px; line-height:1.2; white-space:nowrap;
}
.trends-shell .tr-badge--fire { background:var(--tier-fire); }
.trends-shell .tr-badge--high { background:var(--tier-high); }
.trends-shell .tr-badge--mid  { background:var(--tier-mid); }
.trends-shell .tr-badge--low  { background:var(--tier-low); }

.trends-shell .tr-pbadge {
  display:inline-block; padding:2px 8px; border-radius:6px; font-size:11px; font-weight:600;
  border:1px solid var(--line); background:var(--cream); color:var(--text); white-space:nowrap;
}
.trends-shell .tr-pbadge--tiktok { border-color:#111; }
.trends-shell .tr-pbadge--youtube { border-color:#c00; color:#c00; }

/* ── Tiles, S/M/L grids. Each tile's aspect ratio is set inline from the
   thumbnail's real dimensions (see videos.js tileAspect), so horizontal videos
   show as full 16:9 and verticals as 9:16 — start-aligned rows of mixed height. */
.trends-shell .tr-tiles { display:grid; gap:14px; align-items:start; }
.trends-shell .tr-tiles--s { grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); }
.trends-shell .tr-tiles--m { grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); }
.trends-shell .tr-tiles--l { grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); }
.trends-shell .tr-tile {
  display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line);
  border-radius:12px; overflow:hidden; text-decoration:none; color:var(--text);
  transition:box-shadow .15s, transform .15s;
}
.trends-shell .tr-tile:hover { box-shadow:0 4px 16px rgba(28,27,24,.12); transform:translateY(-2px); }
.trends-shell .tr-tile__media { position:relative; aspect-ratio:16/9; background:#EFE8DC; }
.trends-shell .tr-tile__img { width:100%; height:100%; object-fit:cover; display:block; }
.trends-shell .tr-tile__noimg {
  width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:13px;
}
.trends-shell .tr-tile__media .tr-badge { position:absolute; top:6px; left:6px; }
.trends-shell .tr-tile__dur {
  position:absolute; bottom:6px; right:6px; background:rgba(28,27,24,.72); color:#fff;
  font-size:12px; padding:2px 7px; border-radius:6px; font-variant-numeric:tabular-nums;
}
.trends-shell .tr-tile__meta { padding:8px 10px; display:flex; flex-direction:column; gap:6px; }
.trends-shell .tr-tile__title { font-size:13px; font-weight:600; line-height:1.3; max-height:2.6em; overflow:hidden; }
.trends-shell .tr-tile__chan { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; }
.trends-shell .tr-tile__avatar { width:18px; height:18px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.trends-shell .tr-tile__stats {
  display:flex; gap:10px; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; flex-wrap:wrap;
}

/* ── Table mode ── */
.trends-shell .tr-table-wrap { overflow-x:auto; }
.trends-shell .tr-table {
  width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--line);
  border-radius:12px; overflow:hidden;
}
.trends-shell .tr-table th, .trends-shell .tr-table td {
  padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; font-size:13px; vertical-align:middle;
}
.trends-shell .tr-table th { color:var(--muted); font-weight:600; background:var(--cream); white-space:nowrap; }
.trends-shell .tr-table th.tr-th--sortable { cursor:pointer; user-select:none; }
.trends-shell .tr-table th.tr-th--sortable:hover { color:var(--text); }
.trends-shell .tr-sort-ar { margin-left:4px; color:var(--accent); font-size:10px; }
.trends-shell .tr-table .num { text-align:right; font-variant-numeric:tabular-nums; }
.trends-shell .tr-table tbody tr:hover { background:var(--cream); }
.trends-shell .tr-th-thumb, .trends-shell .tr-td-thumb { width:48px; }
.trends-shell .tr-thumb-mini { display:block; width:36px; height:48px; object-fit:cover; border-radius:5px; background:#EFE8DC; }
.trends-shell .tr-thumb-mini--ph { display:inline-block; }
.trends-shell .tr-cell-chan { display:flex; align-items:center; gap:6px; }
.trends-shell .tr-table__avatar { width:20px; height:20px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.trends-shell .tr-cell-title { max-width:280px; }
.trends-shell .tr-link-title { color:var(--text); text-decoration:none; font-weight:600; }
.trends-shell .tr-link-title:hover { color:var(--accent); text-decoration:underline; }
.trends-shell .tr-cell-tags { white-space:normal; max-width:200px; }
.trends-shell .tr-tag {
  display:inline-block; padding:1px 7px; margin:1px 3px 1px 0; border-radius:999px;
  background:var(--cream); border:1px solid var(--line); color:var(--muted); font-size:11px;
}
.trends-shell .tr-link { color:var(--accent); text-decoration:none; font-weight:700; }

/* ── Overview (P4) ─────────────────────────────────────────────── */
.trends-shell .tr-loading,
.trends-shell .tr-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
}

.trends-shell .tr-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 1100px) {
  .trends-shell .tr-kpi-row { grid-template-columns: repeat(3, 1fr); }
}
.trends-shell .tr-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.trends-shell .tr-kpi-l {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.trends-shell .tr-kpi-v {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.trends-shell .tr-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) {
  .trends-shell .tr-grid2 { grid-template-columns: 1fr; }
}
.trends-shell .tr-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.trends-shell .tr-block-h {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.trends-shell .tr-vdist-seg { margin-left: auto; }
.trends-shell .tr-vdist-seg .tr-seg__btn { padding: 3px 9px; font-size: 12px; font-weight: 600; }
.trends-shell .tr-svg {
  width: 100%;
  height: 140px;
  display: block;
}

.trends-shell .tr-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trends-shell .tr-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.trends-shell .tr-bar-label {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trends-shell .tr-bar-track {
  background: var(--cream);
  border-radius: 6px;
  height: 14px;
  overflow: hidden;
}
.trends-shell .tr-bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
}
.trends-shell .tr-bar-n {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Overview P5: bar time charts, granularity toggle, virality dist,
      clickable top channels, treemap ─────────────────────────────────── */

/* full-width blocks span both grid columns */
.trends-shell .tr-block--wide { grid-column: 1 / -1; }

.trends-shell .tr-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 6px 0 8px;
}
.trends-shell .tr-section-title { font-size: 13px; font-weight: 700; color: var(--text); }
.trends-shell .tr-hint { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 6px; }

.trends-shell .tr-bucket-seg, .trends-shell .tr-treemap-seg { flex: 0 0 auto; }
.trends-shell .tr-treemap-seg { margin-left: auto; }

/* ── Vertical bar time chart ── */
.trends-shell .tr-barchart { position: relative; }
.trends-shell .tr-bar-svg { width: 100%; height: 180px; display: block; }
.trends-shell .tr-bar-svg rect { cursor: default; transition: opacity .1s; }

.trends-shell .tr-bar-axis {
  display: flex; width: 100%; margin-top: 4px;
}
.trends-shell .tr-bar-axis__l {
  flex: 1 1 0; min-width: 0; text-align: center;
  font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}

.trends-shell .tr-bar-tip {
  position: absolute; transform: translate(-50%, -110%);
  background: var(--text); color: #fff; border-radius: 7px;
  padding: 5px 9px; font-size: 11px; line-height: 1.3; white-space: nowrap;
  pointer-events: none; z-index: 5; box-shadow: 0 4px 14px rgba(28,27,24,.25);
}
.trends-shell .tr-bar-tip__d { opacity: .85; }
.trends-shell .tr-bar-tip__v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Virality distribution (7 escalating bars) ── */
.trends-shell .tr-vdist {
  display: flex; align-items: flex-end; gap: 8px; height: 180px;
  padding-top: 6px;
}
.trends-shell .tr-vdist__col {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  cursor: default;
}
.trends-shell .tr-vdist__n {
  font-size: 11px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; margin-bottom: 3px;
}
.trends-shell .tr-vdist__bar {
  width: 100%; border-radius: 5px 5px 0 0; min-height: 2px;
  transition: filter .1s, opacity .1s; background: var(--tier-low);
}
.trends-shell .tr-vdist__lbl {
  margin-top: 5px; font-size: 10px; color: var(--muted);
  white-space: nowrap; text-align: center;
}
.trends-shell .tr-vdist__col.is-hov .tr-vdist__bar { filter: brightness(1.08); }
/* escalating viral palette: muted below 1, warm/orange at and above 1× */
.trends-shell .tr-vdist__col--v0 .tr-vdist__bar { background: #D9D1C0; }            /* <0.1   */
.trends-shell .tr-vdist__col--v1 .tr-vdist__bar { background: var(--tier-low); }    /* 0.1-0.3 */
.trends-shell .tr-vdist__col--v2 .tr-vdist__bar { background: var(--tier-mid); }    /* 0.3-1  */
.trends-shell .tr-vdist__col--v3 .tr-vdist__bar { background: var(--tier-high); }   /* 1-3    */
.trends-shell .tr-vdist__col--v4 .tr-vdist__bar { background: #FB5410; }            /* 3-10   */
.trends-shell .tr-vdist__col--v5 .tr-vdist__bar { background: var(--tier-fire); }   /* 10-50  */
.trends-shell .tr-vdist__col--v6 .tr-vdist__bar { background: #C5260C; }            /* >=50   */

/* ── Top channels clickable rows ── */
.trends-shell .tr-bar-row--btn {
  width: 100%; border: none; background: transparent; text-align: left;
  cursor: pointer; padding: 3px 4px; border-radius: 7px; font: inherit;
}
.trends-shell .tr-bar-row--btn:hover { background: var(--cream); }
.trends-shell .tr-bar-row--btn .tr-bar-label { color: var(--text); }
.trends-shell .tr-bar-row--btn:hover .tr-bar-label { color: var(--accent); }
.trends-shell .tr-bar-row--btn .tr-bar-fill { background: var(--accent); }

/* ── Treemap ── */
.trends-shell .tr-treemap { position: relative; width: 100%; }
.trends-shell .tr-treemap-svg { width: 100%; height: 360px; display: block; }
.trends-shell .tr-tm-cell { cursor: pointer; }
.trends-shell .tr-tm-cell:hover rect { filter: brightness(1.07); }
.trends-shell .tr-tm-name {
  font-size: 11px; font-weight: 700; fill: #2A1B10; pointer-events: none;
}
.trends-shell .tr-tm-val {
  font-size: 10px; fill: #3A2A1A; opacity: .85; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.trends-shell .tr-tm-tip {
  position: absolute; transform: translate(-50%, -108%);
  background: var(--text); color: #fff; border-radius: 7px;
  padding: 6px 10px; font-size: 11px; line-height: 1.35; white-space: nowrap;
  pointer-events: none; z-index: 5; box-shadow: 0 4px 14px rgba(28,27,24,.25);
}
.trends-shell .tr-tm-tip__p { opacity: .8; font-size: 10px; }
.trends-shell .tr-tm-tip__n { font-weight: 700; }
.trends-shell .tr-tm-tip__v { font-variant-numeric: tabular-nums; opacity: .9; }
.trends-shell .tr-tm-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px;
  font-size: 12px; color: var(--muted);
}
.trends-shell .tr-tm-leg { display: inline-flex; align-items: center; gap: 6px; }
.trends-shell .tr-tm-leg__sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ── Videos cross-nav active filter chip ── */
.trends-shell .tr-active-filters { margin-bottom: 10px; }
.trends-shell .tr-fchip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FFE6D2; color: #B5470F; border: 1px solid #FFCBA6;
  border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px;
}
.trends-shell .tr-fchip b { font-weight: 700; }
.trends-shell .tr-fchip__x {
  border: none; background: rgba(181,71,15,.12); color: #B5470F;
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  font-size: 11px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.trends-shell .tr-fchip__x:hover { background: rgba(181,71,15,.24); }

.trends-shell .tr-grid2 + .tr-grid2 { margin-top: 12px; }
.trends-shell .tr-grid2 + .tr-block--wide,
.trends-shell .tr-grid2 ~ .tr-block--wide { margin-top: 12px; }

/* ── «Видео» rework: compact toolbar, multi-select, log range sliders, chips ── */

/* Compact toolbar — smaller font + tighter padding, single tidy wrapping row. */
.trends-shell .tr-toolbar--compact { gap: 6px; font-size: 12px; align-items: center; }
.trends-shell .tr-toolbar--compact .tr-seg__btn { padding: 4px 9px; font-size: 12px; }
.trends-shell .tr-toolbar--compact .tr-select,
.trends-shell .tr-toolbar--compact .tr-input { padding: 4px 8px; font-size: 12px; }
.trends-shell .tr-toolbar--compact .tr-input { min-width: 0; }
.trends-shell .tr-toolbar--compact .tr-input[type="search"] { min-width: 200px; flex: 1 1 200px; }
.trends-shell .tr-toolbar--compact .tr-input--sm { max-width: 120px; }
/* В форме остался только поиск (даты вынесены отдельным узлом), поэтому базис
   задаём по полю ввода — иначе форма растягивается на всю строку и выдавливает
   даты на следующую. */
.trends-shell .tr-toolbar--compact .tr-search { gap: 5px; flex: 1 1 240px; }
.trends-shell .tr-toolbar--compact .tr-go { min-width: 32px; padding: 0 10px; font-size: 11px; }
.trends-shell .tr-toolbar--compact .tr-dir { padding: 4px 9px; }

/* Creator multi-select dropdown */
.trends-shell .tr-ms { position: relative; display: inline-block; }
.trends-shell .tr-ms__btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font: inherit; font-size: 12px; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.trends-shell .tr-ms__btn:hover { border-color: var(--accent); }
.trends-shell .tr-ms__btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.trends-shell .tr-ms__caret { font-size: 10px; opacity: .75; }
.trends-shell .tr-ms__panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 20;
  width: 280px; max-width: 80vw; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(28,27,24,.18); overflow: hidden;
}
.trends-shell .tr-ms__head { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); }
.trends-shell .tr-ms__search {
  flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 8px; font: inherit; font-size: 12px; color: var(--text); background: var(--cream);
}
.trends-shell .tr-ms__search:focus { outline: none; border-color: var(--accent); }
.trends-shell .tr-ms__clear {
  border: none; background: none; color: var(--accent); cursor: pointer;
  font: inherit; font-size: 12px; white-space: nowrap; padding: 2px 4px;
}
.trends-shell .tr-ms__clear:hover { text-decoration: underline; }
.trends-shell .tr-ms__list { max-height: 280px; overflow-y: auto; padding: 4px; }
.trends-shell .tr-ms__opt {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 7px; cursor: pointer; font-size: 12px;
}
.trends-shell .tr-ms__opt:hover { background: var(--cream); }
.trends-shell .tr-ms__opt input { accent-color: var(--accent); flex: 0 0 auto; }
.trends-shell .tr-ms__opt-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.trends-shell .tr-ms__opt-n { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.trends-shell .tr-ms__empty { padding: 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* Фильтр «Задания» (job-select.js): строка шире креаторской — в ней логотип,
   имя, #id и период. */
.trends-shell .tr-ms__panel--wide { width: 340px; }
.trends-shell .tr-jopt { align-items: center; }
.trends-shell .tr-jopt--empty { opacity: .55; }
.trends-shell .tr-jopt__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trends-shell .tr-jopt__name {
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trends-shell .tr-jopt__sub { color: var(--muted); font-size: 11px; }

/* Dual log range sliders (views + virality) */
.trends-shell .tr-ranges {
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  margin-bottom: 12px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.trends-shell .tr-lr { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 280px; }
.trends-shell .tr-lr__lbl { font-size: 12px; color: var(--muted); white-space: nowrap; flex: 0 0 auto; }
.trends-shell .tr-lr__track { position: relative; flex: 1 1 auto; height: 22px; min-width: 120px; }
.trends-shell .tr-lr__track::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px;
  transform: translateY(-50%); background: var(--cream); border: 1px solid var(--line); border-radius: 999px;
}
.trends-shell .tr-lr__fill {
  position: absolute; top: 50%; height: 4px; transform: translateY(-50%);
  background: var(--accent); border-radius: 999px; pointer-events: none; z-index: 1;
}
.trends-shell .tr-lr__input {
  position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 22px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent;
  pointer-events: none; z-index: 2;
}
.trends-shell .tr-lr__input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(28,27,24,.3); cursor: pointer;
}
.trends-shell .tr-lr__input::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(28,27,24,.3); cursor: pointer;
}
.trends-shell .tr-lr__input::-moz-range-track { background: transparent; }
.trends-shell .tr-lr__rng {
  font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums;
  white-space: nowrap; flex: 0 0 auto; display: inline-flex; gap: 3px;
}

/* Active filter chips row — wraps multiple removable chips. */
.trends-shell .tr-active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
/* «Обзор»: кнопка «Сбросить всё» прижата вправо тем же приёмом, что сегменты
   над графиками (tr-vdist-seg, tr-treemap-seg). */
.trends-shell .tr-active-filters__reset { margin-left: auto; }

/* ── Обзор (Overview) rebuild — page filters, dual-number cards, stacked time
      charts, views dist, language donut, virality×duration heatmap ───────── */

/* Page-level filter bar (platform chips + date range + quick buttons) */
.trends-shell .tr-ovf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 18px; margin-bottom: 14px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.trends-shell .tr-ovf__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.trends-shell .tr-ovf__lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.trends-shell .tr-ovf__dash { color: var(--muted); }
.trends-shell .tr-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
  transition: all .12s ease;
}
.trends-shell .tr-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.trends-shell .tr-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.trends-shell .tr-chip--sm { padding: 5px 11px; font-size: 12px; }
.trends-shell .tr-chip--disabled { opacity: .5; cursor: not-allowed; }

/* Dual-number metric cards: big "всего" + small "+N за 7 дней" */
.trends-shell .tr-kpi-sub { font-size: 11px; font-weight: 400; color: var(--muted); }
.trends-shell .tr-kpi-week { margin-top: 5px; font-size: 12px; color: var(--muted); }
.trends-shell .tr-kpi-week b { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Inline legend for stacked time charts */
.trends-shell .tr-legend-inline {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px;
  font-size: 11px; font-weight: 400; color: var(--muted);
}
.trends-shell .tr-legdot {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto;
  margin-right: 1px;
}
.trends-shell .tr-legend-inline .tr-legdot:not(:first-child) { margin-left: 8px; }

/* stacked-chart tooltip rows */
.trends-shell .tr-bar-tip__row {
  display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; opacity: .95;
}
.trends-shell .tr-bar-tip__row b { font-weight: 700; }

/* short explanatory note under a chart title */
.trends-shell .tr-chart-note { font-size: 11px; color: var(--muted); margin: -4px 0 8px; line-height: 1.4; }

/* ── Views-threshold chart: 6-line family, Числа/Доля toggle, click-to-hide legend ── */
.trends-shell .tr-vt-seg { margin-left: auto; }
.trends-shell .tr-vt-chart { position: relative; }
.trends-shell .tr-vt-svg { width: 100%; height: 180px; display: block; }
.trends-shell .tr-vt-line { transition: opacity .1s; }
.trends-shell .tr-vt-hit { cursor: default; }
.trends-shell .tr-vt-legend {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.trends-shell .tr-vt-leg {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; cursor: pointer; font: inherit;
  padding: 3px 8px; border-radius: 999px; font-size: 12px; color: var(--text);
}
.trends-shell .tr-vt-leg:hover { background: var(--cream); }
.trends-shell .tr-vt-leg.is-off { color: var(--muted); text-decoration: line-through; opacity: .6; }

/* clickable distribution bars (virality + views) */
.trends-shell .tr-vdist__col--btn {
  border: none; background: transparent; font: inherit; cursor: pointer; padding: 0;
}
.trends-shell .tr-vdist__col--btn:hover .tr-vdist__bar { filter: brightness(1.08); }
.trends-shell .tr-vdist__col--btn:hover .tr-vdist__lbl { color: var(--accent); }
.trends-shell .tr-vdist__col--views .tr-vdist__bar { background: #2D7DD2; }
.trends-shell .tr-vdist__col--views .tr-vdist__lbl { font-size: 9px; }

/* ── Language donut ── */
.trends-shell .tr-pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.trends-shell .tr-pie { flex: 0 0 auto; }
.trends-shell .tr-pie-svg { width: 180px; height: 180px; display: block; }
.trends-shell .tr-pie-arc { stroke: var(--surface); stroke-width: 1.5; cursor: default; transition: opacity .1s; }
.trends-shell .tr-pie-arc.is-hov { opacity: .82; }
.trends-shell .tr-pie-center-n { font-size: 22px; font-weight: 800; fill: var(--text); font-variant-numeric: tabular-nums; }
.trends-shell .tr-pie-center-l { font-size: 11px; fill: var(--muted); }
.trends-shell .tr-pie-legend { flex: 1 1 160px; min-width: 160px; display: flex; flex-direction: column; gap: 3px; }
.trends-shell .tr-pie-leg {
  display: grid; grid-template-columns: 14px 1fr auto auto; align-items: center; gap: 8px;
  font-size: 12px; padding: 2px 4px; border-radius: 6px; cursor: default;
}
.trends-shell .tr-pie-leg.is-hov { background: var(--cream); }
.trends-shell .tr-pie-leg__sw { width: 12px; height: 12px; border-radius: 3px; }
.trends-shell .tr-pie-leg__lang { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trends-shell .tr-pie-leg__n { color: var(--text); font-variant-numeric: tabular-nums; }
.trends-shell .tr-pie-leg__pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ── Virality × duration heatmap ── */
.trends-shell .tr-heat { overflow-x: auto; }
.trends-shell .tr-heat-tbl { border-collapse: separate; border-spacing: 3px; width: 100%; }
.trends-shell .tr-heat-corner {
  font-size: 10px; color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; padding: 2px 6px;
}
.trends-shell .tr-heat-colh, .trends-shell .tr-heat-rowh {
  font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap;
}
.trends-shell .tr-heat-colh { text-align: center; padding: 2px 6px; }
.trends-shell .tr-heat-rowh { text-align: right; padding: 2px 8px; }
.trends-shell .tr-heat-cell {
  text-align: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 7px; min-width: 64px; height: 40px; cursor: pointer;
  border: 1px solid var(--line); transition: filter .1s, outline .1s;
}
.trends-shell .tr-heat-cell.is-hov { filter: brightness(1.05); outline: 2px solid var(--accent); outline-offset: -2px; }

.trends-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.trends-product-switch { display: flex; align-items: center; gap: 8px; }
.trends-product-label { font-size: 13px; color: var(--muted, #7a7468); }
.trends-product-select { padding: 6px 10px; border: 1px solid #d9d2c4; border-radius: 8px; background: #fff; font: inherit; }

/* ── «⬇ Экспорт в MD» button (shared across Видео / Креаторы / Обзор) ── */
.trends-shell .tr-export-btn { white-space: nowrap; }
.trends-shell .tr-export-btn:disabled { opacity: 0.6; cursor: progress; }

/* «❓ Как анализировать» link-button (next to export). */
.trends-shell .tr-howto-btn { white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }

/* Result counter shown above the Видео grid / Креаторы table. */
.trends-shell .tr-count { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.trends-shell .tr-count b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Инсайты: список отчётов ── */
.trends-shell .trends-reports { max-width: 880px; }
.trends-shell .trends-reports__head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 14px; }
.trends-shell .trends-reports__title { font-size: 20px; margin: 0; color: var(--text); }
.trends-shell .trends-reports__list { display: flex; flex-direction: column; gap: 10px; }
.trends-shell .trends-report-card {
  display: flex; align-items: stretch; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; text-decoration: none; color: var(--text);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.trends-shell .trends-report-card:hover { box-shadow: 0 4px 16px rgba(28,27,24,.10); transform: translateY(-1px); border-color: var(--accent); }
.trends-shell .trends-report-card__title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.trends-shell .trends-report-card__desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.trends-shell .trends-report-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.trends-shell .trends-report-card__aside { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; white-space: nowrap; }
.trends-shell .trends-report-card__date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.trends-shell .trends-report-card__open { color: var(--accent); font-size: 13px; font-weight: 600; }
.trends-shell .trends-reports__more { margin-top: 12px; }

/* Publish date line on a video tile. */
.trends-shell .tr-tile__date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ── Trendly: бренд-шапка standalone-страницы ─────────────────────────────────
   Намеренное исключение из инварианта файла: эти селекторы page-level — бренд
   рендерится в client/trendly/index.html ВНЕ .trends-shell (над #root). ── */
.trendly-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px 8px;
  max-width: 1320px;
  margin: 0 auto;
}
.trendly-brand__logo {
  height: 56px;
  width: auto;
  flex: none;
}
.trendly-brand__text {
  display: flex;
  flex-direction: column;
}
.trendly-brand__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #1A1A1A;
}
.trendly-brand__dot { color: #E8431C; }
.trendly-brand__subtitle {
  margin-top: 2px;
  font-size: 14px;
  color: #5C5C5C;
}
.trendly-brand__about {
  margin-left: auto;
  align-self: center;
  font-size: 14px;
  font-weight: 600;
  color: #FF6A1A;
  text-decoration: none;
  white-space: nowrap;
  padding: 7px 13px;
  border: 1px solid #ECE4D6;
  border-radius: 9px;
  transition: background .15s ease;
}
.trendly-brand__about:hover { background: #FFF3EA; }

/* ── Trendly: заголовок текущей под-страницы (под баром вкладок) ───────────── */
.trends-shell .trends-page-header {
  padding: 4px 0 14px;
}
.trends-shell .trends-page-header__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: #1A1A1A;
}
.trends-shell .trends-page-header__subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: #5C5C5C;
}

/* ── Настройки / Шаблоны анализа ───────────────────────────────────── */
.trends-settings__nav { margin-bottom: 16px; }
.tj-textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  min-height: 96px; max-height: 480px; /* ≈ 20 строк, дальше внутренний скролл */
  overflow: auto; font: 14px/1.5 inherit; padding: 10px 12px;
  border: 1px solid var(--line, #E6DECF); border-radius: 8px;
  background: var(--surface, #FFFDF9); color: var(--text, #1A1A1A);
}
.tj-hint { display: block; margin-top: 6px; color: var(--muted, #8A8478); font-size: 12px; line-height: 1.4; }
.tj-grid--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .tj-grid--3 { grid-template-columns: 1fr; } }

/* ── Модал анализа ─────────────────────────────────────────────────── */
.tr-modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,16,10,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.tr-modal {
  width: 100%; max-width: 480px; background: var(--surface, #FFFDF9); color: var(--text, #1A1A1A);
  border: 1px solid var(--line, #E6DECF); border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 18px 48px rgba(0,0,0,.25); max-height: 90vh; overflow: auto;
}
.tr-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tr-modal__head h3 { margin: 0; font-size: 17px; }
.tr-modal__x { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted, #8A8478); }
.tr-modal__row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 12px; }
.tr-modal__lab { color: var(--muted, #8A8478); }
.tr-modal__est {
  margin: 12px 0; padding: 8px 12px; border-radius: 8px; font-size: 13px;
  background: var(--surface-2, #F0E9DC);
}
.tr-modal__est--warn { background: rgba(232,67,28,.10); color: #B23314; }
.tr-modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.tr-analyze-btn { border-color: var(--accent, #E8431C); color: var(--accent, #E8431C); font-weight: 600; }

/* ── Верхняя строка действий вкладки «Видео» ───────────────────────── */
.tr-actionbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-actionbar__spacer { flex: 1 1 auto; }

/* ── Статусы инсайтов ─────────────────────────────────────────────── */
.tr-ins-badge { font-size: 11px; padding: 1px 8px; border-radius: 12px; margin-left: 6px; vertical-align: middle; }
.tr-ins-badge--run { background: rgba(240,165,0,.18); color: #B8860B; }
.tr-ins-badge--err { background: rgba(232,67,28,.15); color: #E8431C; }
.tr-ins-actions { display: flex; gap: 8px; margin-top: 8px; }
.trends-report-card--static { cursor: default; } /* несостоявшиеся ссылки (идёт/ошибка) */


/* ── Модели анализа: рабочий список + каталог OpenRouter ──────────────── */
.tr-models { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line, #E6DECF); }
.tr-models .tj-form__actions { align-items: center; }

/* Каталог: 336 моделей, узкой модалки под цены и флаги не хватает. */
.tr-modal--wide { max-width: 860px; }
.tr-cat__bar { display: flex; gap: 8px; margin-bottom: 10px; }
.tr-cat__search { flex: 1 1 auto; }
.tr-cat__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tr-chip {
  border: 1px solid var(--line, #E6DECF); background: var(--surface, #FFFDF9);
  color: var(--text, #1A1A1A); border-radius: 999px; padding: 4px 11px;
  font-size: 12px; cursor: pointer;
}
.tr-chip:hover { border-color: var(--accent, #E8431C); }
.tr-chip.active { background: var(--accent, #E8431C); border-color: var(--accent, #E8431C); color: #fff; }
.tr-cat__list { max-height: 52vh; overflow: auto; border: 1px solid var(--line, #E6DECF); border-radius: 10px; }
.tr-cat__table { font-size: 13px; }
.tr-cat__table th { position: sticky; top: 0; background: var(--surface-2, #F0E9DC); z-index: 1; }
.tr-cat__name { font-weight: 600; }
.tr-cat__id { font-size: 11px; color: var(--muted, #8A8478); }
.tr-cat__row--off { opacity: .55; }
/* Флаги переносим и держим в фиксированной колонке: у .trends-table td стоит
   white-space:nowrap, из-за которого бейджи уезжали за край модалки. */
.trends-shell .tr-cat__badges { white-space: normal; width: 148px; }
.trends-shell .tr-cat__table td:nth-child(2) { white-space: normal; }
.trends-shell .tr-cat__table th, .trends-shell .tr-cat__table td { padding: 8px 10px; }
.tr-badge {
  display: inline-block; background: var(--surface-2, #F0E9DC); color: var(--muted, #8A8478);
  border-radius: 6px; padding: 1px 6px; font-size: 11px; margin: 0 4px 2px 0;
}
.tr-badge--accent { background: rgba(232,67,28,.14); color: var(--accent, #E8431C); }
.tr-modal--wide .tr-modal__actions { flex-wrap: wrap; align-items: center; }
.tr-modal--wide .tr-modal__actions .tj-hint { margin-right: auto; }

/* ── Trendwatching.Lab: галка у продукта + список доступа ─────────────────── */
/* Чекбокс внутри .tj-field уже получает вертикальную раскладку от поля, поэтому
   строку «квадратик + подпись» собираем отдельным флексом. */
.trends-shell .tj-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.trends-shell .tj-check input { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.trends-shell .tj-field .tj-check { margin-top: 6px; }
/* Выключенная строка доступа: видно, что она есть (история входов), но что
   доступ снят. Не прячем — куратору нужно уметь включить обратно. */
.trends-shell .trends-table tr.is-off td { opacity: .55; }
.trends-shell .trends-lab-access .tr-count { margin: 14px 0 8px; }

/* ── Переозвучка (надзор) ────────────────────────────────────────────────── */
.dubadm-summary { margin-bottom: 18px; }
.dubadm-summary__total { font-size: 14px; margin-bottom: 10px; }
.dubadm-usage { margin-bottom: 6px; }
.dubadm-kind { font-size: 11px; opacity: .6; margin-left: 6px; }
.dubadm-problems { color: #9B2030; font-weight: 700; }
.dubadm-empty { text-align: center; padding: 22px; opacity: .6; }
.dubadm-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.dubadm-lang {
  display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  background: #F3EEE4; color: #7A7263;
}
.dubadm-lang--done { background: #E4F3E8; color: #2F6B41; }
.dubadm-lang--failed { background: #FBE6E6; color: #9B2030; }
.dubadm-lang--running, .dubadm-lang--queued { background: #FFF0E2; color: #A65A18; }
/* Пометка «сделано с водяным знаком»: на free-тарифе дубляж иначе не отдаётся,
   и после апгрейда такие дорожки имеет смысл переделать. */
.dubadm-wm {
  margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  background: #FFF3D6; color: #8A6014; font-size: 10px; font-weight: 700;
}
/* Статусные плашки заданий переиспользуются из лабы — те же классы. */
.dub-job__status {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  border-radius: 999px; padding: 3px 9px; background: #F3EEE4; color: #7A7263;
}
.dub-job__status--done { background: #E4F3E8; color: #2F6B41; }
.dub-job__status--running, .dub-job__status--queued { background: #FFF0E2; color: #A65A18; }
.dub-job__status--failed { background: #FBE6E6; color: #9B2030; }
.dub-job__status--partial { background: #FFF3D6; color: #8A6014; }

/* ── Вкладка «Лаба»: активность Trendwatching.Lab ──────────────────────────────
   Таблицы переиспользуют .tr-table как есть — своего здесь только панель
   управления, редактируемая подпись человека и чипы его каналов. */
.trends-shell .lab-act__bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
}
.trends-shell .lab-act__check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.trends-shell .lab-act__table td { vertical-align: top; }
.trends-shell .lab-act__row--off { opacity: .55; }
.trends-shell .lab-act__email { white-space: nowrap; font-size: 12px; }
.trends-shell .lab-act__cid {
  margin-left: 6px; padding: 1px 5px; border-radius: 6px;
  background: var(--line); color: var(--muted); font-size: 10px;
}
.trends-shell .lab-act__name { display: flex; align-items: center; gap: 4px; }
.trends-shell .lab-act__name-input {
  width: 130px; background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 3px 6px; font: inherit; font-size: 12px; color: var(--text);
}
.trends-shell .lab-act__name-input:hover { border-color: var(--line); }
.trends-shell .lab-act__name-input:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.trends-shell .lab-act__dirty { color: var(--accent); font-size: 16px; line-height: 1; }
.trends-shell .lab-act__chans { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.trends-shell .lab-act__chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px; background: var(--line);
  font-size: 11px; white-space: nowrap;
}
.trends-shell .lab-act__chip--add { background: none; border: 1px dashed var(--line); color: var(--muted); cursor: pointer; }
.trends-shell .lab-act__chip-x { background: none; border: none; padding: 0; cursor: pointer; color: var(--muted); font-size: 10px; }
.trends-shell .lab-act__chan-form { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.trends-shell .lab-act__chan-form input,
.trends-shell .lab-act__chan-form select {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 6px; font: inherit; font-size: 11px; color: var(--text); max-width: 110px;
}
.trends-shell .lab-act__chan-form button {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 8px; font: inherit; font-size: 11px; cursor: pointer;
}
.trends-shell .lab-act__tabs,
.trends-shell .lab-act__tops { font-size: 12px; color: var(--muted); max-width: 200px; }
.trends-shell .lab-act__who { font-size: 11px; color: var(--muted); max-width: 260px; word-break: break-word; }

/* Отзывы на выпуски отчёта. Звёзды — «★★★★» цветом плюс «★» серым добором:
   так по столбцу видно распределение, а не приходится читать числа. */
.trends-shell .lab-act__stars { color: #F0A500; letter-spacing: 1px; white-space: nowrap; }
.trends-shell .lab-act__stars-off { color: var(--line); }
/* Комментарий — самое ценное в таблице, поэтому ему дана ширина и перенос. */
.trends-shell .lab-act__fbtext {
  max-width: 460px; min-width: 220px; white-space: pre-wrap; word-break: break-word;
  font-size: 12.5px; line-height: 1.45;
}

/* Дашборд лабы: метрики, воронка. Графики переиспользуют .tr-block/.tr-barchart
   из «Обзора» — своего здесь только карточки и полосы воронки. */
.trends-shell .lab-act__metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.trends-shell .lab-act__metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.trends-shell .lab-act__metric-v { font-size: 26px; font-weight: 700; line-height: 1.1; }
.trends-shell .lab-act__metric-l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.trends-shell .lab-act__metric-h { font-size: 11px; color: var(--muted); opacity: .75; margin-top: 2px; }
.trends-shell .lab-act__chart-total { float: right; font-size: 12px; font-weight: 400; color: var(--muted); }
.trends-shell .lab-act__funnel { display: flex; flex-direction: column; gap: 5px; padding: 6px 0; }
.trends-shell .lab-act__fun-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.trends-shell .lab-act__fun-l { flex: 0 0 190px; color: var(--muted); }
.trends-shell .lab-act__fun-track { flex: 1; height: 18px; background: var(--cream); border-radius: 5px; overflow: hidden; }
.trends-shell .lab-act__fun-bar { height: 100%; background: var(--accent); border-radius: 5px; transition: width .2s; }
.trends-shell .lab-act__fun-bar.is-base { background: var(--muted); }
.trends-shell .lab-act__fun-n { flex: 0 0 46px; text-align: right; font-weight: 700; }
.trends-shell .lab-act__fun-p { flex: 0 0 44px; text-align: right; color: var(--muted); font-size: 12px; }

/* Дашборд лабы: две колонки, полосы использования, короткие списки людей/видео. */
.trends-shell .lab-act__two {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px;
}
.trends-shell .lab-act__usage { display: flex; flex-direction: column; gap: 5px; padding: 6px 0; }
.trends-shell .lab-act__use-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.trends-shell .lab-act__use-l { flex: 0 0 160px; color: var(--muted); }
.trends-shell .lab-act__use-track { flex: 1; height: 14px; background: var(--cream); border-radius: 4px; overflow: hidden; }
.trends-shell .lab-act__use-bar { height: 100%; background: var(--accent); border-radius: 4px; }
.trends-shell .lab-act__use-n { flex: 0 0 50px; text-align: right; font-weight: 700; }
.trends-shell .lab-act__use-p { flex: 0 0 62px; text-align: right; color: var(--muted); font-size: 12px; }
.trends-shell .lab-act__list { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.trends-shell .lab-act__li {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 4px 0; border-bottom: 1px solid var(--line);
}
.trends-shell .lab-act__li:last-child { border-bottom: none; }
.trends-shell .lab-act__li-i { flex: 0 0 18px; color: var(--muted); font-size: 11px; }
.trends-shell .lab-act__li-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trends-shell .lab-act__li-v { flex: 0 0 auto; font-weight: 700; font-size: 12px; }
.trends-shell .lab-act__li-v--warn { color: #E8431C; }
.trends-shell .lab-act__li-s { flex: 0 0 auto; color: var(--muted); font-size: 11px; }

/* ── Лаба → Заявки на задачи ──────────────────────────────────────────────
   Экран куратора: кто попросил персональные задачи, какие у него каналы, на
   каких языках и на какой рынок. Решение обратимо, поэтому статус — сегментный
   переключатель, а не пара кнопок. */
.lab-act__sub { font-size: 11.5px; color: #8A8478; }
.lab-act__ok { font-size: 11.5px; font-weight: 600; color: #2F855A; }

/* Кнопка 👁 — ссылка на страницу задач человека в лабе. Ссылка, а не кнопка:
   куратор пересылает её в переписке, и «скопировать адрес» из контекстного меню
   должно работать. Но выглядеть подчёркнутой синей ссылкой ей незачем — в
   колонке она читается как иконка действия, наравне с соседними бейджами.
   Приглушена, пока на строку не навели: столбец одинаковых глаз не должен
   перетягивать внимание с цифр, ради которых панель и открыли. */
.trends-shell .lab-act__peek {
  text-decoration: none; font-size: 15px; line-height: 1;
  opacity: .45; transition: opacity .12s;
}
.trends-shell tr:hover .lab-act__peek { opacity: .8; }
.trends-shell .lab-act__peek:hover { opacity: 1; }

.lab-act__appch { display: flex; align-items: center; gap: 7px; padding: 2px 0; font-size: 12.5px; }
.lab-act__appch-p { flex: none; }
.lab-act__appch-l, .lab-act__appch-m {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .4px;
  border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.lab-act__appch-l { background: #F0E9DC; color: #6B6453; }
/* Рынок отдельным цветом: два одинаковых серых бейджа подряд куратор читает
   как один список кодов и не замечает, что рынок не указан. */
.lab-act__appch-m { background: #FFF1E8; color: #B5470F; }

/* Сегмент решения не растягивается на всю ячейку: три коротких состояния
   читаются как один переключатель, а не как панель кнопок. */
.lab-act__status { display: inline-flex; white-space: nowrap; }
.lab-act__status .tr-seg__btn { font-size: 11.5px; padding: 4px 9px; }
.lab-act__status--approved .tr-seg__btn.active { background: #2F855A; border-color: #2F855A; color: #fff; }
.lab-act__status--rejected .tr-seg__btn.active { background: #9B2030; border-color: #9B2030; color: #fff; }

/* ── Лаба → Задачи: решения креаторов ─────────────────────────────────────
   Экран куратора по спеке 2026-09-04-lab-task-responses-curator-design.
   Палитра статусов — та же, что видит сам креатор в лабе (client/lab/tasks.css,
   .lt-tc__dot--*): куратор смотрит на скрин от человека и на свой экран одними
   глазами, вторая палитра ради одной панели заставила бы их сверять.
   Исключение — «отказ»: у креатора он приглушённо-бежевый (его собственное
   решение, подсвечивать нечего), а для куратора это главный сигнал недели,
   поэтому здесь он красный. */
.lab-tr__weeks { margin-bottom: 12px; }
.lab-tr__weekn { opacity: .7; font-weight: 400; }

.lab-tr__badge {
  display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-align: center;
}
.lab-tr__badge--work { background: #FFE7D5; color: #C4510C; }
.lab-tr__badge--shot { background: #E1EDFB; color: #2C639F; }
.lab-tr__badge--skip { background: #FBE3E0; color: #C23F32; }
.lab-tr__badge--todo { background: #F0EDE7; color: #8A8478; }

.lab-tr__row.is-clickable { cursor: pointer; }
.lab-tr__row.is-clickable:hover { background: #FBF7F0; }
.lab-tr__arrow { display: inline-block; width: 14px; color: #B5AEA1; font-size: 11px; }
.lab-tr__appbadge {
  font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.lab-tr__appbadge--pending { background: #FFF1E8; color: #B5470F; }
.lab-tr__appbadge--rejected { background: #F0EDE7; color: #8A8478; }

/* Раскрытая строка: карточки задач одного человека. Фон холоднее таблицы,
   чтобы было видно, где заканчивается раскрытая строка и начинается следующий
   человек. */
.lab-tr__detailrow > td { background: #FBF7F0; padding: 10px 12px !important; }
.lab-tr__cards { display: flex; flex-direction: column; gap: 8px; }
.lab-tr__card {
  background: #fff; border: 1px solid #E8E1D5; border-left-width: 3px;
  border-radius: 8px; padding: 8px 11px; font-size: 12.5px;
}
.lab-tr__card--work { border-left-color: #FF6A1A; }
.lab-tr__card--shot { border-left-color: #3B7FD1; }
.lab-tr__card--skip { border-left-color: #C23F32; }
.lab-tr__card--todo { border-left-color: #E8E1D5; }
.lab-tr__card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lab-tr__card-title { font-weight: 600; }
.lab-tr__card-kind { font-size: 11px; color: #8A8478; }
/* Причина переносится и не обрезается ни на каком экране: ради этих слов
   панель и сделана — обрезанный отказ бесполезен. */
.lab-tr__card-reason { margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.lab-tr__card-reasonkind { color: #8A8478; font-size: 11.5px; }
.lab-tr__card-link { margin-top: 5px; word-break: break-all; }
.lab-tr__card-hist { margin-top: 5px; font-size: 11.5px; color: #8A8478; }
.lab-tr__card-orphan { margin-top: 5px; font-size: 11.5px; color: #B5470F; }

.lab-tr__reasons { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.lab-tr__rgroup { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lab-tr__rchip {
  background: #FBE3E0; color: #C23F32; border-radius: 6px; padding: 3px 9px;
  font-size: 12.5px; font-weight: 600; max-width: 640px;
}
.lab-tr__ritems { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lab-tr__ritem { font-size: 11.5px; color: #8A8478; }

/* ── Панель «🎙 Переозвучка» (client/trendly/lab-dubs.js) ─────────────────────
   Строит на тех же generic-классах, что «Задачи» (.lab-tr__row/.lab-tr__detailrow
   для раскрытия, .lab-act__* для метрик/воронки/usage-баров, .dub-job__status
   из старой админки dubs.js для цвета статусов) — своё здесь только новое:
   карточки заданий, языковые чипы, таймлайн событий, список проблем. */
.trends-shell .lab-dub__evbadge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; color: #8A8478;
  background: #F0EDE7; border-radius: 4px; padding: 1px 5px; margin-left: 6px;
}
.trends-shell .lab-dub__fails { color: #9B2030; font-weight: 600; }

.trends-shell .lab-dub__detail { display: flex; flex-direction: column; gap: 10px; }
.trends-shell .lab-dub__cards { display: flex; flex-direction: column; gap: 8px; }
.trends-shell .lab-dub__card {
  background: #fff; border: 1px solid #E8E1D5; border-radius: 8px;
  padding: 9px 12px; font-size: 12.5px;
}
.trends-shell .lab-dub__card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trends-shell .lab-dub__card-title { font-weight: 600; }
.trends-shell .lab-dub__card-error { margin-top: 5px; color: #9B2030; white-space: pre-wrap; word-break: break-word; }
.trends-shell .lab-dub__wm {
  font-size: 10px; font-weight: 700; background: #FFF3D6; color: #8A6014;
  border-radius: 4px; padding: 1px 5px;
}

/* Чипы языков — грид, а не ряд: у ролика с 6+ языками ряд не влезает ни в
   одну ширину экрана, а карточка всё равно раскрыта под таблицей. */
.trends-shell .lab-dub__chips {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; margin-top: 8px;
}
.trends-shell .lab-dub__chip {
  border: 1px solid #EFE9DD; border-radius: 6px; padding: 7px 9px; font-size: 11.5px;
  display: flex; flex-direction: column; gap: 3px;
}
.trends-shell .lab-dub__chip-lang { font-weight: 700; }
.trends-shell .lab-dub__chip-err { color: #9B2030; white-space: pre-wrap; word-break: break-word; }
.trends-shell .lab-dub__chip-subs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.trends-shell .lab-dub__chip-links { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.trends-shell .lab-dub__medialink { color: var(--accent); }
.trends-shell .lab-dub__unavail { color: #8A8478; font-style: italic; }

/* Таймлайн событий — узкой строкой под карточкой задания и под таблицей у
   раскрытого человека: это журнал, не разрез для сравнения, поэтому просто
   список, а не бары. */
.trends-shell .lab-dub__timeline, .trends-shell .lab-dub__ptimeline {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed #E8E1D5;
  display: flex; flex-direction: column; gap: 3px;
}
.trends-shell .lab-dub__tl-item { font-size: 11px; color: #8A8478; }

.trends-shell .lab-dub__problems { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.trends-shell .lab-dub__problem { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.trends-shell .lab-dub__problem-err { color: #9B2030; white-space: pre-wrap; word-break: break-word; }
