/* Контраст монохромных значков в тёмной теме. Цветные знаки не перекрашиваем. */
:root[data-theme="dark"] img:is([src$="/models/chatgpt.svg"],[src$="/models/gigachat.svg"],[src$="/models/perplexity.svg"]),
:root[data-theme="dark"] img[src*="/cjm/"] {
  filter: brightness(0) invert(1);
}

/* Фон расположен на самом изображении: фильтр инвертировал бы его вместе со знаком. */
:root[data-theme="dark"] .cjm-analytics .cjm-stage-top img[src*="/cjm/"] {
  background: #e8eeff;
  filter: none;
}
:root[data-theme="dark"] .model-matrix-controls button[aria-pressed="true"] {
  color: #132243;
}
:root[data-theme="dark"] .model-matrix-controls button[aria-pressed="true"] img[src*="/cjm/"] {
  filter: none;
}

/* Чёрные логотипы остаются чёрными на светлой подложке. */
:root[data-theme="dark"] img:is([src$="/brands/glavstroy.png"],[src$="/brands/pioneer.png"],[src$="/brands/thelocals.png"]) {
  background: #fff;
  border-radius: 4px;
}
:root[data-theme="dark"] img[src$="/brands/domclick.svg"] {
  background: #fff;
  border-radius: 4px;
}
:root[data-theme="dark"] :is(.market-logo,.direction-brand-icon):has(> img[src$="/brands/domclick.svg"]) {
  background: #fff;
  border-radius: 4px;
}

/* Оригинальные цвета Циан и Суточно.ру на синих карточках. */
:is(#niche-overview,#new-overview,#new-overview-v13,#secondary-overview,#long04-overview,#a03s-overview) .direction-brand-icon:has(> img:is(.brand-cian,.brand-sutochno)) {
  background: #fff;
  border-radius: 6px;
}
:is(#niche-overview,#new-overview,#new-overview-v13,#secondary-overview,#long04-overview,#a03s-overview) .direction-brand-icon img:is(.brand-cian,.brand-sutochno) {
  filter: none;
}
:is(#niche-overview,#new-overview,#new-overview-v13,#secondary-overview,#long04-overview,#a03s-overview) .direction-tiles article:first-child .direction-brand-icon img:is(.brand-cian,.brand-sutochno) {
  filter: none;
}

/* На синей карточке знак ЦИАН остаётся белым и без подложки. */
:is(#new-overview-v13,#secondary-overview,#long04-overview,#a03s-overview) .direction-tiles article:first-child .direction-brand-icon:has(> img.brand-cian) {
  background: transparent;
}
:is(#new-overview-v13,#secondary-overview,#long04-overview,#a03s-overview) .direction-tiles article:first-child .direction-brand-icon img.brand-cian {
  filter: brightness(0) invert(1);
}
