:root {
  --bg: #0e0f12;
  --panel: #17191e;
  --line: #2a2d35;
  --text: #f2f2f0;
  --muted: #9a9ca3;
  --accent: #f5a524;
  --accent-ink: #1a1203;
  --live: #3ccf7a;
  --bad: #ff5d5d;
  --warn: #f5c542;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 17px; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* Sign-in */
.gate { display: grid; place-items: center; padding: 60px 16px; }
.gate-card { width: 100%; max-width: 380px; display: grid; gap: 12px; }
.gate-card h1 { margin: 0; font-size: 22px; }

/* App */
.app { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 16px; }

.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.screen {
  position: relative;
  margin: 0;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.screen figcaption {
  position: absolute; left: 10px; bottom: 8px;
  font-size: 12px; color: #fff; background: rgba(0,0,0,.55);
  padding: 2px 8px; border-radius: 6px;
}
.ai-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 12px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent); padding: 3px 9px; border-radius: 6px;
}

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.status-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status { font-weight: 600; }
.status::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); margin-right: 8px; vertical-align: middle;
}
.status[data-kind="live"]::before { background: var(--live); box-shadow: 0 0 8px var(--live); }
.status[data-kind="busy"]::before { background: var(--accent); }
.status[data-kind="warn"]::before { background: var(--warn); }
.status[data-kind="bad"] { color: var(--bad); }
.status[data-kind="bad"]::before { background: var(--bad); }
.time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.controls .card { display: grid; gap: 10px; align-content: start; }

label { font-size: 13px; color: var(--muted); }
input[type="password"], select, textarea {
  width: 100%; background: #0b0c0f; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="file"] { color: var(--muted); font-size: 13px; max-width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.check input { margin-top: 3px; accent-color: var(--accent); }
.consent { font-size: 13px; }
.preview { max-height: 140px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; justify-self: start; }
.row { display: flex; gap: 8px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 9px 16px; border: 1px solid var(--line);
  background: #23262d; color: var(--text);
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.muted { color: var(--muted); margin: 0; font-size: 13px; }
.error { color: var(--bad); margin: 0; min-height: 1.2em; font-size: 13px; }

.foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

@media (max-width: 760px) {
  .stage, .controls { grid-template-columns: 1fr; }
  .top { padding: 12px 16px; }
}
