/* Ниши для игр — раскладка; без своей палитры (tokens + components) */

.tool-stage--game-niches {
  width: min(1100px, 100%);
}

.tool-stage--game-niches .chip.is-active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* Вкладки — сегментированный блок */
.niches-work .niches-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border-radius: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.niches-work .niches-tabs .chip {
  flex: 1 1 auto;
  min-width: 5.5rem;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  font-weight: 500;
  transition:
    background var(--dur-fast),
    color var(--dur-fast),
    box-shadow var(--dur-fast);
}

.niches-work .niches-tabs .chip.is-active {
  background: var(--surface);
  box-shadow: none;
}

.niches-work .niches-tabs .chip[data-tab="pick"].is-active {
  color: var(--accent-hover);
}

.niches-steps--compact {
  margin-bottom: 0.65rem;
}

.niches-intro {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.niches-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.niches-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.niches-meta--err {
  color: var(--danger);
}

.niches-cooldown {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.niches-cooldown--busy {
  color: var(--text-muted);
}

.niches-cooldown--wait {
  color: var(--text-muted);
}

.niches-cooldown--continue {
  color: var(--warning);
  font-weight: 600;
}

.niches-cooldown--ready {
  color: var(--accent-hover);
  font-weight: 600;
}

.niches-collector-hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.niches-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 300px);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .niches-layout {
    grid-template-columns: 1fr;
  }
}

.niches-work .chip-row {
  margin-bottom: 0.85rem;
}

.niches-work__body {
  min-width: 0;
}

.niches-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.niches-table-wrap {
  overflow: auto;
  max-height: min(52vh, 420px);
  margin: 0.35rem 0;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
  scrollbar-gutter: stable;
}

.niches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.niches-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-active);
  box-shadow: none;
}

