/*
 * Deliberately small. A dark room and a TV in it is the context this is designed for, so
 * the palette is dark and the contrast is high — and every size is in rem so the page
 * follows the viewer's own browser setting rather than assuming one.
 */

:root {
  color-scheme: dark;
  --bg: #10131a;
  --panel: #181d27;
  --line: #2b3240;
  --text: #eef1f6;
  --muted: #9aa4b5;
  --accent: #7fd1c1;
  --pending: #d9a441;
  --error: #e88a8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#app {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1.5rem 0 0.5rem;
}

.header-line {
  color: var(--muted);
  margin: 0;
}

.summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.summary h2 {
  margin-top: 0;
}

.summary-text {
  margin: 0;
  font-size: 1.05rem;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.event {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.event--pending {
  border-left: 3px solid var(--pending);
}

.event-header {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.event-time {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.event-subtype {
  text-transform: capitalize;
}

.event-device {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: auto;
}

.event-description {
  margin: 0.4rem 0 0;
}

.event-snapshot {
  margin: 0.75rem 0 0;
}

.event-snapshot img {
  width: 100%;
  max-width: 20rem;
  border-radius: 0.375rem;
  display: block;
}

.empty {
  color: var(--muted);
}

.error {
  background: var(--panel);
  border: 1px solid var(--error);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.error h2 {
  color: var(--error);
  margin-top: 0;
}

.error-detail {
  color: var(--muted);
  font-size: 0.9rem;
}

.demo-banner {
  max-width: 44rem;
  margin: 1.5rem auto 0;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

#controls {
  max-width: 44rem;
  margin: 1.5rem auto 3rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
}

#controls label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

#controls input {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

#controls button {
  font: inherit;
  padding: 0.4rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  align-self: end;
}

@media (max-width: 34rem) {
  #controls {
    grid-template-columns: 1fr;
  }
}