/* Stat tiles. Tokens only — no literal colour, radius, duration or ease. */

.stat-tile { overflow: hidden; }

.stat-tile__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5) 0;
}

.stat-tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.stat-tile__label {
  /* A metric's name is a label on an instrument, not a sentence: mono, small,
     tracked out, so the reading below it carries all the weight. */
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

/* --- delta chip: .tag from shell.css, plus the arrow --- */

.stat-tile__delta { padding-right: var(--sp-2); }
.stat-tile__arrow {
  width: 11px; height: 11px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.stat-tile__delta[data-direction="down"] .stat-tile__arrow { rotate: 180deg; }

/* --- value + odometer --- */

.stat-tile__value {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  color: var(--ink);
}

.stat-tile__odo {
  display: inline-flex;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.odo__digit {
  display: inline-block;
  width: 1ch;
  height: 1.15em;
  overflow: hidden;
}
.odo__strip { display: block; }
.odo__cell {
  display: block;
  height: 1.15em;
  line-height: 1.15;
  text-align: center;
}
.odo__sep {
  display: inline-block;
  height: 1.15em;
  /* A mono comma is a full character wide; pulling the neighbours in stops the
     group separator reading as a space. */
  margin: 0 -0.16ch;
  line-height: 1.15;
  color: var(--ink-faint);
}

.stat-tile__unit {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* --- sparkline --- */

.stat-tile__spark {
  display: block;
  width: 100%;
  height: 44px;
  overflow: visible;
}
.stat-tile__spark-line {
  fill: none;
  stroke: var(--tile-series, var(--accent));
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-tile__spark-fill {
  fill: var(--tile-series, var(--accent));
  fill-opacity: 0.12;
  stroke: none;
}

.stat-tile[data-series="1"] { --tile-series: var(--series-1); }
.stat-tile[data-series="2"] { --tile-series: var(--series-2); }
.stat-tile[data-series="3"] { --tile-series: var(--series-3); }
.stat-tile[data-series="4"] { --tile-series: var(--series-4); }
.stat-tile[data-series="5"] { --tile-series: var(--series-5); }
.stat-tile[data-series="6"] { --tile-series: var(--series-6); }

.stat-tile__foot {
  padding: 0 0 var(--sp-4);
  color: var(--ink-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
}

@media (max-width: 1100px) {
  .stat-tile__spark { height: 52px; }
}
