.year-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid #d9dfda;
  border-radius: 14px;
  background: #e9ede9;
  box-shadow: 0 4px 15px #1d382d0a;
}

.year-switch button {
  display: flex;
  flex: 1 1 112px;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  color: #68736e;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s ease;
}

.year-switch button small {
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffffff99;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.72;
}

.year-switch button.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 4px 12px #244c3d33;
}

.year-switch button.active small {
  color: var(--green);
  background: #fff;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 820px;
  margin: 0 auto 16px;
}

.view-switch button {
  display: grid;
  grid-template-columns: 30px auto;
  align-items: center;
  justify-content: start;
  gap: 0 10px;
  min-height: 58px;
  padding: 9px 14px;
  border: 1px solid #d8ddd9;
  border-radius: 10px;
  color: #65726c;
  background: #fffdf9b8;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.view-switch button > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--green);
  background: #e5eee9;
  font-size: 12px;
}

.view-switch button small {
  color: #8a928e;
  font-size: 10px;
  font-weight: 500;
}

.view-switch button.active {
  border-color: #6f8f80;
  color: var(--green);
  background: #edf4f0;
  box-shadow: 0 4px 14px #244c3d14;
}

.view-switch button.active > span {
  color: #fff;
  background: var(--green);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #e3d6b8;
  border-radius: 999px;
  color: #795f29;
  background: #f3efe4;
  font-size: 12px;
  font-weight: 800;
}

.paper-card {
  padding-bottom: 22px;
}

.paper-card > h1 {
  margin-bottom: 8px;
}

.exam-sheet {
  margin: 18px 0 4px;
  overflow: hidden;
  border: 1px solid #dfe2dc;
  border-radius: 12px;
  background: #f1f0eb;
  box-shadow: 0 10px 28px #20362d12;
}

.exam-sheet img,
.answer-sheet img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.source-reference {
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid #d7ddd9;
  border-radius: 12px;
  background: #edf0ed;
  box-shadow: 0 9px 24px #21372e10;
}

.source-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  color: #54645d;
  background: #f4f5f1;
  font-size: 12px;
}

.source-reference-head div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.source-reference-head span,
.source-reference-head small {
  color: #818b86;
  font-size: 10px;
}

.source-reference-pages {
  display: grid;
  gap: 1px;
  background: #d7ddd9;
}

.source-reference-pages.multiple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-reference-pages a {
  display: block;
  background: #fff;
}

.source-reference-pages img {
  display: block;
  width: 100%;
  height: auto;
}

.answer-sheet {
  margin-top: 22px;
  overflow: hidden;
}

.answer-translation {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 10px;
  margin: 13px 0 10px;
  padding: 12px 14px;
  border: 1px solid #cddfd6;
  border-radius: 9px;
  color: #355447;
  background: #fffdf9;
}

.answer-translation > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.answer-translation b {
  color: var(--green);
}

.answer-translation p {
  margin-top: 3px;
  color: #52645c;
  font-size: 14px;
  line-height: 1.75;
}

.answer-sheet img {
  margin-top: 12px;
  border: 1px solid #d9dfda;
  border-radius: 10px;
}

.question-card h1,
.option span:nth-child(2) {
  white-space: pre-line;
}

.question-card h1.dense-question {
  font-size: 20px;
  line-height: 1.65;
}

.question-card .translation {
  white-space: pre-line;
}

@media (max-width: 760px) {
  .year-switch {
    width: 100%;
    margin-bottom: 12px;
  }

  .year-switch button {
    flex: 1 1 96px;
    justify-content: center;
    padding: 9px 7px;
  }

  .view-switch {
    gap: 6px;
    margin-bottom: 12px;
  }

  .view-switch button {
    grid-template-columns: 25px auto;
    gap: 0 7px;
    min-height: 54px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .view-switch button > span {
    width: 25px;
    height: 25px;
  }

  .source-reference {
    margin: 17px -4px 20px;
    border-radius: 8px;
  }

  .source-reference-head {
    padding: 10px 11px;
  }

  .source-reference-head > small {
    display: none;
  }

  .source-reference-pages.multiple {
    grid-template-columns: 1fr;
  }

  .meta-actions .source-badge {
    display: none;
  }

  .question-card h1.dense-question {
    font-size: 16px;
  }

  .paper-card {
    padding-inline: 10px;
  }

  .paper-card .question-heading-row,
  .paper-card > h1,
  .paper-card > .translation,
  .paper-card > .card-footer,
  .answer-sheet {
    margin-right: 5px;
    margin-left: 5px;
  }

  .exam-sheet {
    margin-right: -1px;
    margin-left: -1px;
    border-radius: 8px;
  }
}
