/* ── АЙNET AI Radar — Brand Styles ── */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --blue: #0055FF;
  --blue-dark: #0044CC;
  --blue-light: #E8F0FF;
  --navy: #0A1628;
  --navy-light: #121F33;
  --lime: #C8FF00;
  --lime-dark: #A8D800;
  --white: #FFFFFF;
  --bg: #F0F2F5;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --muted: #6B7280;
  --border: #E2E5EB;
  --positive: #22C55E;
  --neutral: #F59E0B;
  --negative: #EF4444;
  --delta-up: #16A34A;
  --delta-down: #DC2626;
}

* { box-sizing: border-box; }

/* Read-only mode: hide any element marked as write-action */
body.is-readonly [data-write] { display: none !important; }
.readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #E0E7FF;
  color: #3730A3;
  margin-right: 4px;
}

body {
  background: var(--bg);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  margin: 0;
}

/* ── NAVBAR ── */
.top-nav {
  background: var(--navy);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 24px 10px;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 48px;
  padding: 4px 0;
  flex-shrink: 0;
}
.logo img {
  height: 36px;
  width: auto;
  image-rendering: auto;
}
.logo-text {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--white);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.logo-text .accent {
  color: var(--lime);
}
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger:hover,
.nav-burger:focus-visible {
  background: rgba(255,255,255,0.08);
  outline: none;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-right a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-right a:hover { color: var(--white); }

/* ── TICKER ── */
.ticker {
  background: var(--lime);
  overflow: hidden;
  white-space: nowrap;
  height: 32px;
  display: flex;
  align-items: center;
}
.ticker-inner {
  display: inline-block;
  animation: ticker 20s linear infinite;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--navy);
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── PAGE LAYOUT ── */
.page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-width: 0;
  overflow-x: hidden;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}
