*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
}

[data-theme="dark"] {
  --bg: #111827;
  --card: #1f2937;
  --border: #374151;
  --text: #f9fafb;
  --muted: #9ca3af;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 0 1px rgba(0,0,0,.25);
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.logo-icon { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.site-name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.header-btn:hover { background: var(--bg); color: var(--text); }
.header-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.header-btn svg { width: 17px; height: 17px; }

/* A header control that shows a text label beside its icon, for a destination
   that would not be guessable from an icon alone. Overrides the fixed 34px
   square of .header-btn while keeping its height, border, and hover treatment. */
.header-btn--labeled {
  width: auto;
  gap: 7px;
  padding: 0 11px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.header-btn--labeled:hover { border-color: var(--primary); color: var(--primary); }
.header-btn__label { line-height: 1; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }

/* ── Language selector ────────────────────────── */
.lang-select-wrap { display: flex; align-items: center; flex-shrink: 0; }
/* The <label> stays in the accessibility tree for screen readers but is hidden
   visually — the option text ("English" / "Español") already names the control. */
.lang-select-label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.lang-select {
  height: 34px;
  padding: 0 26px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  /* Custom chevron so the control matches the icon buttons in both themes. */
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.lang-select:hover { background-color: var(--bg); color: var(--text); }
.lang-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Options render in the OS menu — force readable colors in dark mode. */
.lang-select option { color: initial; }

/* ── Main layout ──────────────────────────────── */
.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

/* ── Intro ────────────────────────────────────── */
.intro { margin-bottom: 24px; }
.intro__title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.intro__subtitle { color: var(--muted); margin-top: 6px; font-size: 1rem; }

/* ── Card ─────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ── Input tabs ───────────────────────────────── */
.input-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.input-tab {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.input-tab:hover { color: var(--text); }
.input-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.input-tab--active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── URL input ────────────────────────────────── */
.url-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.url-input::placeholder { color: #9ca3af; }
.url-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
  background: #fff;
}

/* ── Textarea ─────────────────────────────────── */
.claim-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  resize: vertical;
  min-height: 120px;
  line-height: 1.65;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.claim-textarea::placeholder { color: #9ca3af; }
.claim-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
  background: #fff;
}

.helper-text {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── Claim length counter ─────────────────────── */

/* Helper text and counter share a row, with the counter pinned right. It wraps
   to its own line on narrow screens rather than squeezing the helper text. */
.claim-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.claim-meta .helper-text {
  flex: 1 1 220px;
  margin-bottom: 0;
}

.char-counter {
  margin-top: 8px;
  flex: 0 0 auto;
  font-size: 0.8125rem;
  /* Tabular figures stop the counter jittering sideways as digits change. */
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Over the limit. Colour is the fast signal, but it is not the only one — the
   Analyze button also refuses and states the limit in words, so this reads the
   same to anyone who cannot distinguish the two colours. */
.char-counter--over {
  color: #dc2626;
  font-weight: 600;
}

/* ── Field error ──────────────────────────────── */
.field-error {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #dc2626;
}

/* ── Controls ─────────────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.academic-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.academic-label input { cursor: pointer; accent-color: var(--primary); }

/* ── Button ───────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Status / loading ─────────────────────────── */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error banner ─────────────────────────────── */
.error-banner {
  margin-top: 16px;
  padding: 14px 18px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: #dc2626;
  line-height: 1.5;
}

/* ── Results wrapper ──────────────────────────── */
#results { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }

/* ── Shared section ───────────────────────────── */
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Extracted claim ──────────────────────────── */
.claim-text-display {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.65;
}

/* ── Claim breakdown ──────────────────────────── */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.breakdown-item { display: flex; flex-direction: column; gap: 3px; }
.breakdown-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.breakdown-value { font-size: 0.875rem; color: var(--text); line-height: 1.5; }

/* ── Evidence match ("close the loop") ────────── */
.evidence-match {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  background: var(--bg);
}
.evidence-match__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.evidence-match__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.evidence-match__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.evidence-match__icon { font-weight: 800; }
.evidence-match__note {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}
.evidence-match--found     { border-left-color: #16a34a; }
.evidence-match--partial   { border-left-color: #d97706; }
.evidence-match--not-found { border-left-color: #dc2626; }
.evidence-match--found     .evidence-match__pill { background: #dcfce7; color: #15803d; }
.evidence-match--partial   .evidence-match__pill { background: #fef3c7; color: #b45309; }
.evidence-match--not-found .evidence-match__pill { background: #fee2e2; color: #b91c1c; }

/* ── Verdict card ─────────────────────────────── */
.verdict-card {
  border-left: 4px solid transparent;
}
.verdict-card.verdict--supported  { border-left-color: #16a34a; }
.verdict-card.verdict--contradicted { border-left-color: #dc2626; }
.verdict-card.verdict--unclear    { border-left-color: #d97706; }

.verdict-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.verdict--supported  .verdict-badge { background: #dcfce7; color: #15803d; }
.verdict--contradicted .verdict-badge { background: #fee2e2; color: #b91c1c; }
.verdict--unclear    .verdict-badge { background: #fef3c7; color: #b45309; }

.verdict-summary-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.verdict-explanation {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.65;
}
.uncertainty-notes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Snapshot summary card ────────────────────── */
.snapshot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.snapshot-card--supported    { border-left-color: #16a34a; }
.snapshot-card--contradicted { border-left-color: #dc2626; }
.snapshot-card--unclear      { border-left-color: #d97706; }

.snapshot-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.snapshot-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.snapshot-card__badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.snapshot-card .verdict-badge { margin-bottom: 0; }
.snapshot-card--supported    .verdict-badge { background: #dcfce7; color: #15803d; }
.snapshot-card--contradicted .verdict-badge { background: #fee2e2; color: #b91c1c; }
.snapshot-card--unclear      .verdict-badge { background: #fef3c7; color: #b45309; }

.confidence-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.confidence-pill--high   { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.confidence-pill--medium { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.confidence-pill--low    { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.snapshot-card__claim {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 6px;
}
.snapshot-card__takeaway {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
}
.snapshot-flag {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
}
.snapshot-flag--ok   { background: #f0fdf4; color: #15803d; }
.snapshot-flag--note { background: #eff6ff; color: #1d4ed8; }
.snapshot-flag--warn { background: #fffbeb; color: #b45309; }
.snapshot-flag__icon { font-weight: 700; }
.snapshot-card__foot {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Run-full-analysis upgrade prompt (snapshot mode) */
.snapshot-upgrade { text-align: center; padding: 8px 0 4px; }
.snapshot-upgrade__note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Evidence ─────────────────────────────────── */
.evidence-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.evidence-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.evidence-item:last-child { padding-bottom: 0; border-bottom: none; }

.evidence-summary {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}
.evidence-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.evidence-source {
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
}
.evidence-source:hover { text-decoration: underline; }
.evidence-source-name { font-size: 0.82rem; color: var(--muted); }
.credibility-note {
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.empty-state {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Credibility badge ────────────────────────── */
.cred {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.cred-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cred--high     { background: #f0fdf4; color: #15803d; }
.cred--high     .cred-dot { background: #16a34a; }
.cred--medium   { background: #eff6ff; color: #1d4ed8; }
.cred--medium   .cred-dot { background: #3b82f6; }
.cred--low      { background: #f9fafb; color: #9ca3af; }
.cred--low      .cred-dot { background: #9ca3af; }
.cred--unknown  { background: #f9fafb; color: #9ca3af; }
.cred--unknown  .cred-dot { background: #d1d5db; }

/* Source type — WHAT KIND of source, a separate axis from credibility above.
   Outlined rather than filled so the two badges never read as one rating. */
.srctype {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid currentColor;
  background: transparent;
  flex-shrink: 0;
}
.srctype--scholarly  { color: #7e22ce; }
.srctype--official   { color: #0f766e; }
.srctype--reporting  { color: #1d4ed8; }
.srctype--interested { color: #b45309; }
.srctype--other      { color: #9ca3af; }

/* ── Relevance ────────────────────────────────── */
/* A source that answers a nearby question rather than the claim itself. Marked
   inline, where the student reads the source, not tucked into a badge row. */
.evidence-item--indirect { opacity: 0.92; }
.relevance-flag {
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 6px 0 0;
  padding: 6px 9px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  border-radius: 0 5px 5px 0;
  color: var(--text);
}
.relevance-flag--background { border-left-color: #9ca3af; background: #f9fafb; }
.relevance-flag__label { font-weight: 700; color: #b45309; }
.relevance-flag--background .relevance-flag__label { color: #6b7280; }

.filter-notice--relevance { border-color: #fbbf24; }

/* ── Academic filter notice ───────────────────── */
.filter-notice {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 4px 0;
}
.filter-notice__head {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
  margin: 0 0 4px;
}
.filter-notice__body {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}
.filter-notice__domains {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 6px 0 0;
  word-break: break-word;
}

/* ── Reflection questions ─────────────────────── */
.reflection-list {
  list-style: disc;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.reflection-list li { font-size: 0.9rem; color: var(--text); }

/* ── Identity lens ────────────────────────────── */
.identity-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.identity--flagged .identity-badge { background: #fff7ed; color: #c2410c; }
.identity--about   .identity-badge { background: #eff6ff; color: #1d4ed8; }
.identity--clean   .identity-badge { background: #f0fdf4; color: #15803d; }

.identity-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin: -2px 0 10px;
}
.identity-readout {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}

.identity-analysis { font-size: 0.9rem; color: var(--text); line-height: 1.6; }

.identity-subgroup {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.identity-sublabel {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 7px;
}
.identity-tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.identity-tag {
  font-size: 0.8rem;
  background: #f3f4f6;
  color: var(--text);
  padding: 2px 9px;
  border-radius: 4px;
}
.pattern-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pattern-item { font-size: 0.875rem; color: var(--text); line-height: 1.5; }
.pattern-name { font-weight: 600; }
.pattern-explain { color: var(--muted); }

.identity-caution {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #c2410c;
  font-style: italic;
}

/* ── Context Lens ─────────────────────────────── */
.context-lens {
  padding: 0;
  overflow: hidden;
  border: 1px solid #c7d2fe;
  background:
    linear-gradient(180deg, rgba(99,102,241,0.06), rgba(99,102,241,0) 90px),
    var(--card);
}
.context-lens__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
}
.context-lens__icon { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.context-lens__titlewrap { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.context-lens__title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #4338ca;
}
.context-lens__subtitle { font-size: 0.78rem; color: var(--muted); }
.context-lens__chevron {
  font-size: 1.4rem;
  color: #6366f1;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.context-lens--open .context-lens__chevron { transform: rotate(90deg); }

.context-lens__body {
  padding: 4px 20px 20px;
  border-top: 1px solid #e0e7ff;
}
.context-lens__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
  margin: 16px 0 7px;
}
.context-lens__paragraph { font-size: 0.9rem; color: var(--text); line-height: 1.65; }
.context-lens__list {
  list-style: disc;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.context-lens__list li { font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.context-lens__list--questions { list-style: none; padding-left: 0; gap: 8px; }
.context-lens__list--questions li {
  padding: 9px 12px;
  background: rgba(99,102,241,0.07);
  border-left: 3px solid #6366f1;
  border-radius: 0 6px 6px 0;
}
.context-lens__warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
}
.context-lens__warning-icon { color: #c2410c; flex-shrink: 0; }
.context-lens__warning-text { font-size: 0.85rem; color: #9a3412; line-height: 1.5; }
.context-lens__fallback {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Meta row ─────────────────────────────────── */
.meta-row {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  padding: 4px 0;
}

/* ── Shared-analysis banner ───────────────────── */
.shared-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: #1e40af;
}
.shared-banner__text { flex: 1; line-height: 1.5; }
.shared-banner__dismiss {
  border: none;
  background: transparent;
  color: #1e40af;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.shared-banner__dismiss:hover { color: #1e3a8a; }

/* ── Prediction panel ─────────────────────────── */
.predict-panel {
  margin-top: 16px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.predict-panel__prompt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.predict-panel__options {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.predict-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.predict-btn:hover { border-color: var(--primary); background: #fff; }
.predict-btn:active { transform: translateY(1px); }
.predict-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.predict-btn[data-prediction="true"]:hover  { border-color: #16a34a; color: #15803d; }
.predict-btn[data-prediction="false"]:hover { border-color: #dc2626; color: #b91c1c; }
.predict-panel__hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Prediction recap ─────────────────────────── */
.predict-recap { border-left: 4px solid var(--border); }
.predict-recap--match    { border-left-color: #16a34a; }
.predict-recap--mismatch { border-left-color: #d97706; }
.predict-recap--partial  { border-left-color: #6b7280; }

.predict-recap__row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.predict-recap__col { display: flex; flex-direction: column; gap: 5px; }
.predict-recap__collabel {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.predict-recap__arrow { color: var(--muted); font-size: 1.1rem; }
.predict-recap__note {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
}

.predict-chip {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--text);
}
.predict-chip--true  { background: #dcfce7; color: #15803d; }
.predict-chip--false { background: #fee2e2; color: #b91c1c; }
.predict-chip--unsure { background: #f3f4f6; color: #4b5563; }
.predict-chip--verdict-supported    { background: #dcfce7; color: #15803d; }
.predict-chip--verdict-contradicted { background: #fee2e2; color: #b91c1c; }
.predict-chip--verdict-unclear      { background: #fef3c7; color: #b45309; }

/* ── Results actions ──────────────────────────── */
.results-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-share {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  box-shadow: var(--shadow);
}
.btn-share:hover { border-color: var(--primary); background: #f8faff; }
.btn-share:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-share--done { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.btn-share--error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.btn-share:disabled { opacity: 0.6; cursor: progress; }
.results-actions { flex-wrap: wrap; }

/* ── Article source header (URL analyses) ─────── */
.article-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.article-header__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.article-header__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.4;
}
.article-header__source {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}
.article-header__source:hover { text-decoration: underline; }

/* ── Secondary claims ─────────────────────────── */
.secondary-claims-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}
.secondary-claims-list li {
  margin-bottom: 6px;
  line-height: 1.55;
  font-size: 0.9375rem;
}

/* ── Starter library ──────────────────────────── */
.library { margin-top: 12px; }
.library__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
}
.library__toggle:hover { text-decoration: underline; }
.library__toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.library__chevron {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s;
}
.library__toggle--open .library__chevron { transform: rotate(90deg); }

.library__panel {
  margin-top: 10px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.library__category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 8px;
}
.library__claims { display: flex; flex-direction: column; gap: 6px; }
.library__claim {
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text);
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.library__claim:hover { border-color: var(--primary); background: #fff; }
.library__claim:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── History overlay ──────────────────────────── */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}
.history-panel {
  background: var(--card);
  width: 100%;
  max-width: 380px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.history-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-title {
  font-size: 0.9375rem;
  font-weight: 600;
}
.history-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.history-close:hover { background: var(--bg); color: var(--text); }
.history-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.history-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-count {
  font-size: 0.78rem;
  color: var(--muted);
}
.history-clear {
  font-family: inherit;
  font-size: 0.78rem;
  color: #dc2626;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}
.history-clear:hover { background: #fee2e2; }
[data-theme="dark"] .history-clear:hover { background: #7f1d1d; }

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.history-item {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.history-item:hover { border-color: var(--primary); }

.history-item__load {
  flex: 1;
  text-align: left;
  font-family: inherit;
  background: var(--bg);
  border: none;
  padding: 11px 12px;
  cursor: pointer;
  transition: background 0.15s;
  min-width: 0;
}
.history-item__load:hover { background: var(--card); }
.history-item__load:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.history-item__claim {
  font-size: 0.8375rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-item__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.history-item__date {
  font-size: 0.72rem;
  color: var(--muted);
}

.history-verdict {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}
.history-verdict--supported    { background: #dcfce7; color: #15803d; }
.history-verdict--contradicted { background: #fee2e2; color: #b91c1c; }
.history-verdict--unclear      { background: #fef3c7; color: #b45309; }

.history-item__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.history-item:hover .history-item__delete { opacity: 1; }
.history-item__delete:hover { background: #fee2e2; color: #dc2626; }
.history-item__delete:focus-visible { opacity: 1; outline: 2px solid var(--primary); outline-offset: -2px; }
[data-theme="dark"] .history-item__delete:hover { background: #7f1d1d; color: #fca5a5; }

/* ── Account button ───────────────────────────── */
.account-btn { position: relative; }
.account-btn__icon { width: 17px; height: 17px; }
.account-btn__initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}
.account-btn--signed-in {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.account-btn--signed-in:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
[data-theme="dark"] .account-btn--signed-in { color: #0b1220; }
[data-theme="dark"] .account-btn--signed-in:hover { color: #0b1220; }

/* ── Auth modal ───────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal {
  background: var(--card);
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.auth-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.auth-modal__title { font-size: 1.05rem; font-weight: 600; }
.auth-pane { padding: 18px 20px 22px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab--active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.auth-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-google:hover:not(:disabled) { background: var(--bg); border-color: var(--muted); }
.btn-google:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-google:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-google__icon { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { padding: 0 10px; }

.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field__label { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.auth-field input {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
  background: #fff;
}
[data-theme="dark"] .auth-field input { background: #111827; }
[data-theme="dark"] .auth-field input:focus { background: #1f2937; }

.auth-error { font-size: 0.82rem; color: #dc2626; margin: -4px 0 0; }
[data-theme="dark"] .auth-error { color: #fca5a5; }

.auth-submit { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }

.auth-link {
  align-self: center;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--primary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}
.auth-link:hover { text-decoration: underline; }
.auth-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.auth-sub-title { font-size: 1rem; font-weight: 600; }
.auth-hint { font-size: 0.85rem; color: var(--muted); line-height: 1.55; }
.auth-confirm { display: flex; flex-direction: column; gap: 14px; text-align: center; }

.auth-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ── Signed-in pane ───────────────────────────── */
.auth-account { display: flex; align-items: center; gap: 14px; }
.auth-account__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}
[data-theme="dark"] .auth-account__avatar { color: #0b1220; }
.auth-account__meta { min-width: 0; }
.auth-account__label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.auth-account__email { font-size: 0.95rem; font-weight: 600; word-break: break-all; }
.auth-account__sync {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 3px;
}
.auth-account__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.auth-import {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.auth-import__text { font-size: 0.85rem; margin-bottom: 10px; }
.auth-import__actions { display: flex; gap: 8px; }
.auth-import__btn { flex: 1; padding: 8px 10px; }

.btn-ghost {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); border-color: var(--muted); }
.btn-ghost:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-ghost:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-signout { width: 100%; margin-top: 20px; }

/* ── Dark mode overrides ──────────────────────── */
[data-theme="dark"] .claim-textarea { background: #111827; }
[data-theme="dark"] .claim-textarea:focus { background: #1f2937; }
[data-theme="dark"] .claim-textarea::placeholder { color: #6b7280; }

[data-theme="dark"] .url-input { background: #111827; }
[data-theme="dark"] .url-input:focus { background: #1f2937; }
[data-theme="dark"] .url-input::placeholder { color: #6b7280; }
[data-theme="dark"] .input-tabs { border-bottom-color: var(--border); }
[data-theme="dark"] .btn-share--error { background: #2d1515; border-color: #7f1d1d; color: #fca5a5; }

[data-theme="dark"] .confidence-pill--high   { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .confidence-pill--medium { background: #451a03; color: #fcd34d; border-color: #78350f; }
[data-theme="dark"] .confidence-pill--low    { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .snapshot-flag--ok   { background: #052e16; color: #86efac; }
[data-theme="dark"] .snapshot-flag--note { background: #172554; color: #93c5fd; }
[data-theme="dark"] .snapshot-flag--warn { background: #422006; color: #fcd34d; }

[data-theme="dark"] .error-banner { background: #2d1515; border-color: #7f1d1d; color: #fca5a5; }

[data-theme="dark"] .shared-banner { background: #1e3554; border-color: #1e40af; color: #bfdbfe; }
[data-theme="dark"] .shared-banner__dismiss { color: #bfdbfe; }
[data-theme="dark"] .shared-banner__dismiss:hover { color: #93c5fd; }

[data-theme="dark"] .predict-btn { background: #1f2937; }
[data-theme="dark"] .predict-btn:hover { background: #374151; }

[data-theme="dark"] .library__claim { background: #111827; }
[data-theme="dark"] .library__claim:hover { background: #1f2937; }

[data-theme="dark"] .identity-tag { background: #374151; }

[data-theme="dark"] .context-lens { border-color: #3730a3; }
[data-theme="dark"] .context-lens__title { color: #a5b4fc; }
[data-theme="dark"] .context-lens__chevron { color: #818cf8; }
[data-theme="dark"] .context-lens__label { color: #a5b4fc; }
[data-theme="dark"] .context-lens__body { border-top-color: #312e81; }
[data-theme="dark"] .context-lens__list--questions li { background: rgba(99,102,241,0.14); }
[data-theme="dark"] .context-lens__warning { background: #431407; border-color: #7c2d12; }
[data-theme="dark"] .context-lens__warning-text { color: #fdba74; }

[data-theme="dark"] .predict-chip { background: #374151; color: #d1d5db; }
[data-theme="dark"] .predict-chip--true  { background: #14532d; color: #86efac; }
[data-theme="dark"] .predict-chip--false { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .predict-chip--unsure { background: #374151; color: #9ca3af; }
[data-theme="dark"] .predict-chip--verdict-supported    { background: #14532d; color: #86efac; }
[data-theme="dark"] .predict-chip--verdict-contradicted { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .predict-chip--verdict-unclear      { background: #78350f; color: #fcd34d; }

[data-theme="dark"] .verdict--supported  .verdict-badge { background: #14532d; color: #86efac; }
[data-theme="dark"] .verdict--contradicted .verdict-badge { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .verdict--unclear    .verdict-badge { background: #78350f; color: #fcd34d; }

[data-theme="dark"] .evidence-match--found     .evidence-match__pill { background: #14532d; color: #86efac; }
[data-theme="dark"] .evidence-match--partial   .evidence-match__pill { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .evidence-match--not-found .evidence-match__pill { background: #7f1d1d; color: #fca5a5; }

[data-theme="dark"] .cred--high    { background: #14532d; color: #86efac; }
[data-theme="dark"] .cred--high    .cred-dot { background: #22c55e; }
[data-theme="dark"] .cred--medium  { background: #1e3554; color: #93c5fd; }
[data-theme="dark"] .cred--medium  .cred-dot { background: #60a5fa; }
[data-theme="dark"] .cred--low     { background: #1f2937; color: #6b7280; }
[data-theme="dark"] .cred--unknown { background: #1f2937; color: #6b7280; }

[data-theme="dark"] .srctype--scholarly  { color: #d8b4fe; }
[data-theme="dark"] .srctype--official   { color: #5eead4; }
[data-theme="dark"] .srctype--reporting  { color: #93c5fd; }
[data-theme="dark"] .srctype--interested { color: #fcd34d; }
[data-theme="dark"] .srctype--other      { color: #6b7280; }

[data-theme="dark"] .filter-notice { background: #422006; border-color: #92400e; }
[data-theme="dark"] .filter-notice__head { color: #fcd34d; }

[data-theme="dark"] .relevance-flag { background: #2a1f07; border-left-color: #b45309; }
[data-theme="dark"] .relevance-flag__label { color: #fcd34d; }
[data-theme="dark"] .relevance-flag--background { background: #1f2937; border-left-color: #4b5563; }
[data-theme="dark"] .relevance-flag--background .relevance-flag__label { color: #9ca3af; }

[data-theme="dark"] .identity--flagged .identity-badge { background: #431407; color: #fdba74; }
[data-theme="dark"] .identity--about   .identity-badge { background: #172554; color: #93c5fd; }
[data-theme="dark"] .identity--clean   .identity-badge { background: #14532d; color: #86efac; }
[data-theme="dark"] .identity-caution { color: #fb923c; }

[data-theme="dark"] .btn-share:hover { background: #1e3554; }
[data-theme="dark"] .btn-share--done { background: #14532d; border-color: #166534; color: #86efac; }

[data-theme="dark"] .meta-row { color: #6b7280; }

[data-theme="dark"] .history-verdict--supported    { background: #14532d; color: #86efac; }
[data-theme="dark"] .history-verdict--contradicted { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .history-verdict--unclear      { background: #78350f; color: #fcd34d; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 500px) {
  /* Collapse the classroom control to its icon so the header does not wrap.
     The title/aria-label still names it, as with the other header buttons. */
  .header-btn--labeled { width: 34px; padding: 0; }
  .header-btn__label { display: none; }

  .main { padding: 28px 12px 60px; }
  .intro__title { font-size: 1.5rem; }
  .controls { flex-direction: column; align-items: stretch; }
  .toggle-group { justify-content: space-between; gap: 12px; }
  .btn-primary { width: 100%; padding: 12px; text-align: center; }
  .predict-panel__options { flex-direction: column; }
  .predict-btn { width: 100%; }
}