.niches-table th {
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.niches-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.niches-table th:nth-child(n + 2),
.niches-table td:nth-child(n + 2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.niches-table tbody tr {
  cursor: pointer;
  transition: background var(--dur-fast);
}

.niches-table tbody tr:hover,
.niches-table tbody tr.niches-row--active {
  background: var(--accent-soft);
}

.niches-table tbody tr.niches-row--active {
  box-shadow: none;
}

.niches-heat {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.niches-games-panel {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
}

.niches-games-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.niches-games-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.niches-game-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.niches-game-row:last-child {
  border-bottom: none;
}

.niches-game-row a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.niches-game-row a:hover {
  color: var(--accent-hover);
}

.niches-muted {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.niches-subhead {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.niches-idea-result {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.niches-idea-result:empty {
  display: none;
}

.niches-score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-score-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.niches-score-value {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.niches-tag-details,
.niches-checklist ul {
  margin: 0.2rem 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.niches-fav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.niches-fav-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
  transition:
    border-color var(--dur-fast),
    background var(--dur-fast);
}

.niches-fav-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.niches-fav-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.niches-desktop-promo {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0;
  border: 1px solid color-mix(in srgb, var(--accent, #94a3b8) 35%, var(--border));
  background: color-mix(in srgb, var(--accent, #94a3b8) 12%, var(--surface-raised, #0d1117));
}

.niches-desktop-promo__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted, var(--text));
}

.niches-desktop-promo__name {
  font-weight: 600;
  color: var(--accent-hover, var(--accent));
}

.niches-desktop-promo__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.niches-desktop-promo__btn {
  text-decoration: none;
}

.niches-desktop-promo__hint {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.niches-disclaimer {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-faint);
}

.niches-idea-card textarea {
  min-height: 5.5rem;
}

.niches-fit-value {
  color: var(--accent-hover);
  font-variant-numeric: tabular-nums;
}

.niches-verdict {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.niches-verdict--recommend {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.niches-verdict--caution {
  color: var(--warning);
  background: rgba(108, 182, 255, 0.1);
  border: 1px solid rgba(108, 182, 255, 0.25);
}

.niches-verdict--avoid {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-pick-why {
  margin: 0.5rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
}

/* ——— Подбор v3: hero + карточки ——— */
.niches-pick-hero {
  margin: 0 0 1rem;
  padding: 0 0 0.15rem;
}

.niches-pick-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

.niches-pick-hero__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.niches-pick-hero__lead {
  margin: 0;
  max-width: 36rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.niches-callout {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0;
  border: 1px solid var(--accent-border);
  background: linear-gradient(
    135deg,
    var(--accent-soft) 0%,
    transparent 70%
  );
}

.niches-callout__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.niches-callout__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.niches-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.niches-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-pill--accent {
  color: var(--accent-hover);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.niches-pill--fill {
  color: var(--text);
  border-color: var(--border-strong, var(--border));
}

.niches-snapshot-status {
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  max-width: 52rem;
}

.niches-recalc-banner {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.875rem;
  font-weight: 600;
  animation: niches-card-in 0.35s ease;
}

.niches-idea-cluster {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
}

.niches-idea-cluster__title {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.niches-idea-cluster__best {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
}

.niches-idea-cluster__why {
  margin: 0 0 0.5rem;
}

.niches-idea-cluster__alts {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.niches-fav-outcomes {
  margin: 0.5rem 0;
}

.niches-fav-outcomes .chip {
  font-size: 0.6875rem;
}

.niches-empty {
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
}

.niches-empty__icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.niches-empty__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.niches-empty__text {
  margin: 0 auto;
  max-width: 22rem;
}

.niches-entry-grid {
  display: grid;
  gap: 1rem;
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .niches-entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .niches-entry-card:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .niches-entry-grid {
    gap: 1.1rem;
  }
}

@keyframes niches-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.niches-entry-card {
  --entry-accent: var(--accent);
  position: relative;
  padding: 1.1rem 1.15rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
  animation: niches-card-in 0.45s ease backwards;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-fast),
    transform var(--dur-fast);
}

.niches-entry-card:nth-child(1) { animation-delay: 0.03s; }
.niches-entry-card:nth-child(2) { animation-delay: 0.08s; }
.niches-entry-card:nth-child(3) { animation-delay: 0.13s; }
.niches-entry-card:nth-child(4) { animation-delay: 0.18s; }
.niches-entry-card:nth-child(5) { animation-delay: 0.23s; }

.niches-entry-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--entry-accent);
  opacity: 0.85;
}

.niches-entry-card:hover {
  border-color: var(--accent-border);
  box-shadow: none;
  transform: translateY(-2px);
}

.niches-entry-card[data-cluster="io-arcade"] { --entry-accent: #94a3b8; }
.niches-entry-card[data-cluster="puzzle-merge"] { --entry-accent: #94a3b8; }
.niches-entry-card[data-cluster="action-casual"] { --entry-accent: #e94142; }
.niches-entry-card[data-cluster="light-sim"] { --entry-accent: #5ba32b; }
.niches-entry-card[data-cluster="party-lite"] { --entry-accent: #94a3b8; }

.niches-entry-card--hit-strong { --entry-accent: var(--accent-hover); }
.niches-entry-card--hit-moderate { --entry-accent: #94a3b8; }
.niches-entry-card--hit-weak { --entry-accent: var(--text-faint); }

.niches-entry-card__score--hit .niches-entry-card__score-value {
  font-size: 2rem;
  color: var(--entry-accent);
}

.niches-hit-meter__fill--strong {
  background: linear-gradient(90deg, var(--accent), var(--entry-accent));
}

.niches-hit-meter__fill--moderate {
  background: linear-gradient(90deg, var(--warning), #94a3b8);
}

.niches-hit-meter__fill--weak {
  background: var(--border-strong, var(--border));
}

.niches-entry-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.niches-hit-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.niches-hit-chip--strong {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.niches-hit-chip--moderate {
  color: var(--warning);
  background: rgba(108, 182, 255, 0.1);
  border: 1px solid rgba(108, 182, 255, 0.25);
}

.niches-hit-chip--weak {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-entry-card__subscore,
.niches-entry-card__proof {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.niches-entry-card__proof {
  color: var(--accent-hover);
  font-weight: 500;
}

.niches-how-hit {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
}

.niches-how-hit__summary {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.niches-how-hit__body {
  padding: 0 0.75rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.niches-how-hit__list {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.niches-how-hit__note {
  margin: 0;
}

.niches-pill--conf-высокая,
.niches-pill--conf-high {
  border-color: var(--accent-border);
  color: var(--accent-hover);
}

.niches-pill--conf-средняя {
  border-color: rgba(108, 182, 255, 0.35);
  color: var(--warning);
}

.niches-pill--conf-низкая {
  color: var(--text-faint);
}

.niches-hit-factors {
  padding: 0.55rem 0.6rem;
  border-radius: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-hit-factors__title {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.niches-hit-factor + .niches-hit-factor {
  margin-top: 0.4rem;
}

.niches-hit-factor__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.niches-hit-factor__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-hover);
}

.niches-hit-factor__bar {
  height: 4px;
  border-radius: 0;
  background: var(--surface);
  overflow: hidden;
}

.niches-hit-factor__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0;
}

.niches-hit-factor__detail {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: var(--text-faint);
  line-height: 1.35;
}

.niches-entry-tags {
  margin-top: 0.15rem;
}

.niches-entry-tags__title {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.niches-entry-tags__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.niches-entry-tags__item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
}

.niches-entry-tags__name {
  font-weight: 600;
}

.niches-entry-tags__nums {
  font-size: 0.6875rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.niches-entry-card__top {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.5rem 0.65rem;
  align-items: start;
}

.niches-entry-card__rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-entry-card:first-child .niches-entry-card__rank {
  color: var(--accent-hover);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.niches-entry-card__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.niches-entry-card__titles {
  min-width: 0;
}

.niches-entry-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
}

.niches-entry-card__tagline {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.niches-entry-card__score {
  text-align: right;
  line-height: 1.1;
}

.niches-entry-card__score-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--entry-accent);
}

.niches-entry-card__score-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.niches-zalet-meter {
  height: 6px;
  border-radius: 0;
  background: var(--bg-elevated);
  overflow: hidden;
}

.niches-zalet-meter__fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.6s ease;
}

.niches-zalet-meter__fill--hot {
  background: linear-gradient(90deg, var(--accent), var(--entry-accent));
}

.niches-zalet-meter__fill--maybe {
  background: linear-gradient(90deg, var(--warning), #94a3b8);
}

.niches-zalet-meter__fill--cold {
  background: var(--border-strong, var(--border));
}

/* Советы (баннеры как на макете) */
.niches-tip-banner {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #94a3b8;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface, #262c36) 92%, #0d1117 8%);
  border: 1px solid rgba(108, 182, 255, 0.38);
}

.niches-tip-banner__icon {
  flex-shrink: 0;
  line-height: 1.2;
  opacity: 0.95;
}

.niches-tip-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.niches-platform-tips {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0;
  border: 1px solid color-mix(in srgb, #94a3b8 22%, var(--border));
  background: color-mix(in srgb, var(--bg-elevated, #1c2128) 88%, #0d1117 12%);
}

.niches-platform-tips__title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint, var(--text-muted));
}

.niches-entry-card__why {
  margin: 0;
  padding: 0 0 0 1.15rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.niches-entry-card__why li + li {
  margin-top: 0.25rem;
}

.niches-entry-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
}

.niches-zalet-chip {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.niches-zalet-chip--hot {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.niches-zalet-chip--maybe {
  color: var(--warning);
  background: rgba(108, 182, 255, 0.1);
  border: 1px solid rgba(108, 182, 255, 0.25);
}

.niches-zalet-chip--cold {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-entry-card__fit {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.niches-entry-card__examples-label {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.niches-entry-examples {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.niches-entry-examples__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.niches-entry-examples__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.niches-entry-examples__link:hover {
  color: var(--accent-hover);
}

.niches-entry-examples__meta {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.niches-entry-examples__tag {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-style: italic;
}

.niches-entry-card__no-examples {
  margin: 0;
  font-size: 0.8125rem;
}

.niches-entry-card__actions {
  margin-top: 0.15rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.niches-entry-card__actions .btn {
  flex: 1 1 auto;
  min-width: 8rem;
}

/* Разведка */
.niches-recon-head {
  margin: 0 0 0.75rem;
}

.niches-recon-head__title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.niches-recon-head__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.niches-recon-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.niches-recon-toolbar .chip-row {
  margin-bottom: 0;
}

.niches-cluster-note {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0;
  font-size: 0.8125rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text-muted);
}

.niches-search-field {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color var(--dur-fast);
}

.niches-search-field:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.niches-search-field::placeholder {
  color: var(--text-faint);
}

.niches-table--recon .niches-table td:nth-child(3),
.niches-table--recon .niches-table th:nth-child(3) {
  text-align: left;
}

.niches-table--recon td strong {
  color: var(--accent-hover);
}

@media (prefers-reduced-motion: reduce) {
  .niches-entry-card {
    animation: none;
    transition: none;
  }

  .niches-entry-card:hover {
    transform: none;
  }
}

.btn--sm {
  padding: 0.28rem 0.6rem;
  font-size: 0.75rem;
  min-height: 0;
}

@media (min-width: 901px) {
  .niches-idea-card {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100dvh - 6rem);
    overflow: auto;
  }
}

/* Мастер выбора ниши */
body.niches-wizard-open {
  overflow: hidden;
}

.niches-wizard__backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 5, 5, 0.55);
}

.niches-wizard__backdrop[hidden] {
  display: none;
}

.niches-wizard__panel {
  width: min(640px, 100%);
  max-height: min(90dvh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.niches-wizard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.niches-wizard__heading {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

.niches-wizard__step-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-faint);
  width: 100%;
}

.niches-wizard__close {
  margin-left: auto;
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
}

.niches-wizard__title {
  margin: 0;
  font-size: 1rem;
}

.niches-wizard__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.niches-wizard__chips {
  margin-bottom: 0.65rem;
}

.niches-wizard__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.niches-wizard__foot .btn--primary {
  margin-left: auto;
}

.niches-wizard-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.niches-wizard-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.65rem;
  align-items: start;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition:
    border-color var(--dur-fast),
    background var(--dur-fast);
}

.niches-wizard-card:hover,
.niches-wizard-card--on {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.niches-wizard-card__fit {
  grid-row: 1 / span 2;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-hover);
  font-variant-numeric: tabular-nums;
}

.niches-wizard-card__tag {
  font-weight: 600;
}

.niches-wizard-card__why {
  grid-column: 2 / span 2;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.niches-stale-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0;
  border: 1px solid rgba(108, 182, 255, 0.35);
  background: rgba(108, 182, 255, 0.08);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--warning);
}

.niches-trend-hint {
  margin: 0 0 0.5rem;
}

.niches-delta {
  font-size: 0.6875rem;
  line-height: 1.35;
  white-space: nowrap;
}

.niches-delta--up {
  color: var(--accent-hover);
}

.niches-delta--down {
  color: var(--danger);
}

.niches-delta--flat {
  color: var(--text-faint);
}

.niches-ga-panel {
  margin: 0 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-elevated);
}

.niches-ga-panel__summary {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
}

.niches-ga-panel__body {
  padding: 0 0.75rem 0.75rem;
}

.niches-table-wrap--ga {
  max-height: 220px;
}

/* --- Тренды ниш --- */
.trends { display: grid; gap: 0.9rem; }

.trends__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.trends__title { margin: 0; font-size: 1.05rem; font-weight: 700; }

.trends__collect {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

.trends__collect:disabled { opacity: 0.5; cursor: default; }

.trends__tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.trends__tab {
  flex: 1;
  padding: 0.45rem 0.8rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.trends__tab--active {
  background: var(--surface);
  border-color: var(--accent-border);
  color: var(--accent-hover);
  font-weight: 600;
}

.trends__status { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.trends__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.trends__table th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trends__table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.trends__num { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trends__tag { font-weight: 600; }
.trends__games { color: var(--text-muted); font-size: 0.75rem; }
.trends__srcs { color: var(--text-muted); font-size: 0.72rem; }

.trends__score { min-width: 110px; }

.trends__score-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.2rem;
}

.trends__score-fill { height: 100%; background: var(--accent, #66c0f4); }

.trends__score-num { font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.trends__delta { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.trends__badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
}

.trends__badge--new { background: rgba(102, 192, 244, 0.15); color: #66c0f4; }
.trends__badge--up { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.trends__badge--down { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.trends__badge--flat { background: var(--bg-elevated); color: var(--text-muted); }

.trends__section-title { margin: 0 0 0.6rem; font-size: 0.9rem; font-weight: 700; }

.trends__src-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.45rem;
}

.trends__src {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
}

.trends__src--ok { border-left: 3px solid #4ade80; }
.trends__src--err { border-left: 3px solid #f87171; }
.trends__src--auth { border-left: 3px solid var(--warning, #e0a34e); }
.trends__src--none { border-left: 3px solid var(--border); opacity: 0.6; }

.trends__src-state { color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; }

.trends__login {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--accent-border);
  border-radius: 3px;
  background: transparent;
  color: var(--accent-hover);
  font-size: 0.68rem;
  cursor: pointer;
}

.trends__login-panel:empty { display: none; }

.trends__login-panel {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  background: var(--accent-soft);
}

.trends__login-title { margin: 0 0 0.5rem; font-size: 0.85rem; font-weight: 700; }

.trends__login-steps {
  margin: 0 0 0.6rem;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.25rem;
}

.trends__bookmarklet {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px dashed var(--accent-hover);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
}

.trends__login-alt {
  margin-left: 0.6rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.trends__topics { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.3rem; }

.trends__topic {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
}

.trends__topic-src { color: var(--text-muted); font-size: 0.7rem; }
.trends__topic-match { color: #4ade80; font-size: 0.72rem; margin-left: auto; }

.trends__manual {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  resize: vertical;
}

.trends__empty { color: var(--text-muted); font-size: 0.8rem; }

/* Топ-10 по источникам */
.trends__ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.trends__ps {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  padding: 0.55rem 0.7rem;
}

.trends__ps-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.trends__ps-name { font-size: 0.8rem; font-weight: 700; }
.trends__ps-manual { font-size: 0.65rem; color: var(--accent-hover); }

.trends__ps-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.76rem;
}

.trends__ps-item { color: var(--text); }
.trends__ps-item a { color: var(--text); text-decoration: none; }
.trends__ps-item a:hover { color: var(--accent-hover); }
.trends__ps-tags { display: block; color: var(--text-faint); font-size: 0.66rem; }
.trends__ps-empty { margin: 0; font-size: 0.72rem; color: var(--text-muted); }

/* --- Web Games Intelligence (таблица игр) --- */

.tg__lead {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tg__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.tg__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid rgba(128, 128, 128, 0.14);
  width: fit-content;
}

.tg__pill {
  padding: 0.34rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-faint);
  background: transparent;
  border: none;
  cursor: pointer;
}

.tg__pill--active {
  color: var(--text);
  background: rgba(108, 182, 255, 0.1);
  box-shadow: inset 0 -2px 0 var(--accent-hover);
}

.tg__search {
  margin-left: auto;
  max-width: 15rem;
  font-size: 0.78rem;
}

.tg__table-wrap {
  margin-bottom: 1.2rem;
  border: 1px solid rgba(128, 128, 128, 0.14);
  background: var(--bg-elevated);
}

.tg__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.tg__th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.55rem 0.7rem;
  text-align: left;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface);
  border-bottom: 1px solid rgba(128, 128, 128, 0.22);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.tg__th:hover { color: var(--text); }

.tg__th--num { text-align: right; }

.tg__th--sorted { color: var(--accent-2); }

.tg__sortmark {
  font-weight: 400;
  color: var(--text-faint);
}

.tg__th--sorted .tg__sortmark { color: var(--accent-2); }

.tg__table td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.08);
  color: var(--text-muted);
  vertical-align: middle;
}

.tg__table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.tg__table tbody tr:hover td {
  background: rgba(74, 158, 232, 0.07);
}

.tg__game {
  color: var(--text) !important;
  font-weight: 600;
  max-width: 18rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg__link {
  color: var(--text);
  text-decoration: none;
  margin-left: 0.45rem;
}

.tg__link:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.tg__rank {
  display: inline-block;
  min-width: 1.9rem;
  padding: 0.06rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid rgba(128, 128, 128, 0.16);
}

.tg__num { text-align: right; }

.tg__src {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
  border-left: 2px solid var(--text-faint);
  color: var(--text-muted);
}

.tg__src--yandex { border-left-color: #fc3f1d; }

.tg__src--crazygames { border-left-color: #a78bfa; }
.tg__src--poki { border-left-color: #4a9ee8; }
.tg__src--playgama { border-left-color: #6ee7c9; }
.tg__src--gamedistribution { border-left-color: #f0b872; }

.tg__genre { max-width: 10rem; }

.tg__genre-chip {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  font-size: 0.66rem;
  color: var(--text-muted);
  border: 1px solid rgba(128, 128, 128, 0.22);
  white-space: nowrap;
}

.tg__score {
  display: inline-block;
  min-width: 2rem;
  padding: 0.08rem 0.35rem;
  font-weight: 700;
  text-align: center;
}

.tg__score--hi { color: #6ee7c9; }
.tg__score--mid { color: #cbd5e1; }
.tg__score--lo { color: #f0b872; }

.tg__date {
  font-size: 0.7rem;
  white-space: nowrap;
  color: var(--text-faint) !important;
}

.tg__trend {
  white-space: nowrap;
}

.tg__delta {
  display: inline-block;
  min-width: 3.2rem;
  font-weight: 700;
}

.tg__delta--up { color: #6ee7c9; }
.tg__delta--down { color: #e94142; }
.tg__delta--flat { color: var(--text-faint); }
.tg__none { color: var(--text-faint); }

.tg__new {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0b872;
  border: 1px solid rgba(240, 184, 114, 0.4);
  background: rgba(240, 184, 114, 0.08);
}

.tg__rankdelta {
  margin-left: 0.35rem;
  font-size: 0.66rem;
}

.tg__rankdelta--up { color: #6ee7c9; }
.tg__rankdelta--down { color: #e94142; }

.tg__count {
  margin: 0.4rem 0 0;
  font-size: 0.68rem;
  color: var(--text-faint);
}

.trends__statusrow {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.4rem;
}

.trends__next {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.tg__pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.45rem;
}

.tg__pgbtn {
  min-width: 1.7rem;
  padding: 0.18rem 0.4rem;
  border: 1px solid rgba(128, 128, 128, 0.22);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.tg__pgbtn:hover:not(:disabled) {
  border-color: rgba(128, 128, 128, 0.45);
  color: var(--text);
}

.tg__pgbtn--active {
  background: rgba(102, 192, 244, 0.14);
  border-color: rgba(102, 192, 244, 0.45);
  color: #66c0f4;
}

.tg__pgbtn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tg__pgdots {
  color: var(--text-faint);
  font-size: 0.72rem;
  padding: 0 0.15rem;
}

.tg__methodology {
  margin-top: 1.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px dashed rgba(128, 128, 128, 0.14);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.tg__methodology summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--text);
}

.tg__methodology p { margin: 0.5rem 0 0; }

@media (max-width: 720px) {
  .tg__search { margin-left: 0; width: 100%; max-width: none; }
  .tg__table-wrap { overflow-x: auto; }
  .tg__table { min-width: 640px; }
}
