/* Sensor-history charts (guardian-history.js): SVG sparkline trends for the
   hardware-health data collected server-side, rendered inside the System tile's
   History tab. Dense and glanceable. */
.guardian-range { display: inline-flex; gap: 3px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 3px; }
.guardian-range-btn {
  border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit;
  font-weight: 600; font-size: 0.85em; padding: 6px 12px; min-height: 32px; border-radius: 8px;
  transition: background 0.15s ease;
}
.guardian-range-btn:hover { background: rgba(var(--accent-rgb), 0.14); }
.guardian-range-btn.active { background: rgba(var(--accent-rgb), 0.32); }

.guardian-note { opacity: 0.7; font-size: 0.92em; line-height: 1.5; padding: 24px 8px; text-align: center; }

.guardian-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .guardian-charts { grid-template-columns: 1fr; } }

.guardian-chart {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px 6px;
}
.guardian-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.guardian-chart-label { font-size: 0.84em; font-weight: 600; opacity: 0.92; }
.guardian-chart-stat { font-size: 0.76em; opacity: 0.6; white-space: nowrap; }
.guardian-chart-empty { font-size: 0.78em; opacity: 0.5; padding: 18px 0; text-align: center; }

/* The metric's colour lives on the SVG as `color`, not on the stroke, because
   the area fade is a <linearGradient> and a gradient stop takes its colour from
   `currentColor` — there is no way to hand it one from CSS otherwise. Stroke and
   fade then cannot drift apart: they are the same declaration. */
.guardian-svg { width: 100%; height: 84px; display: block; color: rgba(var(--accent-rgb), 0.95); }
.guardian-svg-cpu { color: #5cc8ff; }
.guardian-svg-gpu { color: #ff9d57; }
.guardian-svg-ram { color: #a78bfa; }
.guardian-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
/* Decoration under the curve, not a second series: it fades out downward and
   never crosses the line. `fill` comes from the gradient set on the element. */
.guardian-area { stroke: none; }
.guardian-tick { font-size: 8px; fill: rgba(255, 255, 255, 0.4); }

.guardian-foot { margin-top: 14px; font-size: 0.74em; opacity: 0.5; text-align: center; }

/* Sensor-history tab inside the System tile — reuses the .guardian-chart* / .guardian-svg
   / .guardian-range classes above; these rules only re-home the layout so the charts
   sit in the tile. */
/* `display: flex` here would override the `hidden` attribute's UA `display: none`
   (author rules win over the UA sheet), leaving the pane always visible and its
   charts bleeding into the Sistema tab — so restore hiding explicitly. */
.system-history-pane[hidden] { display: none !important; }
.system-history-pane { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.sys-history-head { display: flex; justify-content: flex-end; flex: 0 0 auto; }
.sys-history-body { padding: 2px 0 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
/* Tighter two-up charts for the tile; collapse to one column when narrow. */
.sys-history-body .guardian-charts { gap: 10px; }
@media (max-width: 380px) { .sys-history-body .guardian-charts { grid-template-columns: 1fr; } }
.sys-history-body .guardian-foot { margin-top: 10px; }

/* PC Screen Time — top foreground apps for the active range as a bar list. */
.screentime { margin-top: 16px; }
.screentime-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.screentime-title { font-size: 0.86em; font-weight: 600; opacity: 0.92; }
.screentime-total { font-size: 0.78em; opacity: 0.62; white-space: nowrap; }
.screentime-empty { font-size: 0.78em; opacity: 0.5; padding: 12px 0; text-align: center; }

.screentime-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.screentime-row { display: grid; grid-template-columns: minmax(84px, 34%) 1fr auto; align-items: center; gap: 10px; }
.screentime-name {
  font-size: 0.8em; font-weight: 500; opacity: 0.92; text-transform: capitalize;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screentime-badge { margin-left: 4px; font-size: 0.9em; }
.screentime-bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.screentime-fill {
  display: block; height: 100%; border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.7);
}
.screentime-row.is-game .screentime-fill { background: rgba(255, 157, 87, 0.8); }
.screentime-time { font-size: 0.76em; opacity: 0.7; white-space: nowrap; font-variant-numeric: tabular-nums; }