.page-header .subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ── BUTTONS ── */
.btn-blue {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-blue:hover { background: var(--blue-dark); color: var(--white); }

.btn-lime {
  background: var(--lime);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-lime:hover { background: var(--lime-dark); color: var(--navy); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 6px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost:disabled { opacity: 0.45; cursor: default; }
.btn-ghost:disabled:hover { border-color: var(--border); color: var(--text); }

/* ── CARDS ── */
.project-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  transition: all 0.2s;
  overflow: hidden;
}
.project-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 30px rgba(0,85,255,0.1);
  transform: translateY(-3px);
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-head h3 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 6px 0;
  text-transform: uppercase;
}
.card-body-inner {
  padding: 20px;
}

/* ── AI BADGES ── */
.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* Класс = ключ канала. Цвета — по таблице заказчика 06.10.2026: родственные
   каналы (API / A-Parser / браузер) одного цвета. Те же HEX — PROV_COLORS в
   static/js/providers.js (легенды и графики): правишь здесь — правь и там. */
.ai-tag.chatgpt,
.ai-tag.chatgpt_aparser,
.ai-tag.chatgpt_browser { background: #1F1F1F; color: #fff; }
.ai-tag.deepseek,
.ai-tag.deepseek_browser { background: #4D6BFE; color: #fff; }
.ai-tag.perplexity,
.ai-tag.perplexity_aparser,
.ai-tag.perplexity_browser { background: #20808D; color: #fff; }
.ai-tag.yandex,
.ai-tag.yandex_alice_aparser { background: #FF0000; color: #fff; }
.ai-tag.yandex_async,
.ai-tag.yandex_alice { background: #6C4DFF; color: #fff; }
.ai-tag.google,
.ai-tag.googleai_aparser,
.ai-tag.gemini_browser { background: #5267E8; color: #fff; }
.ai-tag.google_ai_aparser { background: #4285F4; color: #fff; }
.ai-tag.claude { background: #D97757; color: #fff; }
.ai-tag.gigachat,
.ai-tag.gigachat_browser { background: #21A038; color: #fff; }

/* ── DONUT ── */
.donut-wrap {
  position: relative;
  width: 110px;
  height: 110px;
}
.donut-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-label .pct {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
}
.donut-label .delta {
  font-size: 0.7rem;
  font-weight: 700;
}

/* ── STATS ── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid #f3f4f6;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); font-weight: 500; }
.stat-value { font-weight: 700; }
.delta-up { color: var(--delta-up); font-weight: 700; }
.delta-down { color: var(--delta-down); font-weight: 700; }
.delta-none { color: #bbb; }

/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── SUMMARY CARD ── */
.summary-metrics-top,
.summary-metrics-bottom {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
}
/* Три KPI всегда в ряд: minmax(0,1fr) даёт колонке сжаться. Bootstrap col-md-4
   этого не умел — flex-shrink:0, карточка уезжала за край окна. */
.summary-metrics-top {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.summary-metrics-bottom {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.summary-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
}
.summary-card-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.summary-card-value {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}
.summary-card-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 6px;
}
.summary-donut {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  position: relative;
}
.summary-donut-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.summary-donut-label #sumPct {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  white-space: nowrap;
}
.rank-meter {
  height: 6px;
  border-radius: 3px;
  background: #E5E7EB;
  margin-top: 12px;
  overflow: hidden;
}
.rank-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent, #0055FF);
  transition: width .35s ease, background .35s ease;
}

/* ── CHART CONTAINER ── */
.chart-box {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 100%;
  min-width: 0;
}
.chart-box canvas {
  max-width: 100%;
}
/* Высота графика видимости. maintainAspectRatio:false в dashboard.html отдал
   высоту сюда, поэтому цифра здесь = то, что видит пользователь.
   На ДЕСКТОПЕ держим ~прежние 300px: до 6197 у canvas стоял height="75" без
   width, Chart.js брал из атрибутов пропорцию 4:1 и на ширине ~1200 рисовал
   ~300px. Ветка поставила 66vh глобально — на мониторе это 600-760px, график
   съедал первый экран дашборда, хотя правка задумывалась как мобильная.
   66vh остаётся ниже 991.98px, где он и нужен: там ширина мала и столбикам
   иначе тесно. */
.chart-vis-canvas {
  position: relative;
  width: 100%;
  height: 300px;
  min-height: 260px;
}
.chart-sources-canvas {
  position: relative;
  width: 100%;
  min-height: 220px;
  height: 280px;
  overflow: hidden;
}

/* Компактный фильтр групп: вместо высокого <select multiple> */
.mentions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mentions-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.group-filter {
  position: relative;
  min-width: 0;
}
.group-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  min-height: 34px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.group-filter-btn:hover,
.group-filter-btn:focus-visible {
  border-color: var(--blue);
  outline: none;
}
.group-filter-btn .gf-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.filter-bar .group-filter-btn { max-width: min(420px, 100%); }
.filter-bar .group-filter-pop { left: 0; right: auto; }
.filter-bar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.group-filter-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 240px;
  max-width: min(360px, 92vw);
  max-height: min(280px, 50vh);
  overflow-y: auto;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(10, 22, 40, 0.12);
}
.group-filter-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  margin: 0;
}
.group-filter-item:hover { background: #F3F5F8; }
.group-filter-item input { margin-top: 2px; flex-shrink: 0; }
/* Оверлей «Загрузка…» на таблице упоминаний при смене фильтра групп:
   без него кажется, что чекбокс ничего не делает, пока едет /dashboard. */
#mentionsTableBox { position: relative; }
.mentions-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}
.mentions-loading[hidden] { display: none !important; }
.group-filter-btn.is-loading .bi-collection { display: none; }
.group-filter-btn .gf-spinner {
  width: 0.85rem;
  height: 0.85rem;
  border-width: 2px;
  color: var(--blue);
  flex-shrink: 0;
}
.group-filter-empty {
  padding: 10px 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── VISIBILITY BAR ── */
.vis-bar {
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}
.vis-bar .seg-pos { background: var(--positive); }
.vis-bar .seg-neu { background: var(--neutral); }
.vis-bar .seg-neg { background: var(--negative); }

/* ── COMP TABLE ── */
.comp-cell {
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  padding: 5px 8px !important;
  border-radius: 4px;
  display: inline-block;
  min-width: 48px;
}
.comp-top  { background: #86EFAC; color: #14532D; }
.comp-high { background: #DCFCE7; color: #166534; }
.comp-mid  { background: #FEF9C3; color: #854D0E; }
.comp-low  { background: #FFF1F2; color: #9F1239; }
.comp-zero { background: #F3F4F6; color: #6B7280; }

/* ── ДИНАМИКА ПО ДВУМ СЪЁМАМ ──
   Дельта живёт ПОД процентом в той же ячейке: отдельная колонка на каждый канал
   удваивала бы таблицу, а каналов бывает 16. Цвет — буквально по ТЗ: рост
   зелёный, падение красное, и у своего бренда, и у конкурентов (delta-up /
   delta-down выше в этом же файле). Прочерк (delta-none) означает не «ноль», а
   «сравнивать нечем» — этот съём/канал/конкурент тогда не считался. */
.comp-delta {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}
/* Панель выбора даты и сравнения — одна и та же на дашборде и в полном отчёте. */
.dyn-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.date-select {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fff;
  color: var(--navy);
  max-width: 280px;
}
.date-select:focus { border-color: var(--blue); outline: none; box-shadow: none; }
.date-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Календарь периода (Метрика / GA): кнопка + попап, дни со съёмами — точка. */
.period-wrap { position: relative; }
.period-btn {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fff;
  color: var(--navy);
  min-width: 196px;
  text-align: left;
  cursor: pointer;
}
.period-btn:hover, .period-btn:focus { border-color: var(--blue); outline: none; }
.period-btn.is-set { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.period-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.period-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 10px;
  box-shadow: 0 10px 28px rgba(10, 22, 40, 0.12);
  min-width: 268px;
}
.period-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.period-month {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy);
  text-transform: capitalize;
}
.period-nav-btn {
  width: 28px; height: 28px;
  border: 0; background: #F3F5F8;
  border-radius: 8px;
  font-size: 1.1rem; line-height: 1;
  color: var(--navy); cursor: pointer;
}
.period-nav-btn:hover { background: var(--blue-light); color: var(--blue); }
.period-wd {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.period-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.period-day {
  position: relative;
  width: 32px; height: 32px;
  border: 0; background: transparent;
  border-radius: 8px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--navy); cursor: pointer;
  margin: 0 auto;
}
.period-day:hover:not(:disabled) { background: #EEF3FF; }
.period-day.is-empty { cursor: default; visibility: hidden; }
.period-day.has-scan::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 3px;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--lime, #C8FF00);
  box-shadow: 0 0 0 1px #0A1628;
}
.period-day.in-range { background: #E8F0FF; }
.period-day.is-edge {
  background: var(--blue);
  color: #fff;
}
.period-day.is-edge.has-scan::after { background: #fff; box-shadow: none; }
.period-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #EEF1F5;
}
.period-hint { font-size: 0.68rem; color: var(--muted); }
.period-clear {
  border: 0; background: transparent;
  font-size: 0.72rem; font-weight: 700;
  color: var(--blue); cursor: pointer;
  padding: 0;
}
.period-clear:hover { text-decoration: underline; }
.period-day.has-multi { font-weight: 800; }
.period-day-n {
  position: absolute;
  top: 1px; right: 1px;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  color: var(--blue);
  background: #fff;
  border-radius: 4px;
  padding: 0 2px;
}
.period-day.is-edge .period-day-n { color: #fff; background: transparent; }
.period-scan-panel { min-width: 240px; }
.period-scan-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.period-scan-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.period-scan-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.period-scan-item:hover { border-color: var(--blue); background: var(--blue-light); }
.period-scan-item.period-scan-avg { border-color: var(--blue); color: var(--blue); }
.period-scan-back {
  margin-top: 8px;
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.period-scan-back:hover { color: var(--blue); }
.period-avg-mark {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: none;
  letter-spacing: 0;
}
.dyn-note {
  font-size: 0.75rem;
  color: #854D0E;
  background: #FEF9C3;
  border: 2px solid #FDE68A;
  border-radius: 10px;
  padding: 7px 11px;
}

/* ── СРЕЗЫ КОНКУРЕНТОВ: мои / найденные в ответах / сводная ──
   Живут в общем файле, а не в <style> страницы: одни и те же вкладки нужны и на
   дашборде, и на странице полного отчёта. Три кнопки всегда в один ряд:
   длинный текст («Найденные в ответах») переносится на 2 строки. */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mode-tab {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  border-radius: 12px;
  cursor: pointer;
  background: var(--white);
  border: 2px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s;
  text-align: left;
  white-space: nowrap;
  line-height: 1.2;
  min-width: 0;
}
.mode-tab:hover { border-color: var(--blue); color: var(--blue); }
.mode-tab.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.mode-tab > i { flex-shrink: 0; }
.mode-tab > span[data-i18n] {
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
}
.mode-tab .tab-count {
  display: inline-block;
  flex-shrink: 0;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 20px;
  background: #F3F4F6;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}
.mode-tab.active .tab-count { background: rgba(255, 255, 255, 0.22); color: var(--white); }

/* Таблица / Динамика — две вкладки, не три колонки mode-tabs */
.report-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.report-view-tabs .mode-tab {
  justify-content: center;
  white-space: nowrap;
}

/* Динамика брендов: история метрик по съёмам (полный отчёт) */
.dyn-panel { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.dyn-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.dyn-panel-brands {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.dyn-brand-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.dyn-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  border: 2px solid var(--border);
  background: #fff;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
  max-width: 100%;
}
.dyn-brand-chip:hover { border-color: var(--blue); }
.dyn-brand-chip.active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.dyn-brand-chip.own.active {
  border-color: #F59E0B;
  background: #FFFBEB;
  color: #92400E;
}
.dyn-brand-chip.disc.active {
  border-color: #7C3AED;
  background: #F5F3FF;
  color: #5B21B6;
}
.dyn-brand-chip input { margin: 0; flex-shrink: 0; }
.dyn-brand-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dyn-metric-tabs { margin-bottom: 12px; }
.dyn-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.chart-box-dyn { padding: 16px 14px 14px; }
.dyn-chart-wrap {
  position: relative;
  height: 320px;
  min-width: 0;
}
.dyn-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 24px 12px;
}
.dyn-empty i { font-size: 1.6rem; opacity: 0.45; }
.filter-bar .group-filter-pop { left: 0; right: auto; }

.comp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.comp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.comp-toolbar-checks,
.comp-toolbar-btns {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.comp-toolbar-checks label,
.comp-toolbar-btns .btn-ghost,
.comp-toolbar-checks span,
.comp-toolbar-btns span {
  white-space: nowrap;
}

/* Откуда взялась строка таблицы: свой список, анализ ответов или оба */
.src-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.src-own  { background: var(--blue-light); color: var(--blue); }
.src-disc { background: #F3E8FF; color: #6B21A8; }
.src-both { background: #DCFCE7; color: #166534; }

/* Иконки-действия в строке таблицы (скрыть бренд, перенести в конкурентов) */
.row-act {
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}
.row-act:hover { background: #F3F4F6; color: var(--blue); }
.row-act:disabled { opacity: 0.4; cursor: default; }

/* ── PROMPT TABLE ── */
.mention-yes { color: var(--positive); font-size: 1.1rem; }
.mention-no  { color: #D1D5DB; font-size: 1.1rem; }

/* ── DATE BADGE ── */
.date-badge {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}
/* Дашборд: каналы строкой, группа отдельной строкой под ними (6290). Модификатор,
   а не правка базового .filter-bar: тот же класс стоит на полном отчёте
   конкурентов, и column там ставил поиск, каналы и чекбоксы столбиком. */
.filter-bar.filter-bar-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

/* Сортируемый заголовок таблицы (бренды, источники): по убыванию, активный — синий. */
th.comp-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.comp-sort:hover { color: var(--navy); }
th.comp-sort .comp-sort-ic { font-size: 0.55rem; margin-left: 3px; opacity: 0.25; vertical-align: middle; }
th.comp-sort.active { color: var(--blue) !important; }
th.comp-sort.active .comp-sort-ic { opacity: 1; }

/* «Источники»: фильтр по бренду в ответе и по тексту домена/URL. */
.src-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.src-filters .src-filter-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.src-filters .src-filter-label {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  margin: 0;
}
.src-filters .date-select { min-height: 36px; }
.src-filters .src-text-input {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.78rem;
  min-height: 36px;
  width: 260px;
  max-width: 100%;
}
.src-filters .src-text-input:focus { border-color: var(--blue); outline: none; }
.src-filters .src-filter-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
@media (max-width: 767.98px) {
  .src-filters .src-filter-sep { display: none; }
  .src-filters .src-filter-cell { flex: 1 1 100%; }
  .src-filters .date-select { max-width: none; flex: 1 1 auto; min-height: 44px; }
  .src-filters .src-text-input { width: auto; flex: 1 1 auto; min-height: 44px; }
}
#providerTags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
#providerTags .ai-tag {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ── BREADCRUMB ── */
.breadcrumb-custom {
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.breadcrumb-custom a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb-custom span { color: var(--muted); }

/* ── WIZARD STEP CIRCLE ── */
.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  margin: 0 auto 4px;
  transition: all 0.2s;
}
.step-circle.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.step-circle.done {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--navy);
}

/* ── LANGUAGE FOOTER ── */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: #0A1628;
  padding: 7px 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.lang-switch { display: flex; align-items: center; gap: 4px; }
.lang-sep { color: #3d4f6a; font-size: 0.7rem; }
.lang-btn {
  background: none;
  border: none;
  color: #9fb3d0;
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.6px;
  cursor: pointer;
  padding: 2px 7px;
}
.lang-btn:hover { color: #fff; }
.lang-btn.active { color: #C8FF00; }
body { padding-bottom: 40px; }

/* ── DASHBOARD: фильтр каналов ── */
#providerTags .ai-tag {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, filter 0.15s ease;
}
#providerTags .ai-tag.off {
  opacity: 0.38;
  filter: grayscale(0.55);
}
#providerTags .ai-tag.off .bi-check-lg { visibility: hidden; }

/* ── Таблицы конкурентов: фиксированная ширина колонок каналов ── */
.comp-table th.prov-col,
.comp-table td.prov-col {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-table th.metric-col,
.comp-table td.metric-col {
  width: 58px;
  min-width: 58px;
  text-align: center;
}

/* ── Список проектов: папки-аккордеон ── */
.projects-folder-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.folder-block { margin-bottom: 32px; }
.folder-block:last-child { margin-bottom: 0; }
.folder-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.folder-head:hover { background: #F8F9FB; }
.folder-head.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.folder-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--navy);
}
.folder-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.folder-body {
  display: none;
  background: #EEF2F7;
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  padding: 18px 16px 8px;
}
.folder-body.open { display: block; }
.folder-body .row { --bs-gutter-y: 1rem; }

/* ── RESPONSIVE ── */
@media (max-width: 991.98px) {
  .top-nav {
    padding: calc(22px + env(safe-area-inset-top, 0px)) 14px 12px;
    min-height: calc(78px + env(safe-area-inset-top, 0px));
  }
  .logo { min-height: 56px; }
  .logo img { height: 42px; }
  .logo-text { font-size: 1.12rem; }
  .nav-burger { display: flex; }
  .nav-right {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy);
    padding: 6px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 12px 24px rgba(10, 22, 40, 0.28);
  }
  .top-nav.is-open .nav-right { display: flex; }
  .nav-right a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 10px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-right a:last-child { border-bottom: none; }
  .page-wrap { padding: 16px 12px; }
  .page-header { flex-direction: column; }
  .page-header h1 { font-size: 1.2rem; }
  .group-filter-btn { max-width: 100%; width: 100%; }
  .group-filter { width: 100%; }
  .mentions-toolbar-actions { width: 100%; }
  .mentions-toolbar-actions .input-group { max-width: none !important; flex: 1 1 160px; }
  .group-filter-pop { left: 0; right: 0; max-width: none; }
  .filter-bar .group-filter { flex: 1 1 100%; }
  .filter-bar .group-filter-btn { max-width: none; width: 100%; }
  .dyn-toolbar { flex-direction: column; align-items: stretch; }
  .dyn-toolbar .group-filter { width: 100%; }
  .dyn-metric-tabs .mode-tab {
    font-size: 0.68rem;
    padding: 8px 4px;
    gap: 3px;
  }
  .dyn-chart-wrap { height: min(56vh, 320px); min-height: 220px; }
  .chart-box-dyn { padding: 12px 10px 10px; }
  .comp-search { width: 100%; max-width: none; }
  .chart-vis-canvas { height: 66vh; min-height: 280px; }
  .chart-sources-canvas { min-height: 260px; height: 300px; }
  .comp-head { align-items: stretch; }
  .comp-head .section-title { width: 100%; }
  .comp-toolbar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .comp-toolbar-checks,
  .comp-toolbar-btns { width: 100%; }
  .summary-card { padding: 16px 8px 12px; }
  .summary-card-label {
    letter-spacing: 0.2px;
    font-size: 0.6rem;
    line-height: 1.2;
    white-space: normal;
    margin-bottom: 6px;
  }
  .summary-card-value { font-size: 1.25rem; }
  .summary-donut { width: 72px; height: 72px; }
  .summary-donut canvas { width: 72px !important; height: 72px !important; }
  .summary-donut-label #sumPct { font-size: 1.05rem; }
  .summary-metrics-top,
  .summary-metrics-bottom { gap: 8px; }
}
@media (max-width: 560px) {
  .summary-card-sub { display: none; }
  .summary-metrics-bottom {
    grid-template-columns: 1fr;
  }
}

/* ── Карточки ответов LLM (модалка дашборда и отчёт «Упоминания по промптам»,
   разметка — static/js/responses-view.js) ── */
.resp-card {
  border-bottom: 1px solid #F0F2F5;
  padding: 18px 24px;
}
.resp-card:last-child { border-bottom: none; }
.resp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.resp-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.resp-badge.mentioned   { background: #DCFCE7; color: #166534; }
.resp-badge.unmentioned { background: #F3F4F6; color: #6B7280; }
.resp-badge.no-answer   { background: #FEF3C7; color: #92400E; }
.resp-badge.positive    { background: #DCFCE7; color: #166534; }
.resp-badge.neutral     { background: #FEF3C7; color: #92400E; }
.resp-badge.negative    { background: #FEE2E2; color: #991B1B; }
.resp-text {
  background: #F8F9FB;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1A1A2E;
  max-height: 400px;
  overflow-y: auto;
}
.resp-sources {
  margin-top: 10px;
  font-size: 0.76rem;
  color: #6B7280;
}
.resp-sources a {
  color: #0055FF;
  text-decoration: none;
  margin-right: 8px;
}
.resp-sources a:hover { text-decoration: underline; }
