* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f5f5f5;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  color: #2563eb;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
}

/* Sourcebot status badge */
.sourcebot-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.sourcebot-status.starting {
  background: #fef3c7;
  color: #d97706;
}

.sourcebot-status.ready {
  background: #d1fae5;
  color: #059669;
}

.sourcebot-status.error {
  background: #fee2e2;
  color: #dc2626;
}

.sourcebot-status.no-docker {
  background: #f3f4f6;
  color: #6b7280;
}

.sourcebot-status.indexing {
  background: #dbeafe;
  color: #2563eb;
}

.sourcebot-status.ready-with-errors {
  background: #fef3c7;
  color: #d97706;
  text-align: left;
  padding: 0.5rem 0.75rem;
}

.sourcebot-status .failed-repos {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  font-weight: 400;
  font-size: 0.7rem;
}

.sourcebot-status .failed-repos li::before {
  content: "\2716 ";
  color: #dc2626;
}

.config-section, .results-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="text"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #2563eb;
}

textarea {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 200px;
}

small {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Recording controls */
.record-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.record-btn {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: #059669;
}

.record-btn:hover {
  background: #047857;
}

.record-btn.recording {
  background: #dc2626;
}

.record-btn.recording:hover {
  background: #b91c1c;
}

.record-status {
  font-size: 0.85rem;
  color: #666;
}

.record-status.active {
  color: #dc2626;
}

.record-status.active::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  margin-right: 0.4rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Interim transcription text */
.interim-text {
  display: block;
  color: #999;
  font-style: italic;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 0.25rem;
}

/* Configured state for repo field */
.form-group.configured input {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.form-group.configured small {
  color: #166534;
}

button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

/* Results */
.results-section h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: #333;
}

.results-section h3:first-child {
  margin-top: 0;
}

/* Summary */
#summary {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: 1rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 1.5rem;
}

#summary p {
  margin: 0;
}

/* Verdict cards */
.verdict-card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: white;
  border-left: 4px solid #e5e5e5;
}

.verdict-card.verdict-confirmed {
  border-left-color: #059669;
}

.verdict-card.verdict-refuted {
  border-left-color: #dc2626;
}

.verdict-card.verdict-partial {
  border-left-color: #d97706;
}

.verdict-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.verdict-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.verdict-badge-confirmed {
  background: #d1fae5;
  color: #059669;
}

.verdict-badge-refuted {
  background: #fee2e2;
  color: #dc2626;
}

.verdict-badge-partial {
  background: #fef3c7;
  color: #d97706;
}

.risk-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.risk-high {
  background: #fee2e2;
  color: #dc2626;
}

.risk-medium {
  background: #fef3c7;
  color: #d97706;
}

.risk-low {
  background: #d1fae5;
  color: #059669;
}

/* Expected vs Actual comparison */
.verdict-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.verdict-expected, .verdict-actual {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.75rem;
  border: 1px solid #e5e5e5;
}

.verdict-expected strong, .verdict-actual strong {
  color: #4b5563;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  display: block;
  margin-bottom: 0.5rem;
}

.verdict-expected pre, .verdict-actual pre {
  margin: 0;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: #1a1a1a;
}

.verdict-detail {
  margin-bottom: 0.625rem;
  line-height: 1.5;
}

.verdict-detail strong {
  color: #4b5563;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.125rem;
}

.verdict-detail span {
  color: #1a1a1a;
}

.mermaid-diagram {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid #e5e5e5;
}

.mermaid-diagram pre {
  margin: 0;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Loading */
#loading {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#loading p {
  margin: 0;
  color: #333;
}

.loading-detail {
  margin-top: 0.5rem !important;
  color: #666 !important;
  font-size: 0.9rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e5e5;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.25rem;
}

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

/* Error */
#error {
  background: #fee2e2;
  color: #dc2626;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #fca5a5;
}

/* Lists */
.questions-list, .steps-list {
  list-style: none;
  padding: 0;
}

.questions-list li, .steps-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
  position: relative;
}

.questions-list li::before {
  content: "?";
  position: absolute;
  left: 0;
  color: #d97706;
  font-weight: 600;
}

.steps-list li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: #2563eb;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .verdict-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .verdict-comparison {
    grid-template-columns: 1fr;
  }
}
