/* Chép từ jc_nutrition_connector (public/widgets/src/shared/trend.css), NUT-34.
   Biểu đồ SVG area + line nằm trong panel. Không có <text> trong SVG: nhãn ngày là HTML (.tdates) để giữ cỡ chữ thật. */
.chart {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.ctitle {
  font-size: var(--fs-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  white-space: nowrap;
}
.cmeta {
  font-size: var(--fs-label);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
/* NUT-105: ba chart macro một cột ở mobile, ba cột từ 700 px (breakpoint của STYLE_GUIDE). */
.chart-grid {
  display: grid;
  gap: 14px;
}
@media (min-width: 700px) {
  .chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* Cột hẹp: tiêu đề và trung bình luôn xếp dọc để ba chart thẳng hàng. */
  .chart-grid .chead {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* NUT-105: số của ngày đứng riêng, đặt ngay trên chấm (--x, --y theo % của vùng vẽ). */
.cplot {
  position: relative;
}
.lone-val {
  position: absolute;
  left: var(--x);
  top: var(--y);
  --tx: -50%;
  --ty: calc(-100% - 5px);
  transform: translate(var(--tx), var(--ty));
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
.lone-val.at-start {
  --tx: -4px;
}
.lone-val.at-end {
  --tx: calc(-100% + 4px);
}
.lone-val.below {
  --ty: 5px;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.axis {
  stroke: var(--panel-border);
}
.goalline {
  stroke: var(--text-dim);
  stroke-dasharray: 3 3;
  opacity: 0.5;
}
.tdates {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 2px;
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
