*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f0f12;
  color: #e8e8ec;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #2a2a32;
  background: #14141a;
}

header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.badge {
  font-size: 0.8rem;
  color: #9ca3af;
}

.status {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #1f1f28;
  border: 1px solid #333;
}

.status.connected {
  color: #4ade80;
  border-color: #166534;
}

.status.error {
  color: #f87171;
  border-color: #7f1d1d;
}

main {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: #14141a;
  border: 1px solid #2a2a32;
  border-radius: 12px;
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid #2a2a32;
  color: #9ca3af;
}

.video-wrap {
  aspect-ratio: 16 / 9;
  background: #0a0a0e;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.placeholder {
  color: #6b7280;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.controls {
  margin-top: 1rem;
  padding: 1rem;
  background: #14141a;
  border: 1px solid #2a2a32;
  border-radius: 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

button {
  cursor: pointer;
  border: 1px solid #3f3f4a;
  background: #1f1f28;
  color: #e8e8ec;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

button:hover:not(:disabled) {
  background: #2a2a36;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: #4f46e5;
}

button.danger {
  background: #7f1d1d;
  border-color: #991b1b;
}

.prompt-row {
  display: flex;
  gap: 0.5rem;
}

.prompt-row input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #3f3f4a;
  background: #0f0f12;
  color: #e8e8ec;
  font-size: 0.95rem;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.quick-prompts button {
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}

.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.5;
}

.hint code {
  background: #1f1f28;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.setup-error {
  margin: 1rem 1.5rem;
  padding: 1rem;
  background: #1c1010;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  color: #fca5a5;
  display: none;
}

.setup-error.visible {
  display: block;
}
