/* Keep the whole block inside the content column */
.rf-top-movers-wrap {
  max-width: 100%;
  clear: both;                 /* avoid sidebar/float collisions */
  margin: 0 auto 32px auto;
}

/* Logo bar ABOVE the chart */
.rf-logo-bar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;   /* push to the right */
  align-items: center;
  margin: 0 0 8px 0;
  line-height: 0;              /* remove stray gaps */
}

/* Make sure logos stay small regardless of theme image rules */
.rf-logo-bar img {
  flex: 0 0 auto;
  display: inline-block !important;
  height: 22px !important;     /* fixed visual height */
  width: auto !important;      /* preserve aspect ratio */
  max-width: 180px !important; /* guard against ultra-wide assets */
  object-fit: contain !important;
}

/* Smaller logos on tablets/phones */
@media (max-width: 900px) {
  .rf-logo-bar img { height: 18px !important; max-width: 150px !important; }
}
@media (max-width: 600px) {
  .rf-logo-bar img { height: 16px !important; max-width: 130px !important; }
}

/* Mount point */
.rf-top-movers { width: 100%; }

/* Outer wrapper (for max width) */
.rf-chart-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Inner box that Chart.js will fill (height is controlled by aspectRatio) */
.rf-chart-inner {
  position: relative;
  width: 100%;
  /* no explicit height to avoid resize loops */
}

/* Let Chart.js set height via aspectRatio; do NOT override it */
.rf-chart-inner canvas {
  display: block;
  width: 100% !important;
  height: auto !important;     /* Chart.js controls height */
}

/* Status line under chart */
.rf-status {
  text-align: center;
  margin-top: 6px;
  font-size: 0.9em;
  color: #666;
  min-height: 1.2em;
}

/* Optional: selectors UI when controls="full" */
.rf-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}
.rf-selectors label {
  display: flex;
  flex-direction: column;
  font-size: 0.9em;
}
.rf-selectors select {
  margin-top: 4px;
  padding: 4px 6px;
}

/* DEFENSIVE: beat very aggressive theme rules that set img width:100% */
.entry-content .rf-logo-bar img,
.post .rf-logo-bar img,
.page .rf-logo-bar img,
body .rf-top-movers-wrap .rf-logo-bar img {
  width: auto !important;
  height: 22px !important;
  max-width: 180px !important;
  display: inline-block !important;
  object-fit: contain !important;
}
@media (max-width: 900px) {
  .entry-content .rf-logo-bar img,
  .post .rf-logo-bar img,
  .page .rf-logo-bar img,
  body .rf-top-movers-wrap .rf-logo-bar img {
    height: 18px !important;
    max-width: 150px !important;
  }
}
@media (max-width: 600px) {
  .entry-content .rf-logo-bar img,
  .post .rf-logo-bar img,
  .page .rf-logo-bar img,
  body .rf-top-movers-wrap .rf-logo-bar img {
    height: 16px !important;
    max-width: 130px !important;
  }
}
