:root {
  color-scheme: dark;
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #3fb950;
  --cyan: #39c5cf;
  --orange: #f0883e;
  --gray: #484f58;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1a2332 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.header { margin-bottom: 1.5rem; }
.header.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 650;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.lede { color: var(--muted); margin: 0.5rem 0 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

.device-list { display: grid; gap: 0.75rem; }

.device-link {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  background: #0d1117;
}

.device-link:hover {
  border-color: var(--cyan);
  text-decoration: none;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

input[type="text"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
}

button {
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #21262d;
  color: var(--text);
  cursor: pointer;
}

button:hover { border-color: var(--cyan); }

.help ol { margin: 0; padding-left: 1.2rem; }
.help li { margin: 0.35rem 0; }
.help code {
  background: #0d1117;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.85em;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.ring-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0.5rem 0;
}

.ring { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 10;
}

.ring-track { stroke: #21262d; }

.ring-fill {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 650;
}

.current {
  font-size: 1.5rem;
  margin: 0.25rem 0 1rem;
  font-variant-numeric: tabular-nums;
}

.pills { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

.pill {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #21262d;
  font-size: 0.875rem;
}

.pill.ok { background: rgba(63, 185, 80, 0.18); color: var(--green); }
.pill.bad { color: var(--muted); }

.stats {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.stats dt { color: var(--muted); margin: 0; }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }

.hourly-chart {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 160px;
  padding-top: 0.5rem;
}

.hourly-chart .bar {
  background: linear-gradient(180deg, var(--orange), #9a4b12);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .header.row { flex-direction: column; }
}
