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

body {
  background: #121220;
  color: #d4d4dc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  max-width: 420px;
}

/* === State views (disconnected, loading, idle) === */
.state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
  gap: 8px;
}

.state-icon {
  font-size: 32px;
  opacity: 0.6;
}

.state-label {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e8;
}

.state-hint {
  font-size: 12px;
  color: #6b6b80;
}

/* Spinner */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #2a2a40;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Header === */
#header {
  margin-bottom: 16px;
}

#page-name {
  font-size: 15px;
  font-weight: 700;
  color: #f0f0f8;
  word-break: break-word;
  margin-bottom: 8px;
}

#progress-bar {
  height: 4px;
  background: #2a2a40;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

#progress-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

#progress-text {
  font-size: 11px;
  color: #6b6b80;
  text-align: right;
}

/* === Sections === */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8888a0;
  margin-bottom: 8px;
}

section {
  margin-bottom: 16px;
}

#evidence-summary {
  color: #c0c0d0;
  font-size: 13px;
  line-height: 1.6;
}

/* === Change cards === */
.change-card {
  background: #1a1a2e;
  border: 1px solid #2a2a40;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}

.change-section-name {
  font-size: 12px;
  font-weight: 600;
  color: #a5a5c0;
  margin-bottom: 6px;
}

.change-reason {
  font-size: 12px;
  color: #8888a0;
  margin-bottom: 8px;
  font-style: italic;
}

.diff-block {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 4px;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}

.diff-removed {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-left: 3px solid #ef4444;
}

.diff-added {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-left: 3px solid #22c55e;
}

/* === References === */
#references-list {
  list-style: decimal;
  padding-left: 20px;
}

.reference-item {
  font-size: 12px;
  color: #a0a0b8;
  margin-bottom: 6px;
  line-height: 1.5;
}

.reference-item .ref-author { color: #c0c0d0; }
.reference-item .ref-title { font-style: italic; }
.reference-item .ref-journal { color: #8888a0; }

.reference-item a {
  color: #818cf8;
  text-decoration: none;
}
.reference-item a:hover {
  text-decoration: underline;
}

/* === Feedback === */
#feedback {
  width: 100%;
  background: #1a1a2e;
  border: 1px solid #2a2a40;
  border-radius: 6px;
  color: #d4d4dc;
  font-family: inherit;
  font-size: 13px;
  padding: 8px;
  resize: vertical;
  margin-top: 4px;
}
#feedback:focus {
  outline: none;
  border-color: #6366f1;
}
#feedback::placeholder {
  color: #4a4a60;
}

/* === Action buttons === */
#actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  background: #121220;
  padding: 12px 0;
}

.btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-approve {
  background: #22c55e;
  color: #052e16;
}

.btn-revise {
  background: #f59e0b;
  color: #451a03;
}

.btn-skip {
  background: #3a3a50;
  color: #a0a0b8;
}
