:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #5d6573;
  --line: #dde1e7;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --danger: #c2332b;
  --ok: #15803d;
  --warn: #b45309;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --card: #1b1e24;
    --text: #e7e9ee;
    --muted: #9aa2b1;
    --line: #2d323b;
    --accent: #4f8cff;
    --danger: #ef5b52;
    --ok: #3fbf6c;
    --warn: #e19a3c;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 520px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
h1 { font-size: 22px; margin: 8px 0; }
h2 { font-size: 17px; margin: 0 0 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
input, select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.row select { width: auto; margin: 0; flex: 1; }
button {
  font: inherit;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button:disabled { opacity: .45; cursor: default; }
button.danger { background: var(--danger); }
button.link { background: none; color: var(--accent); padding: 6px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted, .hint { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); min-height: 1em; margin: 8px 0 0; font-size: 14px; }
.error:empty { display: none; }
.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid currentColor;
}
.badge.running { color: var(--ok); }
.badge.stopped { color: var(--muted); }
.badge.pending, .badge.stopping { color: var(--warn); }
.countdown { font-size: 20px; font-variant-numeric: tabular-nums; margin: 12px 0; }
.countdown:empty { display: none; }
.emails label { display: flex; gap: 8px; align-items: center; color: var(--text); }
.emails input { display: inline; width: auto; margin: 0; }
.events { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.events li { padding: 6px 0; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.events time { color: var(--muted); margin-right: 6px; }
[hidden] { display: none !important; }
