.team-analytics-controls {
  display: grid;
  grid-template-columns: minmax(110px, .22fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.5rem, 2vw, 1.4rem);
  margin-top: clamp(1.25rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
  padding: clamp(.85rem, 2vw, 1.35rem);
  border-radius: 12px 30px 30px 30px;
}

.team-analytics-controls__title {
  margin: .5rem 0 0;
}

.team-analytics-controls .team-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
}

.team-analytics-controls .team-filter-bar > label,
.team-analytics-controls .team-filter-bar > .team-filter-bar__static {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: center;
  gap: .5rem;
  min-width: 0;
  min-height: 44px;
  padding: .15rem 0;
  border-bottom: 1px solid #e9e8ef;
}

.team-analytics-controls .team-filter-bar > :last-child {
  border-bottom: 0;
}

.team-analytics-controls .team-filter-bar > label {
  cursor: pointer;
}

.team-analytics-controls .team-filter-bar label > span,
.team-analytics-controls .team-filter-bar__static > span {
  color: var(--team-muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.team-analytics-controls .team-filter-bar select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: .45rem 2rem .45rem .15rem;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  color: var(--team-ink);
  font-size: .86rem;
  font-weight: 750;
  text-overflow: ellipsis;
  cursor: pointer;
}

.team-analytics-controls .team-filter-bar select:focus-visible {
  border-color: transparent;
  outline: 2px solid var(--team-violet);
  outline-offset: -2px;
  background-color: #f5f2ff;
}

.team-analytics-controls .team-filter-bar__static strong {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: .45rem .15rem;
  color: var(--team-ink);
  font-size: .86rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.team-analytics-summary {
  grid-template-rows: repeat(2, max-content);
  align-self: start;
}

.team-analytics-summary__item {
  min-height: 0;
  padding: .55rem .8rem;
  color: #202b42;
  border: 1px solid #ced5e2;
  background: #e8edf5;
}

.team-analytics-summary__item--best {
  color: #7d4038;
  border-color: rgba(223, 120, 107, .42);
  background: rgba(223, 120, 107, .14);
  transform: none;
}

.team-analytics-summary__item > span {
  color: #c7685c;
}

.team-analytics-summary__item--best > span {
  color: #7d4038;
}

.team-analytics-summary__item strong {
  margin-top: .2rem;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
}

.team-analytics-summary__item small {
  margin-top: .3rem;
  color: #697386;
  font-size: .74rem;
  line-height: 1.25;
}

.team-analytics-summary__item--best small {
  color: rgba(125, 64, 56, .72);
}

.team-visual-panel {
  margin-top: 1rem;
}

.team-analytics-section-header {
  align-items: end;
  margin-bottom: 1.2rem;
}

.team-analytics-section-header > div:first-child {
  min-width: 0;
}

.team-analytics-section-header h2 {
  margin: .2rem 0 0;
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -.035em;
}

.team-analytics-section-header p {
  max-width: 720px;
  margin: .4rem 0 0;
  color: var(--team-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.team-analytics-section-meta,
.team-form-summary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex: 0 0 auto;
  padding: .6rem .85rem;
  border: 1px solid #ddd8ee;
  border-radius: 999px;
  color: #51487a;
  background: #f1eef9;
  font-size: .76rem;
  font-weight: 800;
}

.team-analytics-section-meta i {
  color: #6e5db8;
}

.team-form-summary {
  max-width: 560px;
}

.team-form-summary i {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #567323;
  background: #e3efc4;
}

.team-form-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(20px, 1fr));
  align-items: end;
  gap: clamp(.35rem, 1.2vw, .8rem);
  min-height: 215px;
  padding: 1.1rem 1rem .75rem;
  border: 1px solid #e0e2ea;
  border-radius: 10px 24px 24px 24px;
  background:
    linear-gradient(to top, rgba(94, 75, 184, .055) 1px, transparent 1px) 0 0 / 100% 25%,
    #fff;
}

.team-form-chart__item {
  display: grid;
  grid-template-rows: auto 150px auto;
  gap: .45rem;
  align-items: end;
  min-width: 0;
  text-align: center;
}

.team-form-chart__value {
  color: #5d518e;
  font-size: .7rem;
  font-weight: 850;
}

.team-form-chart__bar {
  position: relative;
  height: 150px;
  overflow: hidden;
  border-radius: 10px 10px 5px 5px;
  background: #eeebf7;
}

.team-form-chart__bar-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--form-bar-height);
  min-height: 10px;
  border-radius: inherit;
  background: linear-gradient(180deg, #927ee2, #6d58c6);
}

.team-form-chart__label {
  color: var(--team-muted);
  font-size: .68rem;
  font-weight: 800;
}

.team-finish-bars {
  display: grid;
  gap: .78rem;
}

.team-finish-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 84px;
  align-items: center;
  gap: .8rem;
}

.team-finish-row__label {
  color: #40495c;
  font-size: .78rem;
  font-weight: 850;
}

.team-finish-row__track {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf2;
}

.team-finish-row__fill {
  display: block;
  width: var(--finish-width);
  height: 100%;
  border-radius: inherit;
  background: #9387b5;
}

.team-finish-row--top .team-finish-row__fill { background: #9eb95c; }
.team-finish-row--upper .team-finish-row__fill { background: #7c68c7; }
.team-finish-row--lower .team-finish-row__fill { background: #a592c9; }
.team-finish-row--bottom .team-finish-row__fill { background: #d58379; }

.team-finish-row__result {
  display: grid;
  justify-items: end;
  line-height: 1.05;
}

.team-finish-row__result strong {
  color: #30394c;
  font-size: .82rem;
  font-weight: 900;
}

.team-finish-row__result small {
  margin-top: .18rem;
  color: var(--team-muted);
  font-size: .62rem;
  font-weight: 700;
}

.team-strengths-panel .motivation-axis-premium,
.team-strengths-panel .badge.text-bg-light {
  max-width: 100%;
}

@media (max-width: 900px) {
  .team-analytics-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: .3rem;
  }

  .team-analytics-controls__title {
    margin: 0;
  }

  .team-analytics-section-header {
    align-items: start;
    flex-direction: column;
  }

  .team-form-summary,
  .team-analytics-section-meta {
    max-width: none;
    width: fit-content;
  }
}

@media (max-width: 640px) {
  .team-form-chart {
    gap: .25rem;
    min-height: 180px;
    padding-inline: .5rem;
  }

  .team-form-chart__item {
    grid-template-rows: auto 118px auto;
  }

  .team-form-chart__bar {
    height: 118px;
  }

  .team-form-chart__value {
    font-size: .58rem;
  }

  .team-form-chart__label {
    font-size: .6rem;
  }

  .team-finish-row {
    grid-template-columns: 94px minmax(0, 1fr) 70px;
    gap: .5rem;
  }
}

/* На узких экранах сводные карточки стоят рядом под графиком. */
@media (max-width: 991.98px) {
  .team-analytics-summary {
    grid-template-columns: repeat(2, max-content);
    grid-template-rows: none;
    justify-content: start;
    grid-auto-flow: row;
    overflow: visible;
    padding: .2rem .1rem;
    scroll-snap-type: none;
  }

  .team-analytics-summary__item {
    justify-content: flex-start;
  }
}
