:root {
  --brand: #1e63d0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --danger: #dc2626;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #171a21;
    --text: #e6e8ec;
    --muted: #9aa3af;
    --line: #262b34;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* Respect the iPhone notch and home indicator once installed. */
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-text-size-adjust: 100%;
}

.view { max-width: 460px; margin: 0 auto; padding: 24px 18px 40px; }

.brand { text-align: center; margin: 24px 0 20px; }
.brand img { border-radius: 14px; }
.brand h1 { font-size: 20px; margin: 12px 0 4px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h1 { font-size: 18px; margin: 2px 0 0; }

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

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  /* 16px keeps iOS Safari from zooming the whole page on focus. */
  font-size: 16px;
}

input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  /* Comfortably above the 44px touch target minimum. */
  min-height: 48px;
  width: 100%;
  margin-top: 14px;
}

button:disabled { opacity: .5; cursor: not-allowed; }

.primary { background: var(--brand); color: #fff; font-weight: 600; }
.secondary { background: transparent; border-color: var(--line); color: var(--text); }
.link { background: none; color: var(--muted); min-height: 40px; text-decoration: underline; }
.icon { width: 44px; min-height: 44px; margin: 0; background: none; border: 1px solid var(--line); color: var(--muted); font-size: 18px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }

.clock { text-align: center; }
.clock-time { font-size: 44px; font-weight: 700; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.stat { font-size: 20px; font-weight: 600; margin: 2px 0 0; font-variant-numeric: tabular-nums; }

.split { display: flex; gap: 12px; justify-content: space-around; margin: 20px 0 8px; }
.split > * { flex: 1; }

.location { margin: 14px 0 0; }

.section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; }

.logs { list-style: none; padding: 0; margin: 0; }
.logs li {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}

video { width: 100%; border-radius: 12px; background: #000; margin-top: 12px; }

.offline-bar {
  background: #b45309; color: #fff; text-align: center;
  padding: 10px 16px; font-size: 13px;
  position: sticky; top: 0; z-index: 10;
}

.footnote { margin-top: 26px; text-align: center; }
