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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
  line-height: 1.6;
}

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

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

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.02em;
}

.subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

/* Form */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.field {
  margin-bottom: 1.5rem;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  resize: vertical;
}

.field input[type="text"]:focus,
.field textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.field textarea {
  line-height: 1.6;
  min-height: 100px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-bottom: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: #374151;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 1rem;
  height: 1rem;
}

.extra-input {
  margin-top: 0.25rem;
  font-size: 0.9rem !important;
  color: #6b7280 !important;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.btn-primary:hover { background: #2563eb; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

/* Two-action button row (Find Evidence / Brainstorm Questions) */
.btn-row {
  display: flex;
  gap: 0.75rem;
}

.btn-row .btn-primary {
  width: auto;
  flex: 1;
}

.btn-secondary {
  background: #eef2ff;
  color: #3730a3;
}

.btn-secondary:hover { background: #e0e7ff; }
.btn-secondary:disabled { background: #eef2ff; color: #a5b4fc; }

.btn-tertiary {
  background: #ecfdf5;
  color: #065f46;
}

.btn-tertiary:hover { background: #d1fae5; }
.btn-tertiary:disabled { background: #ecfdf5; color: #6ee7b7; }

@media (max-width: 520px) {
  .btn-row { flex-direction: column; }
}

/* Status */
.status-section {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 0.75rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid #bfdbfe;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.status-log {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.8;
}

.status-log .log-line::before {
  content: "✓ ";
  color: #10b981;
}

/* Result */
.result-section {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.result-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-copy {
  background: #f3f4f6;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-copy:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.btn-copy.copied {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.result-paragraph {
  font-size: 1rem;
  line-height: 1.8;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.result-paragraph sup {
  color: #3b82f6;
  font-size: 0.75em;
  font-weight: 700;
}

/* Part labels */
.part-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.85rem;
  margin-top: 0.25rem;
}

.part-label--correct {
  background: #d1fae5;
  color: #065f46;
}

.part-label--distractor {
  background: #fef3c7;
  color: #92400e;
  margin-top: 1.75rem;
}

/* Correct-answer banner — states the answer instead of leaving it to be inferred from the
   explanation paragraph. Hidden when the payload carries no answer (older `prompt`-only runs). */
.answer-banner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  border-left: 4px solid #059669;
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  margin-bottom: 1.15rem;
}

.answer-banner-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #047857;
  white-space: nowrap;
}

.answer-banner-text {
  font-size: 1.02rem;
  font-weight: 600;
  color: #064e3b;
  line-height: 1.45;
}

/* Human-in-the-loop revision — feedback panel on each option */
.distractor-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.distractor-head .distractor-title {
  margin-bottom: 0;
  flex: 1 1 auto;
}

.revised-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
}

.btn-feedback,
.btn-link {
  background: none;
  border: none;
  color: #4f46e5;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

/* Keeps the control hard right even when a long option title pushes it onto its own line. */
.btn-feedback { margin-left: auto; }

.btn-feedback:hover,
.btn-link:hover {
  background: #eef2ff;
}

.btn-feedback:disabled,
.btn-link:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

/* .btn-primary is full-width for the page's main actions; inside a feedback panel the buttons
   sit on one row, so the small variant has to opt out of that width. */
.btn-sm {
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
  width: auto;
  border-radius: 6px;
}

.feedback-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.feedback-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
}

.feedback-text,
.feedback-input {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  color: #111827;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  resize: vertical;
}

.feedback-text:focus,
.feedback-input:focus {
  outline: 2px solid #a5b4fc;
  outline-offset: 1px;
  border-color: #6366f1;
}

.feedback-text:disabled,
.feedback-input:disabled {
  background: #f3f4f6;
  color: #6b7280;
}

.feedback-row { display: flex; gap: 0.5rem; }

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feedback-note {
  font-size: 0.78rem;
  color: #6b7280;
  font-style: italic;
}

.feedback-status {
  font-size: 0.82rem;
  color: #4b5563;
  min-height: 1rem;
}

.feedback-status--error { color: #b91c1c; font-weight: 600; }

/* Evidence-checked alternatives offered back to the reviewer */
.option-choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.option-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  background: #f9fafb;
}

.option-choice-title { font-weight: 700; font-size: 0.92rem; color: #111827; }
.option-choice-why { font-size: 0.84rem; color: #4b5563; }

.option-choice-evidence {
  font-size: 0.78rem;
  color: #6b7280;
}

.option-choice-count {
  font-weight: 700;
  color: #047857;
}

.answer-challenge { margin-bottom: 1.15rem; }

/* Distractor cards */
.distractors-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.distractor-card {
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  background: #fffbeb;
}

.distractor-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #92400e;
  margin-bottom: 0.35rem;
}

.distractor-body {
  font-size: 0.93rem;
  color: #1f2937;
  line-height: 1.7;
}

.references-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ref-count {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.references-list {
  list-style: none;
  counter-reset: ref-counter;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.references-list li {
  counter-increment: ref-counter;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9rem;
}

.references-list li::before {
  content: "[" counter(ref-counter) "]";
  color: #3b82f6;
  font-weight: 700;
  min-width: 2rem;
  flex-shrink: 0;
}

.ref-link {
  color: #1d4ed8;
  text-decoration: none;
}

.ref-link:hover {
  text-decoration: underline;
}

.ref-meta {
  color: #6b7280;
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

.hidden { display: none !important; }

/* Error state */
.error-msg {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #991b1b;
  font-size: 0.9rem;
}

/* Evidence Highlights */
.evidence-highlights-section {
  margin: 1.5rem 0;
  border: 1.5px solid #e0e7ff;
  border-radius: 10px;
  overflow: hidden;
}

.evidence-toggle-btn {
  width: 100%;
  background: #eef2ff;
  border: none;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}

.evidence-toggle-btn:hover {
  background: #e0e7ff;
}

.evidence-toggle-label {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3730a3;
}

#evidence-toggle-icon {
  font-size: 0.82rem;
  color: #6366f1;
  font-weight: 500;
}

.evidence-quotes {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #fafafa;
}

.quote-card {
  border-left: 3px solid #6366f1;
  padding: 0.6rem 0.9rem;
  background: #fff;
  border-radius: 0 6px 6px 0;
}

.quote-text {
  font-size: 0.93rem;
  line-height: 1.65;
  color: #1f2937;
  font-style: italic;
  margin: 0 0 0.35rem 0;
}

.quote-source {
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.quote-source-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}

.quote-source-link:hover {
  text-decoration: underline;
}

.quote-tag {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.evidence-toggle-icon {
  font-size: 0.82rem;
  color: #6366f1;
  font-weight: 500;
}

/* Concept (Phase 1 output) */
.concept-section {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.teaching-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.teaching-points li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: #1f2937;
  line-height: 1.65;
}

.teaching-points li::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  color: #3b82f6;
  font-weight: 700;
}

/* Proposed-question cards */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.question-card {
  border: 1.5px solid #d1fae5;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  background: #f7fdfb;
}

.q-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.q-type-badge {
  background: #d1fae5;
  color: #065f46;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.q-stem {
  font-weight: 600;
  font-size: 0.98rem;
  color: #111827;
}

.q-answer {
  font-size: 0.9rem;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

.q-answer-label {
  font-weight: 700;
  color: #065f46;
}

.q-rationale {
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 0.85rem;
}

.q-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.q-actions .btn-primary,
.q-actions .btn-copy {
  width: auto;
  padding: 0.5rem 1.2rem;
}

.q-accept:disabled {
  background: #a7f3d0;
  color: #065f46;
}

/* Skeleton Builder — clickable distractor chips */
.skeleton-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.55rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.option-chip {
  border: 1.5px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.option-chip:hover { background: #e0e7ff; }

.option-chip.selected {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}

.option-chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.skeleton-counter {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 0.75rem;
}

/* Results container — one block per accepted question */
#results-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gen-status { margin-bottom: 0; box-shadow: none; padding: 1.25rem 0 0.5rem; }

/* Coverage callout */
.coverage {
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.coverage--warn {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #92400e;
}

.coverage--ok {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #065f46;
}

.coverage-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.coverage-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.coverage-note {
  color: #78716c;
  font-style: italic;
}

/* ---------------------------------------------------------------- Hint mode */

.btn-quaternary {
  background: #fef3c7;
  color: #92400e;
}

.btn-quaternary:hover { background: #fde68a; }
.btn-quaternary:disabled { background: #fffbeb; color: #d9b382; }

#seed-hint {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  color: #1a1a2e;
  background: #fff;
}

#seed-hint:focus { outline: none; border-color: #f59e0b; }

.label-optional {
  font-weight: 500;
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 0.35rem;
}

.hint-note {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.4rem;
}

.hint-card {
  border-color: #fde68a;
  background: #fffdf7;
}

.badge-seed {
  background: #fde68a;
  color: #92400e;
}

.hint-edit {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: #1a1a2e;
  background: #fff;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.hint-edit:focus { outline: none; border-color: #f59e0b; }

/* Grown to fit by autosize(); the minimum keeps a short hint from looking like an input. */
.hint-edit { overflow: hidden; min-height: 3.4rem; }

.hint-tests,
.hint-based-on {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.hint-based-on { font-style: italic; }

.hint-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.6rem 0 0.75rem;
}

.hint-option-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.hint-key-radio {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #059669;
  cursor: pointer;
}

.hint-option-input {
  flex: 1;
  padding: 0.45rem 0.7rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: #1a1a2e;
}

.hint-option-input:focus { outline: none; border-color: #f59e0b; }

/* The key's own row reads green, matching the correct-answer colour used elsewhere. */
.hint-option-row:has(.hint-key-radio:checked) .hint-option-input {
  border-color: #6ee7b7;
  background: #f0fdf9;
}

.hint-option-remove {
  flex: none;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 5px;
}

.hint-option-remove:hover { color: #dc2626; background: #fef2f2; }

.hint-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.counter-problem { color: #b45309; }

/* Build result */

.verdict-summary {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: #f0fdf9;
  border: 1px solid #d1fae5;
  margin-bottom: 1rem;
}

.verdict-summary.has-attention {
  background: #fffbeb;
  border-color: #fde68a;
}

.verdict-summary-count { font-weight: 600; color: #065f46; }
.verdict-summary.has-attention .verdict-summary-count { color: #78716c; }

.verdict-summary-warn {
  font-weight: 700;
  color: #b45309;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.verdict-icon { font-size: 0.85rem; }

.v-ok   { background: #d1fae5; color: #065f46; }
.v-warn { background: #fde68a; color: #92400e; }
.v-bad  { background: #fee2e2; color: #991b1b; }

.adj-card { border-left: 4px solid #e5e7eb; }
.adj-v-ok   { border-left-color: #10b981; }
.adj-v-warn { border-left-color: #f59e0b; }
.adj-v-bad  { border-left-color: #ef4444; }

.adj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.adj-option {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a2e;
}

.adj-report {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.adj-v-bad .adj-report {
  background: #fef2f2;
  border-color: #fecaca;
}

.adj-report-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 0.3rem;
}

.adj-v-bad .adj-report-title { color: #991b1b; }

.adj-reason,
.adj-advice {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 0.4rem;
}

.adj-advice { font-style: italic; }

.adj-fix {
  background: #fff;
  border: 1px dashed #f59e0b;
  border-radius: 7px;
  padding: 0.6rem 0.75rem;
  margin: 0.5rem 0;
}

.adj-fix-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
  margin-bottom: 0.25rem;
}

.adj-fix-text {
  font-size: 0.9rem;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
}

.adj-recheck { margin-top: 0.6rem; }

.adj-recheck-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.3rem;
}

.adj-recheck-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.adj-recheck-row button { white-space: nowrap; }

@media (max-width: 520px) {
  .adj-recheck-row { flex-direction: column; align-items: stretch; }
}

/* Provenance for a constraint that came from a trial's registered criteria rather than the
   model's inference — the distinction is the whole point, so it is shown, not implied. */
.adj-fix-source {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.adj-fix-source a {
  color: #b45309;
  font-weight: 600;
  text-decoration: none;
}

.adj-fix-source a:hover { text-decoration: underline; }

/* ------------------------------------------------- Per-sentence provenance */

/* Marks sit with the claim rather than under it: a reference list at the foot of a paragraph tells
   you sources exist, not which sentence each one earned. */
.verified-passage .sv { border-radius: 3px; padding: 0 0.1rem; }

.sv-mark {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.15rem;
  vertical-align: super;
  line-height: 1;
}

.sv-mark:disabled { cursor: default; opacity: 0.55; }

/* Verified is deliberately quiet. It is the expected state, and a page of green ticks trains the
   eye to skip exactly the marks that matter. */
.sv-ok   .sv-mark { color: #10b981; }
.sv-none .sv-mark { color: #9ca3af; }
.sv-warn .sv-mark { color: #b45309; }
.sv-bad  .sv-mark { color: #dc2626; }

.sv-warn .sv-text { background: #fffbeb; }
.sv-bad  .sv-text { background: #fef2f2; }

.sv-panel {
  display: block;
  margin: 0.4rem 0 0.6rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 6px 6px 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.sv-warn .sv-panel { border-left-color: #f59e0b; background: #fffbeb; }
.sv-bad  .sv-panel { border-left-color: #ef4444; background: #fef2f2; }

.sv-note { color: #6b7280; font-style: italic; }

.sv-mismatch { color: #92400e; margin-bottom: 0.3rem; }
.sv-field { font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }

.sv-source { margin-top: 0.4rem; }
.sv-pmid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem;
           color: #1d4ed8; text-decoration: none; }
.sv-pmid:hover { text-decoration: underline; }
.sv-quote { color: #374151; margin-top: 0.15rem; }
/* Marks a span this build numbered for itself because the evidence store was unreachable. The
   quote is real; only its durability is missing, so this reads as a note rather than a warning. */
.sv-transient { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: #92400e; background: #fef3c7; border-radius: 3px; padding: 0.05rem 0.3rem;
  margin-right: 0.35rem; vertical-align: 1px; }
