.emt-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--emt-space-5, 20px);
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.emt-chart-grid--single { grid-template-columns: minmax(0, 1fr); }
.emt-chart-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.emt-chart-grid > .emt-chart-card {
  height: 100%;
  margin-top: 0;
}

.emt-chart-card.emt-page-section {
  margin-top: var(--emt-space-8, 32px);
}

.emt-chart-card {
  min-width: 0;
  overflow: hidden;
  background: var(--emt-surface, #fff);
  border: 1px solid var(--emt-border, #dbe3ec);
  border-radius: var(--emt-radius-lg, 16px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .045);
}

.emt-chart-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--emt-space-4, 16px);
  padding: var(--emt-space-5, 20px);
}

.emt-chart-card__heading { min-width: 0; }

.emt-chart-card__title {
  margin: 0;
  color: var(--emt-text, #172033);
  font-size: var(--emt-font-size-lg, 20px);
  font-weight: 700;
  line-height: 1.25;
}

.emt-chart-card__description {
  margin: 6px 0 0;
  color: var(--emt-text-secondary, #637083);
  font-size: var(--emt-font-size-sm, 14px);
  line-height: 1.45;
}

.emt-chart-card__subtitle {
  margin: 6px 0 0;
  color: var(--emt-text-secondary, #637083);
  font-size: var(--emt-font-size-sm, 14px);
  line-height: 1.45;
}

.emt-chart-card__body {
  min-width: 0;
  padding: var(--emt-space-4, 16px) var(--emt-space-5, 20px) var(--emt-space-5, 20px);
}

.emt-chart {
  position: relative;
  width: 100%;
  min-height: 260px;
}

.emt-chart--compact { min-height: 210px; }
.emt-chart--wide { min-height: 320px; }

.emt-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.emt-chart__grid { stroke: #e8edf3; stroke-width: 1; }
.emt-chart__axis { stroke: #cbd5e1; stroke-width: 1; }

.emt-chart__label {
  fill: var(--emt-text-secondary, #637083);
  font-family: inherit;
  font-size: 12px;
}

.emt-chart__value-label {
  fill: var(--emt-text, #172033);
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
}

.emt-chart__bar {
  opacity: .94;
  transition: opacity .18s ease, filter .18s ease;
}

.emt-chart__bar:hover,
.emt-chart__point:hover { opacity: 1; filter: brightness(.96); }

.emt-chart__line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emt-chart__area { opacity: .13; }

.emt-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emt-text-secondary);
  font-size: var(--emt-font-size-xs);
  font-weight: 600;
}

.emt-trend--up { color: var(--emt-primary-active); }
.emt-trend--down { color: var(--emt-danger); }
.emt-trend--neutral,
.emt-trend--unavailable { color: var(--emt-text-secondary); }

.emt-sparkline {
  display: inline-flex;
  width: 64px;
  height: 22px;
  color: currentColor;
  vertical-align: middle;
}

.emt-sparkline svg { width: 100%; height: 100%; }

.emt-chart__point {
  stroke: #fff;
  stroke-width: 2;
}

.emt-chart__reference {
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.emt-chart__reference-label {
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
}

.emt-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
}

.emt-chart__legend-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  color: var(--emt-text-secondary, #637083);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.emt-chart__legend-button[aria-pressed="false"] { opacity: .42; }

.emt-chart__legend-swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.emt-chart__empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--emt-text-secondary, #637083);
  text-align: center;
}

.emt-chart-card--full { grid-column: 1 / -1; }

@media (max-width: 1200px) {
  .emt-chart-grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .emt-chart-grid,
  .emt-chart-grid--three { grid-template-columns: 1fr; }
  .emt-chart-card--full { grid-column: auto; }
}

@media (max-width: 640px) {
  .emt-chart-card__header { padding: 16px; }
  .emt-chart-card__body { padding: 12px 12px 16px; }
  .emt-chart { min-height: 230px; }
  .emt-chart--wide { min-height: 270px; }
  .emt-chart__label { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .emt-chart__bar { transition: none; }
}
