.dashboard-charts {
  margin-bottom: 2rem;
}

.dashboard-charts .card-heading-row {
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.dashboard-charts__title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dashboard-charts__subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dashboard-charts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem 2rem;
  margin-top: 1rem;
}

/* Each chart is its own quiet panel rather than three plots floating in one
   card — the hairline is what stops the middle chart's axis gutter reading as
   part of the left chart's plot. */
.trend-chart {
  min-width: 0;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

.trend-chart__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.trend-chart__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.trend-chart__figure {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

/* Proportional figures: this is a standalone display number, and tabular-nums
   makes values like 121 look gappy at this size. */
.trend-chart__total {
  font-size: 1.4rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.trend-chart__delta {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.trend-chart__delta--up {
  color: var(--good);
  background: var(--good-soft);
}

.trend-chart__delta--down {
  color: var(--bad);
  background: var(--bad-soft);
}

/* Keeps the row height identical when there's no prior week to compare. */
.trend-chart__delta--empty {
  background: transparent;
}

.trend-chart__svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.trend-chart__gridline {
  stroke: color-mix(in srgb, var(--text) 7%, transparent);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.trend-chart__gridline--base {
  stroke: color-mix(in srgb, var(--text) 14%, transparent);
}

.trend-chart__tick,
.trend-chart__day {
  font-size: 10px;
  fill: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.trend-chart__day {
  font-size: 10px;
  font-weight: 500;
}

/* Days that haven't happened yet are still labelled, but recede so the axis
   reads as "we are here" rather than as missing data. */
.trend-chart__day--future {
  fill: color-mix(in srgb, var(--text-muted) 55%, transparent);
}

.trend-chart__gradient-stop--top {
  stop-color: var(--accent);
  stop-opacity: 0.16;
}

.trend-chart__gradient-stop--bottom {
  stop-color: var(--accent);
  stop-opacity: 0;
}

.trend-chart__line {
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.trend-chart__line--current {
  stroke: var(--accent);
}

/* Solid, not dashed: a dashed stroke reads as a projection or a threshold,
   and at this density it just adds noise. Weight and opacity carry the
   "previous" role instead. */
.trend-chart__line--previous {
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: 0.4;
}

.trend-chart__end-ring {
  fill: var(--surface);
}

.trend-chart__end-dot {
  fill: var(--accent);
}

/* --- Crosshair band: one hit target per day, covering both series --- */

.trend-chart__band {
  outline: none;
}

.trend-chart__band-hit {
  fill: transparent;
  cursor: pointer;
}

.trend-chart__crosshair,
.trend-chart__band-dot,
.trend-chart__tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.trend-chart__band:hover .trend-chart__crosshair,
.trend-chart__band:focus-visible .trend-chart__crosshair,
.trend-chart__band:hover .trend-chart__band-dot,
.trend-chart__band:focus-visible .trend-chart__band-dot,
.trend-chart__band:hover .trend-chart__tooltip,
.trend-chart__band:focus-visible .trend-chart__tooltip {
  opacity: 1;
}

.trend-chart__crosshair {
  stroke: color-mix(in srgb, var(--text) 22%, transparent);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.trend-chart__band-dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.trend-chart__band-dot--current {
  fill: var(--accent);
}

.trend-chart__band-dot--previous {
  fill: var(--text-muted);
}

.trend-chart__tooltip-box {
  fill: var(--text);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.trend-chart__tooltip-day {
  fill: var(--surface);
  font-size: 10px;
  font-weight: 600;
  opacity: 0.65;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  dominant-baseline: middle;
}

/* Value leads, series name follows — the reader already knows the series and
   came for the number. */
.trend-chart__tooltip-value {
  fill: var(--surface);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  dominant-baseline: middle;
}

.trend-chart__tooltip-value--muted {
  opacity: 0.75;
}

.trend-chart__tooltip-name {
  fill: var(--surface);
  font-size: 10px;
  font-weight: 500;
  opacity: 0.6;
  dominant-baseline: middle;
}

.trend-chart__tooltip-key {
  stroke-width: 2;
  stroke-linecap: round;
}

.trend-chart__tooltip-key--current {
  stroke: var(--accent);
}

.trend-chart__tooltip-key--previous {
  stroke: var(--surface);
  opacity: 0.45;
}

/* --- Legend --- */

.trend-chart__legend {
  display: flex;
  gap: 1.1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trend-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.trend-chart__swatch {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px solid var(--accent);
  border-radius: 2px;
}

.trend-chart__swatch--previous {
  border-top: 1.5px solid color-mix(in srgb, var(--text-muted) 45%, transparent);
}
