
/* A narrow card keeps its head on one line: the label ("DISK C:") never
   breaks in two under the value, the model name and the value give way first
   with an ellipsis, and the temperature badge stays whole. */
.stat-head > :first-child { flex: 0 0 auto; white-space: nowrap; }
.stat-head > .stat-head-value,
.stat-head-right > .stat-head-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stat-head-temp, .disk-cycle-btn { flex: 0 0 auto; }
/* A badge cannot shrink, so a right group holding one keeps its own width:
   squeezed below it, the group would spill left over the model name. */
.stat-head-right:has(> .stat-head-temp:not(:empty)) { flex-shrink: 0; }
/* Under ~140px the model name would be a lone "…": leave it to the line
   below the value. The head always stretches to its card, so measuring it
   as a container cannot collapse it. */
.stat-head { container: stat-head / inline-size; }
@container stat-head (max-width: 140px) { .stat-head-name { display: none; } }

.stat-head-right {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

/* Model name shown inline after the CPU/GPU label (e.g. "Ryzen 7 7800X3D",
   "NVIDIA RTX 5080"). Takes the middle space and ellipsises — never wraps. */
.stat-head-name {
  flex: 1 1 auto;
  min-width: 0;
  text-transform: none;
  letter-spacing: 0.1px;
  font-size: 10.5px;
  font-weight: 750;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.stat-head-name:empty { display: none; }

.stat-head-value {
  color: var(--muted-text);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.stat-value {
  font-size: 19px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-temp {
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  color: var(--muted-text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The PC's LAN address on the Network card (networkShowIp, js/system/network.js). Not a
   .stat-sub, which a narrow side panel hides: the user asked for this line. One line,
   cut with an ellipsis on a phone-width card instead of widening it. */
.net-lan-ip {
  min-width: 0;
  color: var(--muted-text);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.net-lan-ip[hidden],
.stat-box[data-system-card-size="compact"] .net-lan-ip { display: none; }

.stat-detail {
  min-height: 12px;
  color: var(--muted-text);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-muted-detail {
  color: var(--dim-text);
  font-size: 10.5px;
}

.stat-track {
  margin-top: 2px;
  height: 4px;
  border-radius: 999px;
  background: var(--control-bg);
  overflow: hidden;
}

.stat-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--cyan);
  transition: width 0.35s ease;
}

.stat-fill.cpu { background: var(--green); }
.stat-fill.gpu { background: var(--blue); }
.stat-fill.ram { background: var(--amber); }
.stat-fill.disk { background: #c084fc; }

/* ── Live sparkline (replaces the flat bar) ──────────────────── */
.stat-track.has-spark {
  /* Grows to fill leftover card height on tall tiles, shrinks on short ones
     (so the card compresses by trimming the chart, not by clipping text). The
     low min-height lets the bottom row trim its chart instead of overflowing
     and being clipped by the tile on short displays. */
  flex: 1 1 0;
  min-height: 6px;
  height: 44px;          /* preferred height when there's room */
  margin-top: 4px;
  overflow: hidden;
  border-radius: 6px;
  /* faint "see-through" horizontal grid behind the line */
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.055) 0 1px, transparent 1px 11px);
}
.stat-track.has-spark .stat-fill { display: none; }
.stat-spark { width: 100%; height: 100%; display: block; overflow: visible; color: var(--accent); }
/* The sparkline is TWO stacked strokes, and deliberately carries no filter.
   `transition: d` interpolates the path GEOMETRY, which is not compositable: the
   path is re-rasterised on every frame of the transition. A
   `filter: drop-shadow()` on top of that re-ran a gaussian blur on every one of
   those frames, and with a sample arriving each second the 0.6s transition means
   each chart animates ~60% of the time — eight charts on a page kept the GPU
   process busy at ~7% with the renderer idle. The halo is now a wider translucent
   copy of the same path underneath (`.stat-spark-glow`, painted by
   renderStatSpark in js/utils.js), which is one ordinary stroke raster instead of
   an offscreen surface plus a blur pass. Do not put a filter back on either path.
   `stroke-opacity`, not `opacity`: opacity would force its own compositing group. */
.stat-spark-area { display: none; stroke: none; transition: d 0.6s ease; }
.stat-spark-glow,
.stat-spark-line {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transition: d 0.6s ease;
}
.stat-spark-glow {
  stroke-width: 6;
  stroke-opacity: 0.16;
}
.stat-spark-line {
  stroke-width: 2;
}
@media (prefers-reduced-motion: reduce) {
  .stat-spark-area,
  .stat-spark-glow,
  .stat-spark-line { transition: none; }
}
/* The glide is invisible to every freeze mechanism: it is a TRANSITION retriggered
   by each SSE sample (one per second, forever), not an infinite animation, so the
   ambient-idle WAAPI sweep never sees it and it kept re-rasterising both strokes
   at display rate even with the dashboard untouched, under overlays, and in game
   mode. Snap to the new value in those states; the data still updates. */
body.overlay-frozen .stat-spark-area, body.overlay-frozen .stat-spark-glow, body.overlay-frozen .stat-spark-line,
body.ambient-idle .stat-spark-area, body.ambient-idle .stat-spark-glow, body.ambient-idle .stat-spark-line,
body.game-mode .stat-spark-area, body.game-mode .stat-spark-glow, body.game-mode .stat-spark-line,
body.low-power-gpu .stat-spark-area, body.low-power-gpu .stat-spark-glow, body.low-power-gpu .stat-spark-line { transition: none; }

.stat-head-temp {
  padding: 1px 6px 2px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.20);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.3px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.stat-head-temp:empty { display: none; }
.stat-head-temp.amber {
  color: var(--amber);
  background: var(--warning-bg);
  border-color: rgba(var(--warning-rgb), 0.22);
}

.disk-cycle-btn {
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--dim-text);
  display: grid;
  place-items: center;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.disk-cycle-btn:hover { opacity: 1; color: var(--text); }
.disk-cycle-btn svg { width: 12px; height: 12px; fill: currentColor; }

.device-caption {
  margin-top: 2px;
  color: var(--dim-text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}
