:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e0f13;
  color: #e8eaf0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app {
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#orbCanvas {
  filter: drop-shadow(0 0 24px rgba(110, 231, 255, 0.35));
}

.status {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.status--idle {
  color: #8b92a5;
}

.status--speaking {
  color: #6ee7ff;
}

.status--error {
  color: #ff6e6e;
}

.answer-source {
  width: 100%;
  margin: -4px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #262a35;
  background: #16181f;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* RAG, grounded: retrieval found relevant context and answered from it. */
.answer-source--rag {
  color: #7ee787;
  border-color: rgba(126, 231, 135, 0.35);
}

/* RAG, blocked: nothing relevant enough -> abstained without calling the LLM. */
.answer-source--blocked {
  color: #ffb86e;
  border-color: rgba(255, 184, 110, 0.35);
}

/* Direct LLM, no retrieval at all. */
.answer-source--gpt {
  color: #8b92a5;
}

.transcript-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: -8px;
  font-size: 13px;
  color: #8b92a5;
  letter-spacing: 0.02em;
}

.transcript-header button {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #262a35;
  background: transparent;
  color: #8b92a5;
  font-size: 12px;
  cursor: pointer;
}

.transcript-header button:hover {
  color: #e8eaf0;
  border-color: #3a3f4d;
}

.transcript {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px 14px;
  background: #16181f;
  border: 1px solid #262a35;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: #d6d9e3;
}

.prompt-form {
  width: 100%;
  display: flex;
  gap: 8px;
}

.prompt-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #262a35;
  background: #16181f;
  color: #e8eaf0;
  font-size: 15px;
}

.prompt-form input:focus {
  outline: none;
  border-color: #6ee7ff;
}

.prompt-form button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #6ee7ff;
  color: #0e0f13;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.prompt-form button:disabled,
.prompt-form input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#stopBtn {
  background: #ff6e6e;
  color: #1a0e0e;
}

#micBtn {
  background: #262a35;
  color: #e8eaf0;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1;
}

#micBtn.recording {
  background: #ff6e6e;
  color: #1a0e0e;
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 110, 110, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 110, 110, 0);
  }
}
