/* v2.4.3 — Return trend now mirrors the refund trend chart interaction and visual language. */
.return-insights-grid > .return-trend-panel {
  min-height: 304px;
}

.return-insights-grid .return-trend-panel .dashboard-panel-header {
  align-items: flex-start;
}

.return-insights-grid .return-trend-controls {
  flex: 0 0 auto;
  align-items: center;
}

.return-insights-grid .return-trend-controls .dashboard-select-shell {
  width: 148px;
  min-width: 148px;
}

.return-insights-grid .return-trend-controls .dashboard-select-trigger {
  min-height: 32px;
  height: 32px;
  border-radius: 8px;
  padding-inline: 9px;
  font-size: 11px;
}

.return-insights-grid .return-trend-legend {
  min-height: 28px;
  padding: 0 18px 4px;
  justify-content: space-between;
}

.return-trend-selection {
  max-width: 58%;
  padding: 4px 8px;
  border: 1px solid var(--p-border-subdued);
  border-radius: 999px;
  background: var(--p-bg-fill);
  color: var(--p-text-subdued);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Override the legacy flex mini-chart and use exactly the refund SVG chart surface. */
.return-insights-grid .return-trend-chart-v243 {
  display: block !important;
  min-height: 250px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 10px 8px !important;
  overflow: visible !important;
}

.return-insights-grid .return-trend-chart-v243 svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.return-trend-bar-v243 {
  cursor: pointer;
  outline: none;
}

.return-trend-bar-v243:hover,
.return-trend-bar-v243:focus {
  opacity: .78;
}

.return-trend-bar-v243.selected {
  stroke: var(--p-primary);
  stroke-width: 2;
  opacity: 1;
}

@media (max-width: 720px) {
  .return-insights-grid .return-trend-panel .dashboard-panel-header {
    gap: 12px;
  }

  .return-insights-grid .return-trend-controls {
    width: 100%;
    justify-content: space-between;
  }

  .return-insights-grid .return-trend-controls .dashboard-select-shell {
    width: min(48%, 180px);
    min-width: 132px;
  }

  .return-insights-grid .return-trend-legend {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
  }

  .return-trend-selection {
    max-width: 100%;
  }

  .return-insights-grid .return-trend-chart-v243 {
    min-height: 220px !important;
    overflow-x: auto !important;
  }

  .return-insights-grid .return-trend-chart-v243 svg {
    min-width: 680px;
  }
}
