/* ThinkPress quiz widget for book Preview and Homework pages. */
/* One text size throughout: everything inherits the page body size. */
.thinkpress-quiz { max-width: 900px; font-size: inherit; }
.tp-quiz-status { color: var(--pst-color-text-muted, #57606a); }
.tp-quiz-question {
  border: 1px solid var(--pst-color-border, #d8dee4);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
}
.tp-quiz-title { margin: 0 0 0.5rem; font-weight: 600; font-size: inherit; }
.tp-quiz-body p { margin: 0 0 0.6rem; font-size: inherit; }
.tp-quiz-options label {
  display: block;
  margin: 0.35rem 0;
  font-weight: normal;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}
.tp-quiz-options input { margin-right: 0.4rem; }
.tp-quiz-code {
  width: 100%;
  font-family: var(--pst-font-family-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 0.6rem;
  border: 1px solid var(--pst-color-border, #d8dee4);
  border-radius: 6px;
  background: var(--pst-color-surface, #f6f8fa);
  color: inherit;
  tab-size: 4;
}
.tp-quiz-feedback { margin-top: 0.6rem; font-weight: 600; font-size: inherit; }
.tp-quiz-feedback:empty { display: none; }
.tp-quiz-feedback.correct { color: #1a7f37; }
.tp-quiz-feedback.incorrect { color: #cf222e; }
.tp-quiz-feedback.pending { color: #9a6700; }
.tp-quiz-actions { display: flex; gap: 0.75rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.tp-quiz-actions button {
  border: 1px solid #176de8;
  border-radius: 6px;
  background: #176de8;
  color: #fff;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}
.tp-quiz-actions button.secondary { background: transparent; color: #176de8; }
.tp-quiz-actions button:disabled { cursor: not-allowed; opacity: 0.65; }
.tp-quiz-result { font-weight: 600; }
.tp-quiz-run {
  margin-top: 0.5rem;
  border: 1px solid #176de8;
  border-radius: 6px;
  background: transparent;
  color: #176de8;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}
.tp-quiz-run:disabled { cursor: not-allowed; opacity: 0.65; }
.tp-quiz-output {
  margin: 0.5rem 0 0;
  padding: 0.6rem;
  border-left: 3px solid #1a7f37;
  background: var(--pst-color-surface, #f6f8fa);
  white-space: pre-wrap;
  font-size: 0.85rem;
}
.tp-quiz-output.is-error { border-left-color: #cf222e; }

.tp-quiz-written { width: 100%; min-height: 12em; padding: .75em; font: inherit; box-sizing: border-box; }
