:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f3f6fb 0%, #f7f9fc 100%);
  color: #111827;
}

.siteHeader {
  background: linear-gradient(135deg, #16202a, #24364a);
  color: #fff;
  padding: 20px 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}

.siteHeaderInner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.siteHeader h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.siteHeader p {
  margin: 6px 0 0;
  opacity: .88;
  font-size: 14px;
}

.pageWrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}
.quizTopbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.quizTopbarAdaptive {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quizStat {
  background: #fff;
  border: 1px solid #e5ebf3;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 10px 26px rgba(17,24,39,.05);
}

.quizStatLabel {
  display: block;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.quizStatValue {
  display: block;
  font-size: 24px;
  font-weight: 750;
  color: #16202a;
}

.card {
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(17,24,39,.08);
  border: 1px solid #ebf0f6;
}

.row {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px) {
  .row,
  .quizTopbar {
    grid-template-columns: 1fr;
  }
}

#quizRow.matchingMode {
  grid-template-columns: 1fr;
}

#quizRow.matchingMode #leftPane {
  display: none;
}

#quizRow.matchingMode #rightPane {
  width: 100%;
}
#quizRow.textOnlyMode {
  grid-template-columns: 1fr;
}

#quizRow.textOnlyMode #leftPane {
  display: none;
}

#quizRow.textOnlyMode #rightPane {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}
.imgWrap,
.caseWrap,
.matchBankWrap,
.syndromeCard,
.feedback,
.semiologyWrap {
  background: #fafbfd;
  border: 1px solid #e7edf5;
  border-radius: 16px;
}

.imgWrap,
.caseWrap,
.matchBankWrap,
.syndromeCard,
.semiologyWrap {
  padding: 12px;
}

img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

#qImgs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#qImgs.twoImages {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.caseLabel {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 8px;
}

.caseText {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 0;
}

.pill {
  font-size: 12px;
  background: #eef4ff;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #dce8ff;
}

.pill b {
  margin-right: 6px;
}

.qTitle {
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.45;
  font-size: 22px;
  color: #16202a;
}

.choices {
  display: grid;
  gap: 10px;
}

button.choice {
  text-align: left;
  width: 100%;
  padding: 14px 14px;
  border-radius: 15px;
  border: 1px solid #dde5ef;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

button.choice:hover {
  border-color: #c9d7e8;
  background: #fbfcff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(17,24,39,.05);
}

button.choice[disabled] {
  cursor: not-allowed;
  opacity: .96;
}

button.correct {
  border-color: #16a34a;
  background: #ecfdf3;
}

button.wrong {
  border-color: #dc2626;
  background: #fef2f2;
}

.feedback {
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.feedback.ok {
  border-color: #16a34a33;
  background: #ecfdf3;
}

.feedback.no {
  border-color: #dc262633;
  background: #fef2f2;
}

.explain {
  margin-top: 8px;
  font-size: 13px;
  color: #374151;
  line-height: 1.45;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.centerControls {
  justify-content: center;
}

.btn {
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid #d7dfea;
  background: #16202a;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.btn.secondary {
  background: #fff;
  color: #16202a;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.headerBack {
  white-space: nowrap;
}

.small {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}

a {
  color: inherit;
}

.semiologyWrap {
  display: none;
  margin-top: 12px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.semiologyTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.semiologyTable th,
.semiologyTable td {
  border: 2px solid #fff;
  padding: 10px 8px;
  vertical-align: top;
  word-wrap: break-word;
}

.semiologyTitle {
  background: #1696c8;
  color: #fff;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
}

.semiologyColHead {
  background: #b9d7ea;
  font-style: italic;
  font-weight: 500;
  text-align: left;
}

.semiologySection {
  background: #d9eaf4;
  font-weight: 700;
  width: 180px;
}

.semiologySubrow {
  display: block;
  font-weight: 400;
  margin-top: 4px;
}

.semiologyCell {
  background: #d9eaf4;
}

.semiologyBlank {
  background: #b9d7ea;
}

#matchQuestionWrap {
  width: 100%;
}

.matchBank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  align-items: flex-start;
}

.draggableItem {
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid #d7deea;
  background: #fff;
  cursor: grab;
  font-size: 12px;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 10px rgba(17,24,39,.04);
}

.draggableItem:active {
  cursor: grabbing;
}
.draggableItem.dragging {
  opacity: 0.55;
}

.matchGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

@media (max-width: 1100px) {
  .matchGrid {
    grid-template-columns: 1fr;
  }
}

.syndromeTitle {
  background: #1696c8;
  color: #fff;
  border-radius: 12px;
  padding: 11px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.dropRow {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  margin-bottom: 8px;
  align-items: stretch;
}

.dropLabel {
  background: #d9eaf4;
  border-radius: 10px;
  padding: 8px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
}

.dropLabel span {
  display: block;
  font-weight: 400;
  margin-top: 3px;
  font-size: 11px;
}

.dropZone {
  min-height: 54px;
  background: #eef4f8;
  border: 2px dashed #c8d4df;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-wrap: anywhere;
}

.dropZone.filled {
  border-style: solid;
  background: #fff;
}

.dropZone.correct {
  border-color: #16a34a;
  background: #ecfdf3;
}

.dropZone.wrong {
  border-color: #dc2626;
  background: #fef2f2;
}

.resultsScreen {
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(17,24,39,.08);
  text-align: center;
  margin-bottom: 16px;
}

.resultsScreen h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 30px;
}

.resultsScreen p {
  margin-bottom: 18px;
  color: #4b5563;
  font-size: 16px;
}