/* Brain Grain — consistent per-question-type badges.
   Linked by every chapter page. The badge label + colour come from the
   qa-type-* class added to each .qa-item, so the markup stays minimal. */
.qa-item[class*="qa-type-"] .qa-q::before {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15em 0.55em;
  border-radius: 100px;
  margin-right: 0.5em;
  vertical-align: middle;
  color: #fff;
  background: #64748b;
}
.qa-type-mcq       .qa-q::before { content: "MCQ";              background: #0284c7; }
.qa-type-match     .qa-q::before { content: "Match";            background: #7c3aed; }
.qa-type-truefalse .qa-q::before { content: "True / False";     background: #0d9488; }
.qa-type-fill      .qa-q::before { content: "Fill in the blank"; background: #d97706; }
.qa-type-assertion .qa-q::before { content: "Assertion & Reason"; background: #db2777; }
.qa-type-oddout    .qa-q::before { content: "Odd one out";      background: #65a30d; }
.qa-type-short     .qa-q::before { content: "Short answer";     background: #64748b; }
.qa-type-long      .qa-q::before { content: "Long answer";      background: #334155; }

/* Match-the-following answer table */
.qa-match { border-collapse: collapse; margin: 0.5rem 0; font-size: 0.86rem; width: 100%; max-width: 480px; }
.qa-match th, .qa-match td { border: 1px solid #e2e8f0; padding: 0.4rem 0.65rem; text-align: left; }
.qa-match th { background: #f1f5f9; font-weight: 800; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: #475569; }
.qa-match td:first-child { width: 2.4rem; text-align: center; font-weight: 800; color: #0369a1; }
