.test-lesson {
  display: grid;
  gap: 16px;
}

.test-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.test-score-pill {
  min-width: 90px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--accent-strong);
  font-weight: 900;
  text-align: center;
}

.test-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.small-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.small-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.round-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.round-button.secondary {
  background: #4f7d58;
}

.small-button.is-speaking,
.round-button.is-speaking {
  background: #9a4852;
  color: #fff;
}

.test-progress {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.test-progress > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.test-progress strong {
  color: var(--ink);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9dcc9;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .25s ease;
}

.block-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(46, 111, 122, .35);
  border-radius: 8px;
  background: #eef8f8;
}

.block-summary.is-hidden,
.test-results.is-hidden {
  display: none;
}

.question-list {
  display: grid;
  gap: 14px;
}

.test-question {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.test-question.is-correct {
  border-color: rgba(85, 120, 90, .7);
  background: #f1f8ef;
}

.test-question.is-wrong,
.test-question.is-missing {
  border-color: rgba(173, 95, 104, .72);
  background: #fff1f2;
}

.test-question-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.test-question h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 2.8vw, 24px);
  line-height: 1.35;
}

.test-question-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.question-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: flex-end;
}

.question-translation {
  background: #706451;
  font-size: 12px;
}

.question-translation.is-active {
  background: var(--accent);
}

.test-translation {
  display: none;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.test-question.is-translation-open .test-translation {
  display: block;
}

.explanation-translation {
  margin-top: 4px;
  font-weight: 500;
}

.test-options {
  display: grid;
  gap: 8px;
}

.test-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.test-option strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--accent-strong);
}

.test-option > span {
  display: grid;
  gap: 4px;
}

.test-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 111, 122, .14);
}

.test-option.is-correct-answer {
  border-color: rgba(85, 120, 90, .7);
  background: #f1f8ef;
}

.test-option.is-wrong-answer {
  border-color: rgba(173, 95, 104, .72);
  background: #fff1f2;
}

.test-explanation {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 250, 242, .9);
}

.test-explanation h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.test-explanation ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.test-explanation li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.test-explanation .is-right-line {
  color: #315b36;
  font-weight: 700;
}

.test-explanation .is-selected-line {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.test-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.test-results {
  display: grid;
  gap: 14px;
}

.result-hero {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(46, 111, 122, .35);
  border-radius: 8px;
  background: #eef8f8;
}

.result-hero span,
.result-hero em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.result-hero strong {
  color: var(--accent-strong);
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.result-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.result-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.result-card ul,
.result-card ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.result-card li {
  color: var(--muted);
  line-height: 1.4;
}

.result-card li strong {
  color: var(--ink);
}

@media (max-width: 620px) {
  .test-header {
    display: grid;
  }

  .test-score-pill {
    justify-self: start;
  }

  .test-toolbar .small-button {
    flex: 1 1 180px;
  }

  .test-question-head {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .question-tools {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 2px;
  }

  .test-actions .action-link {
    width: 100%;
  }
}
