:root {
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --panel: #ffffff;
  --border: #cbd5e1;
  --accent: #0f766e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 920px;
  margin: 32px auto;
  padding: 0 16px;
}

h1 {
  margin: 0 0 20px;
}

label {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  background: var(--panel);
}

#question {
  min-height: 120px;
  resize: vertical;
}

#answerBox {
  min-height: 320px;
  resize: vertical;
}

button {
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
}

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

.answer-wrapper {
  margin-top: 20px;
}

.answer-field {
  position: relative;
}

.overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 5px solid #dbe3ec;
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sources {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.sources a {
  color: #0b4ab8;
  text-decoration: none;
}

.sources a:hover {
  text-decoration: underline;
}
