body {
  margin: 0;
  font-family: sans-serif;
  background: #0f1115;
  color: #f2f2f2;
}

.wrap {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 16px;
}

.video-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #333;
  border-radius: 10px;
  background: #1a1f27;
  overflow: hidden;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-box {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.chat-box input {
  flex: 1;
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px;
}

.messages {
  margin-top: 14px;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 10px;
  background: #0b1220;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag {
  margin-top: 12px;
  border: 1px solid #1f2937;
  border-radius: 10px;
  background: #0b0d12;
  padding: 10px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.diag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d1d5db;
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #4b5563;
  box-shadow: 0 0 0 1px #374151 inset;
}

.dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 1px #166534 inset;
}

.dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 0 1px #92400e inset;
}

.dot.bad {
  background: #ef4444;
  box-shadow: 0 0 0 1px #991b1b inset;
}

.msg {
  max-width: 80%;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg.user {
  align-self: flex-end;
  background: #1d4ed8;
}

.msg.ai {
  align-self: flex-start;
  background: #374151;
}

.panel {
  margin-top: 14px;
}

.metrics {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.metric {
  border: 1px solid #1f2937;
  background: #0b0d12;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric span {
  color: #9ca3af;
  font-size: 12px;
}

.metric strong {
  font-size: 14px;
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #9ca3af;
}

button {
  background: #2563eb;
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.neutral {
  background: #111827;
  border-color: #374151;
  color: #d1d5db;
}

.badge.ok {
  background: #052e16;
  border-color: #166534;
  color: #86efac;
}

.badge.warn {
  background: #3f1d0a;
  border-color: #92400e;
  color: #fdba74;
}

.msg.system {
  align-self: center;
  background: #1f2937;
  color: #d1d5db;
  font-size: 12px;
}

.msg-time {
  font-size: 11px;
  color: #9ca3af;
}

.msg-time.user {
  align-self: flex-end;
}

.msg-time.ai {
  align-self: flex-start;
}

.msg-time.system {
  align-self: center;
}

pre {
  margin-top: 0;
  background: #0b0d12;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
}
