.device-card:has(.chart-wrap) {
  padding: 12px;
  justify-content: flex-start;
  flex: none;
}

.chart-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 8px 8px;
  background: transparent;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.chart-wrap .eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #64748b;
}

.chart-wrap h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f172a;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}

.dc-pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #10b981;
  animation: dc-pulse 1.6s infinite;
}

@keyframes dc-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.65;
  }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  font-size: clamp(8px, 1.4vw, 12px);
  color: #94a3b8;
}

.legend-line {
  width: clamp(10px, 2vw, 22px);
  height: 4px;
  flex-shrink: 0;
  border-radius: 999px;
}

.legend-line.price-low {
  background: #10b981;
}

.legend-line.price-mid {
  background: #f97316;
}

.legend-line.price-high {
  background: #ef4444;
}

.legend-line.power {
  background: rgba(255, 255, 255, 0.28);
}

.legend-line.env-temp {
  background: #f59e0b;
}

.legend-line.env-humidity {
  background: #06b6d4;
}

.legend-line.env-power {
  background: rgba(100, 116, 139, 0.45);
}

.legend-line.env-occupancy {
  background: #a78bfa;
  opacity: 0.6;
}

.minimal-banner-chart .legend-item {
  color: #475569;
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
  font-size: clamp(8px, 1.4vw, 12px);
}

.minimal-banner-chart .chart-wrap {
  max-width: none;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  flex: 1;
  height: 0;
  min-height: 0;
}

@media (max-width: 768px) {
  .chart-head {
    flex-direction: column;
  }

  .chart-wrap h3 {
    font-size: 18px;
  }



  .badge {
    display: none;
  }
}
