/* Analyst Trends point-in-time history */
.analyst-trends-section {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.analyst-section-title {
  gap: 18px;
}

.analyst-change-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: #f8fafb;
}

.analyst-change-strip > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}

.analyst-change-strip > div:last-child {
  border-right: 0;
}

.analyst-change-strip span,
.analyst-change-strip small {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.analyst-change-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 0.91rem;
  font-variant-numeric: tabular-nums;
}

.analyst-change-strip small {
  margin-top: 3px;
}

.analyst-history-note {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: #f8fafb;
  font-size: 0.75rem;
}

.analyst-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.analyst-card {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.analyst-card:nth-child(2n) {
  border-right: 0;
}

.analyst-card:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.analyst-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.analyst-card__heading > div:first-child > span,
.analyst-card__heading > div:first-child > strong,
.analyst-card__heading > div:first-child > small {
  display: block;
}

.analyst-card__heading > div:first-child > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.analyst-card__heading > div:first-child > strong {
  margin-top: 5px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.analyst-card__heading > div:first-child > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.69rem;
}

.analyst-card__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.analyst-card__legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.analyst-key {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: #166aa3;
}

.analyst-key--primary {
  background: #166aa3;
}

.analyst-key--secondary {
  background: #0f6b4f;
}

.analyst-key--muted {
  background: #7a8791;
}

.analyst-key--price {
  background: #202b34;
}

.analyst-key--band {
  height: 8px;
  background: rgba(22, 106, 163, 0.18);
}

.analyst-mini-chart {
  display: block;
  width: 100%;
  height: 170px;
  margin-top: 7px;
  overflow: visible;
}

.analyst-mini-chart line {
  stroke: #e5eaee;
  stroke-width: 1;
}

.analyst-mini-chart text {
  fill: #71808b;
  font-size: 0.56rem;
  font-weight: 700;
}

.analyst-line {
  fill: none;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.analyst-line--primary {
  stroke: #166aa3;
}

.analyst-line--secondary {
  stroke: #0f6b4f;
}

.analyst-line--muted {
  stroke: #7a8791;
}

.analyst-line--price {
  stroke: #202b34;
  stroke-dasharray: 6 4;
}

.analyst-line--range {
  stroke: rgba(22, 106, 163, 0.36);
  stroke-width: 1.2;
}

.analyst-band {
  fill: rgba(22, 106, 163, 0.10);
  stroke: none;
}

.analyst-chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.61rem;
}

.analyst-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.analyst-detail-list div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 5px;
  background: var(--surface-muted);
}

.analyst-detail-list dt,
.analyst-detail-list dd {
  margin: 0;
}

.analyst-detail-list dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyst-detail-list dd {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broker-distribution {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.broker-distribution span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #45525d;
  background: #ffffff;
  font-size: 0.62rem;
}

.broker-distribution b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1000px) {
  .analyst-change-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analyst-change-strip > div:nth-child(2) {
    border-right: 0;
  }

  .analyst-change-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .analyst-section-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .analyst-card-grid {
    grid-template-columns: 1fr;
  }

  .analyst-card,
  .analyst-card:nth-child(2n),
  .analyst-card:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .analyst-card:last-child {
    border-bottom: 0;
  }

  .analyst-card__heading {
    flex-direction: column;
    min-height: 0;
  }

  .analyst-card__legend {
    justify-content: flex-start;
  }

  .analyst-mini-chart {
    height: 150px;
  }
}

@media (max-width: 440px) {
  .analyst-change-strip {
    grid-template-columns: 1fr;
  }

  .analyst-change-strip > div,
  .analyst-change-strip > div:nth-child(2),
  .analyst-change-strip > div:nth-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .analyst-change-strip > div:last-child {
    border-bottom: 0;
  }

  .analyst-detail-list {
    grid-template-columns: 1fr;
  }
}
