:root {
  color-scheme: light dark;
  --bg: #f5f5f4;
  --fg: #1a1a1a;
  --card-bg: #ffffff;
  --border: #ddd;
  --accent: #2563eb;
  --muted: #777;
  --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --fg: #eee;
    --card-bg: #232323;
    --border: #3a3a3a;
    --accent: #60a5fa;
    --muted: #999;
    --error: #f87171;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}
main { max-width: 800px; margin: 0 auto; padding: 24px 16px 64px; }
.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}
.topnav .brand { font-weight: 700; }
.topnav .links { display: flex; gap: 12px; flex: 1; }
.topnav a { color: var(--accent); text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.logout-form { display: flex; align-items: center; gap: 8px; }
.whoami { color: var(--muted); font-size: 0.9em; }
.center-box {
  max-width: 340px;
  margin: 64px auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.hint { color: var(--muted); font-size: 0.9em; margin-top: -8px; }
h1 { margin-top: 0; }
label { display: block; margin-bottom: 14px; font-size: 0.9em; }
input[type=text], input[type=password], textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
}
button {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
.link-btn {
  background: none;
  color: var(--error);
  padding: 0;
  text-decoration: underline;
  font-size: 0.85em;
}
.error { color: var(--error); }
.muted { color: var(--muted); font-size: 0.85em; }
.topic-list, .camera-list { list-style: none; padding: 0; }
.topic-list li, .camera-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.topic-head { display: flex; align-items: center; gap: 10px; }
.topic-content { margin-top: 6px; white-space: pre-wrap; font-size: 0.95em; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; }
.stacked-form { max-width: 420px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }
.user-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.user-table th, .user-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }

/* --- landing / login screen --- */
.landing-body {
  margin: 0;
  background: #000;
  height: 100vh;
  overflow: hidden;
}
.landing-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.hotspot {
  position: absolute;
  left: 53.5%;
  top: 40%;
  width: 16%;
  height: 17.5%;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.hotspot:hover, .hotspot:focus-visible {
  background: rgba(96, 165, 250, 0.12);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.6);
  outline: none;
}
.login-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.login-modal.open { display: flex; }
.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.login-box {
  position: relative;
  z-index: 1;
  margin: 0;
}
.token-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  overflow-x: auto;
  user-select: all;
}
