:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2129;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #0b6bcb;
  --hr: #d92d4b;
  --hr-soft: #f4b6c1;
  --steps: #1f9d6b;
  --warning: #b54708;
  --error: #c01048;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #181c22;
    --text: #e6e9ee;
    --muted: #98a2b3;
    --line: #2a3039;
    --accent: #5aa6f0;
    --hr: #ff6b85;
    --hr-soft: #7a2f3d;
    --steps: #3cc68f;
    --warning: #f5a65b;
    --error: #ff7a9a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
main { max-width: 800px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.3rem; margin: 0 0 12px; }
h2 { font-size: 1rem; margin: 0 0 8px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 16px;
}
.narrow { max-width: 380px; margin: 48px auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  color: var(--text); text-decoration: none;
}
.tile .label { color: var(--muted); font-size: 0.875rem; }
.tile .value { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.tile .sub { color: var(--muted); font-size: 0.875rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; margin-top: 0; }
.warning { color: var(--warning); }
.error { color: var(--error); margin: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
input {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
button {
  font: inherit; padding: 8px 14px; border: 0; border-radius: 6px;
  background: var(--accent); color: #fff; cursor: pointer;
}
button.link { background: none; color: var(--accent); padding: 0; }
code { font-size: 0.9em; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 0.875rem; }
.num { text-align: right; }
.card:has(table) { overflow-x: auto; }
.device { padding: 8px 0; border-bottom: 1px solid var(--line); }
.device:last-child { border-bottom: 0; }
.days { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 12px; }
.days h1 { margin: 0; text-align: center; font-size: 1.1rem; }
.days a:last-child { text-align: right; }

/* Charts */
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .hr-line { fill: none; stroke: var(--hr); stroke-width: 1.5; stroke-linejoin: round; }
.chart .hr-dot { fill: var(--hr); }
.chart .hr-range { fill: var(--hr-soft); }
.chart .hr-average { stroke: var(--hr); stroke-width: 2; }
.chart .steps-bar { fill: var(--steps); }
/* Charts scale to the screen width; keep their labels readable on a phone */
@media (max-width: 600px) {
  .chart .axis { font-size: 20px; }
}
