:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --accent: #0a7cff;
  --danger: #d92d20;
  --border: #e5e5ea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #9b9ba1;
    --border: #2c2c2e;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.card h1 { margin-top: 0; font-size: 20px; }
.card label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 16px;
  background: var(--bg);
  color: var(--text);
}
button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
.error { color: var(--danger); font-size: 14px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; }
.page { max-width: 720px; margin: 0 auto; padding: 16px; }
.page.narrow { max-width: 480px; }

.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.camera-card {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
}
.camera-card.disabled { opacity: 0.5; }
.camera-name { font-weight: 600; font-size: 14px; }
.camera-status { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.camera-actions { display: flex; flex-direction: column; gap: 6px; }
.camera-actions form { display: flex; gap: 4px; }
.camera-actions select {
  flex: 1;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 12px;
}
.camera-actions button {
  width: auto;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
}

.events-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.filter-toggle a {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  margin-left: 4px;
}
.filter-toggle a.active { background: var(--accent); color: white; border-color: var(--accent); }

.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  position: relative;
}
.event-row.unreviewed { border-color: var(--accent); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--border); }
.event-info { flex: 1; min-width: 0; }
.event-title { font-weight: 600; font-size: 14px; }
.event-time { font-size: 12px; color: var(--muted); }
.event-tag { font-size: 11px; color: var(--danger); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.empty { color: var(--muted); }

.event-meta { color: var(--muted); margin-top: -8px; }
.player, .snapshot { width: 100%; border-radius: 12px; background: black; }
.hint { font-size: 13px; color: var(--muted); }
