:root {
  --bg: #f6f6f7;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e3e4e8;
  --accent: #1f6feb;
  --ok: #10794a;
  --warn: #a25200;
  --bad: #b3261e;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e9eaee;
    --muted: #9aa1ae;
    --line: #262a33;
    --accent: #4b90f7;
    --ok: #46c98b;
    --warn: #e0a44a;
    --bad: #f2776c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 { font-size: 20px; margin: 0 0 16px; }

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.head h1 { margin-bottom: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }

.label { color: var(--muted); font-size: 14px; }
.value { font-weight: 600; font-size: 15px; text-align: right; }
.value.muted { font-weight: 400; color: var(--muted); }
.value.ok { color: var(--ok); }
.value.warn { color: var(--warn); }
.value.bad { color: var(--bad); }

.buttons {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

button {
  font: inherit;
  border-radius: 12px;
  padding: 15px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 52px;
}
button:disabled { opacity: .45; cursor: default; }

.primary { background: var(--accent); color: #fff; }
.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.link {
  background: none;
  border: none;
  color: var(--muted);
  padding: 4px;
  min-height: 0;
  text-decoration: underline;
  font-size: 14px;
}

form { display: grid; gap: 6px; }
label { font-size: 14px; color: var(--muted); margin-top: 8px; }
input {
  font: inherit;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
form button { margin-top: 16px; }

.hint { color: var(--muted); font-size: 14px; margin: 12px 2px; }
.error { color: var(--bad); font-size: 14px; margin: 12px 2px; }

.video-box {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}
video { width: 100%; height: 100%; object-fit: contain; display: none; }
video.live { display: block; }
.placeholder { color: #6b7280; font-size: 14px; text-align: center; padding: 0 20px; margin: 0; }
