:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #1a1d24;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #8b909c;
  --cpu: #4f8cff;
  --gpu: #7ee787;
  --ram: #ffb454;
  --up: #ff6b6b;
  --down: #4fd6ff;
  --bar-bg: #2a2e37;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

#status {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.panel h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel h2 .value {
  color: var(--text);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  float: right;
}

.panel canvas {
  width: 100%;
  height: 180px;
  display: block;
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.disk-row {
  margin-bottom: 12px;
}

.disk-row:last-child {
  margin-bottom: 0;
}

.disk-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}

.disk-label .muted {
  color: var(--muted);
}

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bar-bg);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--cpu);
  transition: width 0.4s ease;
}

.gpu-unavailable {
  color: var(--muted);
  font-size: 13px;
  padding: 32px 0;
  text-align: center;
}

.history-panel {
  margin-top: 16px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.history-header h2 {
  margin: 0;
}

.history-header input[type="date"] {
  background: var(--bar-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

.peaks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.peaks .peak-item strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.history-charts {
  display: grid;
  gap: 20px;
}

.mini-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.history-charts canvas {
  width: 100%;
  height: 140px;
  display: block;
}

