body {
  font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
}

/* Grade 10, question 6: detailed algebra copied from the approved answer guide. */
.g10-q6-detail {
  display: grid;
  gap: .72em;
  line-height: 1.75;
}

.g10-q6-detail-line {
  display: block;
}

.g10-q6-detail-math {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: .34em;
  row-gap: .42em;
}

.g10-q6-detail .math-frac {
  font-size: 1em;
  margin-inline: .14em;
}

.g10-q6-detail .math-root {
  font-size: 1em;
}

.g10-q6-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .28em;
}

.g10-q6-inline-key {
  min-width: 0;
  min-height: 0;
  margin-inline: .08em;
  font-size: 1.85em;
  vertical-align: middle;
}

.g10-q6-inline-menu {
  margin-inline: .08em;
  font-size: .9em;
  vertical-align: middle;
}

.g10-q6-step4 {
  display: grid;
  gap: .55em;
}

.g10-q6-keyline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25em;
}

.g10-q6-step4-title {
  margin-bottom: .15em;
}

.g10-q6-step5-title {
  margin-top: .5em;
}

.g10-q6-summary {
  display: grid;
  gap: .7em;
  line-height: 1.75;
}

@media (max-width: 560px) {
  .g10-q6-detail {
    gap: .8em;
    line-height: 1.65;
  }

  .g10-q6-detail-math {
    row-gap: .55em;
  }
}

.g10-q3-factor {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 3.5em;
  align-items: start;
}

.g10-q3-factor-lines {
  display: grid;
  gap: 0.65em;
}

.g10-q3-factor-lines > span {
  display: block;
  white-space: nowrap;
}

.g10-q3-truth {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  column-gap: 2.2em;
  align-items: baseline;
}

.g10-q3-truth > span {
  white-space: nowrap;
}

.g10-q3-check {
  display: grid;
  gap: 1em;
}

.g10-q3-check-eval,
.g10-q3-check-result {
  display: grid;
  align-items: baseline;
}

.g10-q3-check-eval {
  grid-template-columns: repeat(2, max-content);
  column-gap: 2em;
}

.g10-q3-check-result {
  grid-template-columns: repeat(6, max-content);
  column-gap: 1.6em;
}

.g10-q3-check span {
  white-space: nowrap;
}

.g10-q5-table-step {
  max-width: 100%;
  margin: 0.45em 0 1.35em;
}

.g10-q5-truth-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 0 8px;
  color: #18354a;
  font-size: 14px;
  line-height: 1.35;
  -webkit-overflow-scrolling: touch;
}

.g10-q5-truth-table.is-compact {
  width: min(100%, 620px);
}

.g10-q5-table-row {
  display: grid;
}

.g10-q5-truth-table.is-full .g10-q5-table-row {
  grid-template-columns: minmax(54px, .7fr) repeat(4, minmax(44px, .5fr)) repeat(2, minmax(72px, .9fr)) minmax(154px, 1.7fr) minmax(72px, .9fr) minmax(220px, 2.4fr);
  min-width: 1080px;
}

.g10-q5-truth-table.is-compact .g10-q5-table-row {
  grid-template-columns: repeat(4, minmax(44px, .55fr)) minmax(250px, 2.8fr);
  min-width: 520px;
}

.g10-q5-table-row > span {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 5px 6px;
  border-right: 1px solid #9eb7c5;
  border-bottom: 1px solid #9eb7c5;
  background: #fff;
  text-align: center;
  white-space: nowrap;
}

.g10-q5-table-row > span:first-child {
  border-left: 1px solid #9eb7c5;
}

.g10-q5-table-row.is-header > span {
  min-height: 39px;
  border-top: 1px solid #9eb7c5;
  background: #e7f3f9;
  color: #102f44;
  font-weight: 700;
}

.g10-q5-table-row:nth-child(even):not(.is-header):not(.is-false) > span {
  background: #f7fbfd;
}

.g10-q5-table-row.is-false > span {
  background: #d8edf7;
  color: #0b3f5c;
  font-weight: 700;
}

@media (max-width: 700px) {
  .g10-q3-factor {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 3.5em;
  }

  .g10-q3-truth {
    grid-template-columns: repeat(2, max-content);
    row-gap: 0.6em;
  }

  .g10-q3-check-result {
    grid-template-columns: repeat(2, max-content);
    row-gap: 0.6em;
  }
}

/* Grade 10 Q7: keep prose left-aligned and center only the displayed equations. */
.grade-10 #review-list > .review-item:nth-child(7) .g10-q7-equation {
  width: 100%;
  margin-left: 0 !important;
  margin-right: 0;
  text-align: center;
}

.grade-10 #review-list > .review-item:nth-child(7) .g10-q7-step-equation {
  display: block;
  width: 100%;
}

@media (max-width: 560px) {
  .grade-10 #review-list > .review-item:nth-child(7) .g10-q7-equation {
    text-align: center;
  }
}

.question {
  white-space: pre-line;
  line-height: 1.65;
}

.answer-grid.long-options {
  grid-template-columns: 1fr;
}

@media (max-width: 800px) {
  .question {
    font-size: 17px;
  }
}
@font-face {
  font-family: "CASIO ClassWiz CW01";
  src: url("assets/fonts/CASIO-ClassWiz-CW01.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* Grade 10, question 7: approved mathematical analysis. */
.g10-q7-heading,
.g10-q7-copy,
.g10-q7-equation,
.g10-q7-case {
  display: block;
}

.g10-q7-heading {
  margin-bottom: 1.2em;
  color: #245894;
  font-weight: 800;
}

.g10-q7-copy {
  margin-bottom: .9em;
  line-height: 1.9;
}

.g10-q7-equation {
  margin: .7em 0 1em;
  overflow-x: auto;
  padding: .15em 0;
  text-align: left;
  font-family: "Cambria Math", "STIX Two Math", serif;
  font-size: 1.18em;
  line-height: 1.9;
}

.g10-q7-case {
  margin: 1em 0 .55em;
  color: #245894;
  font-weight: 800;
}

.g10-q7-equation .math-frac,
.g10-q7-equation .math-root {
  font-size: 1em;
}

.g10-q7-classification {
  display: block;
  margin: 1.15em 0 .85em;
  font-weight: 800;
}

.g10-q7-indented {
  padding-left: 1.15em;
}

.g10-q7-step2-heading {
  margin-top: 2.2em;
}

.g10-q7-calculator-step,
.g10-q7-procedure-step {
  display: flex;
  align-items: flex-start;
  gap: .5em;
  line-height: 1.8;
}

.g10-q7-procedure-step {
  margin: 1.25em 0 .65em;
  padding-left: .9em;
  border-left: 3px solid #8eadd0;
  font-weight: 600;
}

.g10-q7-procedure-step > strong {
  flex: 0 0 auto;
  color: #245894;
}

.g10-q7-procedure-line {
  display: block;
  margin-bottom: .78em;
  line-height: 1.85;
}

.g10-q7-step-equation {
  display: block;
  padding-left: 1.45em;
}

.g10-q7-subheading {
  display: block;
  margin: 1.2em 0 .65em 1.45em;
  color: #344b65;
  font-weight: 700;
}

.g10-q7-detail-line {
  display: block;
  margin: 0 0 .75em 2.6em;
  line-height: 1.85;
}

.g10-q7-detail-line strong {
  color: #344b65;
}

.g10-q7-search-note {
  display: block;
  margin: .8em 0 1em 1.45em;
  padding: .7em .9em;
  border-radius: 6px;
  background: #f2f6fa;
  color: #344b65;
  font-weight: 600;
}

.g10-q7-root-block {
  display: block;
  margin: 1.15em 0 .7em 1.45em;
  padding: .2em 0 .2em 1em;
  border-left: 2px solid #c9d7e6;
}

.g10-q7-root-title,
.g10-q7-root-copy,
.g10-q7-root-result {
  display: block;
}

.g10-q7-root-title {
  margin-bottom: .45em;
  color: #344b65;
  font-weight: 700;
}

.g10-q7-root-copy,
.g10-q7-root-result {
  line-height: 1.85;
}

.g10-q7-root-result {
  margin-top: .45em;
  padding-left: 1em;
  color: #334155;
}

.g10-q7-final-step {
  margin-top: 1.65em;
}

.g10-q8-note {
  color: #56687a;
  font-size: .94em;
}

.g10-q8-root-list {
  display: grid;
  gap: .25em;
  margin: -.15em 0 1.15em 2.2em;
  font-family: "Cambria Math", "STIX Two Math", serif;
  font-size: 1.12em;
  line-height: 1.65;
}

.g10-q8-range-block {
  display: grid;
  gap: .25em;
  margin: .75em 0 .75em 1.45em;
  padding-left: 1em;
  border-left: 2px solid #c9d7e6;
  line-height: 1.8;
}

.g10-q8-range-block strong {
  color: #344b65;
}

.g10-q8-conclusion {
  margin-top: 1.15em;
  padding-left: 1.45em;
}

.g10-q8-step-subline,
.g10-q8-coefficient-list {
  display: block;
  margin: .2em 0 .9em 2.6em;
  line-height: 1.85;
}

.g10-q8-coefficient-list > span {
  display: block;
  margin-bottom: .72em;
}

.g10-q8-coefficient-list strong {
  color: #344b65;
}

.g10-q8-result-equation {
  padding-left: 1.45em;
}

.g10-q9-overview-title {
  display: block;
  margin-bottom: 1.35em;
  color: #245894;
  font-size: 1.04em;
  font-weight: 800;
}

.g10-q9-analysis-block {
  display: grid;
  gap: .65em;
  margin: 1.15em 0 1.3em 1.45em;
  padding-left: 1em;
  border-left: 2px solid #c9d7e6;
  line-height: 1.85;
}

.g10-q9-analysis-block > strong {
  color: #344b65;
}

.g10-q9-analysis-block .g10-q7-equation {
  margin: .15em 0 .25em;
}

.g10-q9-root-set {
  display: block;
  margin: .1em 0;
  padding-left: 1em;
  color: #344b65;
  font-family: "Cambria Math", "STIX Two Math", serif;
  font-size: 1.12em;
}

.g10-q9-conclusion {
  margin-top: 1.1em;
  padding: .8em 1em;
  border-radius: 6px;
  background: #f2f6fa;
}

.g10-q9-root-result {
  display: grid;
  gap: .25em;
  margin: .75em 0 .75em 1.45em;
  padding-left: 1em;
  border-left: 2px solid #c9d7e6;
  line-height: 1.8;
}

.g10-q9-root-result strong {
  color: #344b65;
}

.g10-q9-root-result-valid {
  border-left-color: #6f9bc8;
}

.g10-q9-inline-images {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: calc(100% - 1.45em);
  margin: .45em 0 1.1em 1.45em;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.g10-q10-condition,
.g10-q10-subblock {
  display: grid;
  gap: .45em;
  margin: .9em 0 1.1em 1.45em;
  padding-left: 1em;
  border-left: 2px solid #c9d7e6;
  line-height: 1.85;
}

.g10-q10-condition > strong,
.g10-q10-subblock > strong {
  color: #344b65;
}

.g10-q10-condition .g10-q7-equation {
  margin: .05em 0;
}

.g10-q10-solution-set {
  padding-left: 1.45em;
  color: #344b65;
  font-weight: 700;
}

.g10-q10-count-block,
.g10-q10-scan-results {
  display: grid;
  gap: .75em;
  margin: .65em 0 1.15em 1.45em;
}

.g10-q10-count-block > span,
.g10-q10-scan-results > span {
  display: grid;
  grid-template-columns: minmax(5.4em, auto) 1fr;
  gap: .8em;
  padding-left: 1em;
  border-left: 2px solid #c9d7e6;
  line-height: 1.75;
}

.g10-q10-count-block strong,
.g10-q10-scan-results strong {
  color: #344b65;
}

.g10-q10-scan-results .is-valid {
  border-left-color: #6f9bc8;
}

.g10-q10-key-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3em;
  margin: .3em 0;
}

.g10-q10-range-list {
  margin-top: .35em;
}

.g10-q10-graph-note {
  display: block;
  margin: .65em 0 1em 1.45em;
  padding: .75em 1em;
  border-radius: 6px;
  background: #f2f6fa;
  line-height: 1.85;
}

.answer-images:has(.answer-image[src*="/g10/answers/q10-"]) {
  width: calc(100% - 1.45em);
  margin-left: 1.45em;
}

.answer-images:has(.answer-image[src*="/g10/answers/q07-"]) {
  width: calc(100% - 1.45em);
  margin-left: 1.45em;
}

.answer-images:has(.answer-image[src*="/g10/answers/q08-"]) {
  width: calc(100% - 1.45em);
  margin-left: 1.45em;
}

.answer-images:has(.answer-image[src*="/g10/answers/q09-"]) {
  width: calc(100% - 1.45em);
  margin-left: 1.45em;
}

@media (max-width: 560px) {
  .g10-q7-step-equation,
  .g10-q7-subheading,
  .g10-q7-detail-line,
  .g10-q7-search-note,
  .g10-q7-root-block {
    margin-left: .65em;
  }

  .g10-q8-root-list,
  .g10-q8-range-block,
  .g10-q8-conclusion,
  .g10-q8-step-subline,
  .g10-q8-coefficient-list,
  .g10-q8-result-equation {
    margin-left: .65em;
    padding-left: .7em;
  }

  .g10-q9-analysis-block,
  .g10-q9-root-result {
    margin-left: .65em;
    padding-left: .7em;
  }

  .g10-q9-root-set {
    padding-left: .7em;
  }

  .g10-q9-inline-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% - .65em);
    margin-left: .65em;
  }

  .g10-q10-condition,
  .g10-q10-subblock,
  .g10-q10-count-block,
  .g10-q10-scan-results,
  .g10-q10-graph-note {
    margin-left: .65em;
  }

  .g10-q10-solution-set {
    padding-left: .65em;
  }

  .g10-q10-count-block > span,
  .g10-q10-scan-results > span {
    grid-template-columns: 1fr;
    gap: .15em;
  }

  .g10-q7-detail-line,
  .g10-q7-root-result {
    padding-left: .7em;
  }

  .answer-images:has(.answer-image[src*="/g10/answers/q07-"]) {
    width: calc(100% - .65em);
    margin-left: .65em;
  }

  .answer-images:has(.answer-image[src*="/g10/answers/q08-"]) {
    width: calc(100% - .65em);
    margin-left: .65em;
  }

  .answer-images:has(.answer-image[src*="/g10/answers/q09-"]) {
    width: calc(100% - .65em);
    margin-left: .65em;
  }


  .answer-images:has(.answer-image[src*="/g10/answers/q10-"]) {
    width: calc(100% - .65em);
    margin-left: .65em;
  }
}


@media (max-width: 560px) {
  .g10-q7-indented {
    padding-left: 0;
  }
}


@media (max-width: 560px) {
  .g10-q7-copy {
    line-height: 1.75;
  }

  .g10-q7-equation {
    font-size: 1.05em;
    text-align: left;
  }
}


.question-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.hero h1 .hero-main {
  color: #11314f;
}

.question-image[hidden] {
  display: none;
}

.answer-images {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  margin: 18px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.answer-images.image-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.answer-images.image-size-standard { grid-template-columns: repeat(3, minmax(0, calc((100% - 30px) / 4))); justify-content: start; }
.answer-images.q8-integration-images { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.answer-images.q8-integration-images .answer-image { flex: 0 0 auto; margin-left: 0; margin-right: 0; }
.answer-images.q8-integration-images .answer-image:first-child { width: calc((100% - 30px) / 4); max-width: calc((100% - 30px) / 4); }
.answer-images.q8-integration-images .answer-image:last-child { width: calc((100% - 30px) / 2 + 10px); max-width: calc((100% - 30px) / 2 + 10px); height: auto; aspect-ratio: auto; }
.answer-images .answer-image[src$="/g12/answers/q10-03.png"], .answer-images .answer-image[src$="/g12/answers/q10-05.png"], .answer-images .answer-image[src$="/g10/answers/q10-05.png"] { grid-column: 1 / span 2; width: 100%; max-width: none; height: auto; aspect-ratio: auto; }
.calculator-note { color: #b3261e; font-weight: 600; }

.answer-image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: #fff;
}
@media (max-width: 800px) { .answer-images { grid-template-columns: repeat(2, minmax(0, 1fr)); } .answer-images.image-grid-3, .answer-images.image-size-standard { grid-template-columns: repeat(3, minmax(0, 1fr)); } .answer-images.q8-integration-images .answer-image:first-child { width: calc((100% - 10px) / 2); max-width: calc((100% - 10px) / 2); } .answer-images.q8-integration-images .answer-image:last-child { width: 100%; max-width: 100%; } .answer-images .answer-image[src$="/g12/answers/q10-03.png"], .answer-images .answer-image[src$="/g12/answers/q10-05.png"], .answer-images .answer-image[src$="/g10/answers/q10-05.png"] { grid-column: 1 / span 2; width: 100%; max-width: 100%; } }

.review-choice-list {
  display: grid;
  gap: 5px;
  margin: 18px 0 16px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", "Noto Serif Thai", "Noto Sans Thai", serif;
  line-height: 1.65;
}
.review-choice.correct-choice { color: var(--success); font-weight: 700; }
.review-choice.selected-wrong { color: var(--danger); font-weight: 700; }
.solution-steps { margin-top: 16px; padding: 14px; border-radius: 6px; background: #f3f7fa; color: #344b60; }
.solution-step { margin: 0 0 14px; font-family: "Cambria Math", "STIX Two Math", "Times New Roman", "Noto Serif Thai", "Noto Sans Thai", serif; line-height: 1.75; white-space: pre-wrap; word-spacing: 0.11em; }
.solution-step .math-frac, .solution-step .math-exp-frac, .solution-step .math-integral, .solution-step .math-vector, .solution-step math { margin-left: 0.24em; margin-right: 0.24em; }
.solution-step:last-child { margin-bottom: 0; }

/* Grade 10: preserve the approved wording and use spacing alone to clarify hierarchy. */
.grade-10 #review-list > .review-item:nth-child(-n+5) .solution-steps > .solution-step:first-child > strong:first-child {
  display: inline-block;
  margin-bottom: .55em;
  color: #245894;
  font-weight: 800;
}

.grade-10 #review-list > .review-item:nth-child(-n+5) .solution-steps > .solution-step:not(:first-child):not(.g10-q3-factor):not(.g10-q3-truth):not(.g10-q3-check):not(.g10-q3-final):not(.g10-q5-table-step) {
  margin: .75em 0 .95em 1.45em;
  padding: .35em 0 .35em 1em;
  border-left: 2px solid #c9d7e6;
}

.grade-10 #review-list > .review-item:nth-child(1) .solution-steps > .solution-step:last-child,
.grade-10 #review-list > .review-item:nth-child(2) .solution-steps > .solution-step:last-child,
.grade-10 #review-list > .review-item:nth-child(4) .solution-steps > .solution-step:last-child {
  padding: .75em 1em;
  border-left: 0;
  border-radius: 6px;
  background: #f2f6fa;
}

.grade-10 .g10-q3-factor,
.grade-10 .g10-q3-truth,
.grade-10 .g10-q5-table-step {
  margin-left: 1.45em;
  padding-left: 1em;
  border-left: 2px solid #c9d7e6;
}

.grade-10 .g10-q3-check,
.grade-10 .g10-q3-final {
  margin-left: 1.45em;
  padding: .8em 1em;
  border-radius: 6px;
  background: #f2f6fa;
}

.cw-key,
.solution-keylog .cw-key,
.g10-q6-inline-key,
.g10-q7-procedure-step .cw-key,
.g10-q8-coefficient-list .cw-key,
.g10-q9-root-result .cw-key,
.g10-q10-key-sequence .cw-key {
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  text-shadow: none;
}

.g10-q6-inline-key {
  font-size: 1.72em;
}

@media (max-width: 560px) {
  .grade-10 #review-list > .review-item:nth-child(-n+5) .solution-steps > .solution-step:not(:first-child),
  .grade-10 .g10-q3-factor,
  .grade-10 .g10-q3-truth,
  .grade-10 .g10-q3-check,
  .grade-10 .g10-q3-final,
  .grade-10 .g10-q5-table-step {
    margin-left: .65em;
  }
}

/* Grade 10 hierarchy: typography, spacing and two indentation levels only. */
.grade-10 #review-list > .review-item .solution-steps {
  padding: clamp(18px, 2.8vw, 26px);
  border: 0;
  background: #f5f8fb;
}

.grade-10 #review-list > .review-item .solution-step {
  line-height: 1.88;
}

.grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child {
  margin-left: 1.35rem !important;
  margin-bottom: 1.45rem;
  padding: 0;
  border: 0;
}

.grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child > strong:first-child {
  display: block;
  margin-left: -1.35rem;
  margin-bottom: .65rem;
  color: #245894;
  font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
  font-size: .94rem;
  font-weight: 700;
}

.grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child > br + strong,
.grade-10 #review-list > .review-item:nth-child(6) .solution-steps > .solution-step > strong:only-child,
.grade-10 .g10-q7-heading {
  display: block;
  margin: 1.8rem 0 .85rem;
  padding: 0;
  border: 0;
  color: #245894;
  font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.65;
}

.grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child > br + strong {
  margin-left: -1.35rem;
}

/* Remove all decorative panels and divider lines inside G10 explanations. */
.grade-10 #review-list > .review-item .solution-step,
.grade-10 #review-list > .review-item .g10-q3-factor,
.grade-10 #review-list > .review-item .g10-q3-truth,
.grade-10 #review-list > .review-item .g10-q3-check,
.grade-10 #review-list > .review-item .g10-q3-final,
.grade-10 #review-list > .review-item .g10-q5-table-step,
.grade-10 #review-list > .review-item .g10-q6-detail,
.grade-10 #review-list > .review-item .g10-q6-step,
.grade-10 #review-list > .review-item .g10-q6-step4,
.grade-10 #review-list > .review-item .g10-q6-summary,
.grade-10 #review-list > .review-item .g10-q7-procedure-step,
.grade-10 #review-list > .review-item .g10-q7-search-note,
.grade-10 #review-list > .review-item .g10-q7-root-block,
.grade-10 #review-list > .review-item .g10-q8-range-block,
.grade-10 #review-list > .review-item .g10-q9-analysis-block,
.grade-10 #review-list > .review-item .g10-q9-conclusion,
.grade-10 #review-list > .review-item .g10-q9-root-result,
.grade-10 #review-list > .review-item .g10-q10-condition,
.grade-10 #review-list > .review-item .g10-q10-subblock,
.grade-10 #review-list > .review-item .g10-q10-graph-note,
.grade-10 #review-list > .review-item .g10-q10-key-sequence {
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  padding: 0 !important;
}

.grade-10 .g10-q10-count-block > span,
.grade-10 .g10-q10-scan-results > span {
  border: 0 !important;
  padding-left: 0;
}

/* Level 2: equations, main derivations and numbered calculator steps. */
.grade-10 #review-list > .review-item:nth-child(-n+5) .solution-steps > .solution-step:not(:first-child),
.grade-10 #review-list > .review-item:nth-child(6) .solution-steps > .solution-step:not(:first-child),
.grade-10 .g10-q3-factor,
.grade-10 .g10-q3-truth,
.grade-10 .g10-q3-check,
.grade-10 .g10-q3-final,
.grade-10 .g10-q5-table-step,
.grade-10 .g10-q6-detail,
.grade-10 .g10-q6-step,
.grade-10 .g10-q6-step4,
.grade-10 .g10-q6-summary,
.grade-10 .g10-q7-equation,
.grade-10 .g10-q7-case,
.grade-10 .g10-q7-procedure-step,
.grade-10 .g10-q7-search-note,
.grade-10 .g10-q9-conclusion,
.grade-10 .g10-q10-graph-note {
  margin-left: 1.35rem !important;
  padding-left: 0 !important;
}

.grade-10 #review-list > .review-item:nth-child(6) .solution-steps > .solution-step:has(> strong:only-child) {
  margin-left: 0 !important;
}

.grade-10 .g10-q7-equation {
  text-align: left;
}

.grade-10 .g10-q7-procedure-step {
  gap: .6rem;
  font-weight: 400;
}

.grade-10 .g10-q7-procedure-step > strong {
  min-width: 1.2em;
  font-weight: 700;
}

/* Level 3: supporting detail nested under the step above it. */
.grade-10 .g10-q6-detail-math,
.grade-10 .g10-q6-step4 .g10-q6-keyline:not(.g10-q6-step4-title):not(.g10-q6-step5-title),
.grade-10 .g10-q7-detail-line,
.grade-10 .g10-q7-root-block,
.grade-10 .g10-q8-root-list,
.grade-10 .g10-q8-range-block,
.grade-10 .g10-q8-step-subline,
.grade-10 .g10-q8-coefficient-list,
.grade-10 .g10-q9-analysis-block,
.grade-10 .g10-q9-root-result,
.grade-10 .g10-q10-condition,
.grade-10 .g10-q10-subblock,
.grade-10 .g10-q10-count-block,
.grade-10 .g10-q10-scan-results {
  margin-left: 2.7rem !important;
  padding-left: 0 !important;
}

.grade-10 .g10-q6-step5-title,
.grade-10 .g10-q7-final-step {
  margin-top: 1.35rem;
  padding-top: 0;
  border: 0 !important;
}

.grade-10 .g10-q6-summary,
.grade-10 .g10-q7-final-step,
.grade-10 .g10-q9-conclusion {
  color: #294b68;
  font-weight: 600;
}

.grade-10 #review-list > .review-item .answer-images,
.grade-10 .g10-q9-inline-images {
  border: 0 !important;
  background: transparent !important;
}

.grade-10 .solution-steps .cw-key,
.grade-10 .solution-keylog .cw-key,
.grade-10 .g10-q6-inline-key {
  min-width: 0;
  min-height: 0;
  font-size: 1.48em !important;
  line-height: 1;
}

@media (max-width: 700px) {
  .grade-10 #review-list > .review-item .solution-steps {
    padding: 16px 14px;
  }

  .grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child {
    margin-left: .55rem !important;
  }

  .grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child > strong:first-child,
  .grade-10 #review-list > .review-item .solution-steps > .solution-step:first-child > br + strong {
    margin-left: -.55rem;
  }

  .grade-10 #review-list > .review-item:nth-child(-n+6) .solution-steps > .solution-step:not(:first-child),
  .grade-10 .g10-q3-factor,
  .grade-10 .g10-q3-truth,
  .grade-10 .g10-q3-check,
  .grade-10 .g10-q3-final,
  .grade-10 .g10-q5-table-step,
  .grade-10 .g10-q6-detail,
  .grade-10 .g10-q6-step,
  .grade-10 .g10-q6-step4,
  .grade-10 .g10-q6-summary,
  .grade-10 .g10-q7-equation,
  .grade-10 .g10-q7-case,
  .grade-10 .g10-q7-procedure-step,
  .grade-10 .g10-q7-search-note,
  .grade-10 .g10-q9-conclusion,
  .grade-10 .g10-q10-graph-note {
    margin-left: .55rem !important;
  }

  .grade-10 .g10-q6-detail-math,
  .grade-10 .g10-q6-step4 .g10-q6-keyline:not(.g10-q6-step4-title):not(.g10-q6-step5-title),
  .grade-10 .g10-q7-detail-line,
  .grade-10 .g10-q7-root-block,
  .grade-10 .g10-q8-root-list,
  .grade-10 .g10-q8-range-block,
  .grade-10 .g10-q8-step-subline,
  .grade-10 .g10-q8-coefficient-list,
  .grade-10 .g10-q9-analysis-block,
  .grade-10 .g10-q9-root-result,
  .grade-10 .g10-q10-condition,
  .grade-10 .g10-q10-subblock,
  .grade-10 .g10-q10-count-block,
  .grade-10 .g10-q10-scan-results {
    margin-left: 1.1rem !important;
  }

  .grade-10 .g10-q7-equation,
  .grade-10 .g10-q6-detail-math,
  .grade-10 .g10-q10-key-sequence {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Keep every review card inside the viewport, regardless of wide math or tables later in the list. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.quiz-page-shell,
.quiz-page-card,
#review-view,
.review-list,
.review-item,
.solution-steps,
.solution-step {
  min-width: 0;
  max-width: 100%;
}

.review-list {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

.review-item > *,
.solution-step > * {
  min-width: 0;
  max-width: 100%;
}

.question-table-scroll,
.g10-q5-truth-table,
.g10-q7-equation,
.g10-q10-key-sequence {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.answer-images,
.g10-q9-inline-images {
  min-width: 0;
  max-width: 100%;
}

.answer-image,
.question-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 700px) {
  .quiz-page-shell {
    width: calc(100% - 24px);
  }

  .quiz-page-card,
  .review-item {
    width: 100%;
  }

  .review-item {
    padding: 18px 14px;
  }

  .review-heading h3,
  .item-question,
  .solution-step {
    overflow-wrap: anywhere;
  }

  .g10-q3-factor,
  .g10-q3-truth,
  .g10-q3-check-eval,
  .g10-q3-check-result {
    grid-template-columns: minmax(0, 1fr);
    row-gap: .55rem;
  }

  .g10-q3-factor-lines > span,
  .g10-q3-truth > span,
  .g10-q3-check span {
    white-space: normal;
  }

  .answer-images,
  .answer-images.image-grid-3,
  .answer-images.image-size-standard,
  .g10-q9-inline-images {
    width: 100% !important;
    margin-left: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .answer-images.q8-integration-images {
    display: grid;
  }

  .answer-images.q8-integration-images .answer-image,
  .answer-images.q8-integration-images .answer-image:first-child,
  .answer-images.q8-integration-images .answer-image:last-child,
  .answer-images .answer-image[src$="/g10/answers/q10-05.png"] {
    width: 100%;
    max-width: 100%;
    grid-column: auto;
  }
}
.g10-q3-final { font-family: inherit; font-size: inherit; line-height: inherit; white-space: normal; }
.g10-q3-final strong { font-family: inherit; font-size: inherit; line-height: inherit; font-weight: 700; }
.solution-inline-equation { display: inline-block; width: auto; height: 1.1em; margin: 0 0.32em; vertical-align: -0.22em; }
.solution-inline-equation-wide { height: 1.05em; }

#topic-layout[hidden] {
  display: none;
}

.quiz-result {
  min-height: 420px;
  text-align: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.quiz-result[hidden] {
  display: none;
}

.result-label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.quiz-result h3 {
  margin: 0;
  font-size: 30px;
}

.result-score {
  width: 170px;
  height: 170px;
  border: 10px solid var(--sky);
  border-radius: 50%;
  display: grid;
  place-content: center;
}

.result-score strong,
.result-score span {
  display: block;
}

.result-score strong {
  color: var(--blue);
  font-size: 42px;
}

.result-score span {
  color: var(--muted);
  font-size: 12px;
}

.quiz-result p {
  margin: 0 0 8px;
  color: var(--muted);
}

.quiz-page-card .quiz-instruction {
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.quiz-syllabus {
  margin: 0 0 26px;
  padding: 15px 18px;
  border-left: 3px solid var(--blue);
  background: #f5f8fb;
  color: #102a43;
}

.quiz-syllabus h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.55;
}

.quiz-syllabus ul {
  margin: 0;
  padding-left: 1.25rem;
}

.quiz-syllabus li {
  margin: 3px 0;
  line-height: 1.6;
}

.quiz-list,
.review-list {
  display: grid;
  gap: 18px;
}

.quiz-item,
.review-item {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quiz-item.missing {
  border-color: var(--danger);
  background: #fffafa;
}

.item-number {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.item-question {
  margin: 0 0 18px;
  white-space: pre-line;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", "Noto Serif Thai", "Noto Sans Thai", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0;
}

/* Grade 10 questions 1–5: reproduce the source Google Form hierarchy. */
.gform-question-number {
  display: inline-block;
  margin-right: .55em;
  vertical-align: top;
}

.gform-prompt {
  display: block;
}

.gform-line {
  margin: 0;
}

.gform-paragraph + .gform-paragraph,
.gform-definitions + .gform-paragraph,
.gform-paragraph + .gform-display-math,
.gform-display-math + .gform-paragraph,
.gform-labelled-math + .gform-paragraph,
.gform-paragraph + .gform-note,
.gform-display-math + .gform-labelled-math {
  margin-top: 1.05rem;
}

.gform-definitions {
  width: fit-content;
  max-width: 100%;
  margin: .7rem auto 1rem;
}

.gform-definition {
  display: grid;
  grid-template-columns: 1.4em 1em minmax(0, auto);
  column-gap: .2em;
  align-items: baseline;
}

.gform-definition + .gform-definition {
  margin-top: .3rem;
}

.gform-display-math {
  width: 100%;
  padding-inline: 1rem;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.gform-labelled-math {
  display: grid;
  grid-template-columns: minmax(9.5rem, 1fr) auto minmax(9.5rem, 1fr);
  align-items: baseline;
  margin-top: 1rem;
}

.gform-labelled-math > span:first-child {
  grid-column: 1;
}

.gform-labelled-math > span:last-child {
  grid-column: 2;
  text-align: center;
}

.gform-subquestions,
.gform-code-block {
  margin: .55rem 0 0 2rem;
}

.gform-subquestions .gform-line + .gform-line,
.gform-code-block .gform-line + .gform-line {
  margin-top: .3rem;
}

.gform-note {
  margin-top: 1rem;
}

.gform-condition {
  margin-top: .35rem;
  text-align: center;
}

.gform-condition + .gform-paragraph {
  margin-top: 1.05rem;
}

@media (max-width: 700px) {
  .gform-definitions {
    width: 100%;
    margin-left: 0;
  }

  .gform-definition {
    grid-template-columns: 1.35em .85em minmax(0, 1fr);
  }

  .gform-labelled-math {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .gform-labelled-math > span:first-child,
  .gform-labelled-math > span:last-child {
    grid-column: 1;
  }

  .gform-labelled-math > span:last-child {
    text-align: center;
  }

  .gform-subquestions,
  .gform-code-block {
    margin-left: 1rem;
  }
}

.question-supplement {
  margin: 4px 0 22px;
  font-family: "Cambria Math", "STIX Two Math", "Noto Serif Thai", "Noto Sans Thai", serif;
  color: #102a43;
}

.question-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.question-data-table {
  width: min(100%, 700px);
  margin: 0 auto;
  border-collapse: collapse;
  background: #fff;
  font-size: 16px;
  line-height: 1.45;
}

.question-data-table th,
.question-data-table td {
  padding: 9px 12px;
  border: 1px solid #7b8794;
  text-align: center;
  vertical-align: middle;
}

.question-data-table th {
  background: #f3f6f9;
  font-weight: 700;
}

.question-table-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 34px;
  align-items: start;
}

.question-table-panel {
  min-width: 0;
}

.question-table-panel h4 {
  margin: 0 0 10px;
  color: #102a43;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.question-table-panel .question-data-table {
  width: 100%;
  min-width: 430px;
  font-size: 15px;
}

.question-table-panel .question-data-table th,
.question-table-panel .question-data-table td {
  padding: 8px 9px;
}

.question-document-table {
  width: 100%;
  table-layout: fixed;
}

.question-document-table th {
  font-size: 16px;
}

.question-document-table td {
  text-align: left;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .question-document-table {
    min-width: 720px;
  }
}

.question-matrices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 24px 42px;
}

.question-matrices-stacked {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.question-matrix-block {
  min-width: 0;
}

.question-matrices-stacked .question-matrix-figure {
  display: flex;
  justify-content: center;
  align-items: center;
}

.question-matrices-stacked .question-matrix-figure figcaption {
  min-height: 0;
  margin: 0 10px 0 0;
}

.question-matrix-intro {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.8;
}

.question-inline-matrix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 18px;
  line-height: 1.8;
}

.question-inline-matrix .question-matrix-figure {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.question-inline-matrix .question-matrix-figure figcaption {
  min-height: 0;
  margin: 0 8px 0 0;
  color: inherit;
  font-size: 18px;
  font-weight: 400;
}

.question-inline-matrix-continuation {
  flex: 1 1 310px;
  min-width: 0;
}

.math-overbar {
  display: inline-block;
  text-decoration: overline;
  text-decoration-thickness: 1px;
}

.question-matrix-figure {
  margin: 0;
  text-align: center;
}

.question-matrix-figure figcaption {
  min-height: 1.5em;
  margin-bottom: 10px;
  color: #52616f;
  font-size: 15px;
  font-weight: 600;
}

.question-matrix-suffix {
  flex: 0 0 auto;
  margin-left: 10px;
  font-size: 16px;
  line-height: 1.5;
  white-space: nowrap;
}

.question-matrix {
  --matrix-columns: 3;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--matrix-columns), minmax(34px, auto));
  gap: 8px 16px;
  padding: 8px 17px;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.3;
}

.question-matrix::before,
.question-matrix::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: 8px;
  border-block: 1.5px solid currentColor;
}

.question-matrix::before {
  left: 0;
  border-left: 1.5px solid currentColor;
}

.question-matrix::after {
  right: 0;
  border-right: 1.5px solid currentColor;
}

.question-matrix span {
  min-width: 26px;
  text-align: center;
}

.question-matrix .augmented-cell {
  margin-left: 2px;
  padding-left: 14px;
  border-left: 1px solid #52616f;
}

.question-documents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.question-document {
  overflow: hidden;
  border: 1px solid #b8c4d0;
  border-radius: 7px;
  background: #fff;
}

.question-document h4 {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #b8c4d0;
  background: #f3f6f9;
  color: #0b3f7a;
  font-size: 16px;
  line-height: 1.4;
}

.question-document dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.question-document dt,
.question-document dd {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #e0e6ed;
}

.question-document dt {
  color: #52616f;
  font-weight: 600;
  white-space: nowrap;
}

.question-document dd {
  color: #102a43;
}

.question-after {
  margin-top: 18px;
}

@media (max-width: 700px) {
  .question-table-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .question-data-table[data-columns="5"] {
    min-width: 540px;
    font-size: 15px;
  }

  .question-documents {
    grid-template-columns: 1fr;
  }
}

.math-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  align-items: stretch;
  line-height: 1.15;
  min-width: 1.2em;
  margin: 0 .08em;
  font-size: .92em;
}

.math-frac > span {
  display: block;
  white-space: nowrap;
  text-align: center;
}

.math-frac > span:first-child {
  border-bottom: 1px solid currentColor;
  padding: 0 .12em .14em;
}

.math-frac > span:last-child {
  padding: .26em .12em .02em;
  line-height: 1.15;
}

.math-frac > span:last-child sup {
  font-size: .78em;
  line-height: 0;
  position: relative;
  left: .06em;
  top: -.02em;
}

.math-exp-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  align-items: center;
  line-height: .8;
  font-size: .72em;
  margin: 0 .03em;
}

.item-question sup .math-exp-frac,
.choice sup .math-exp-frac,
.review-answer sup .math-exp-frac,
.review-explanation sup .math-exp-frac {
  font-size: .95em;
  line-height: .95;
  position: relative;
  top: .05em;
}

.math-exp-frac > span:first-child {
  border-bottom: 1px solid currentColor;
  padding: 0 .1em .1em;
}

.math-exp-frac > span:last-child {
  padding-top: .1em;
}

.math-formula {
  display: inline-block;
  vertical-align: middle;
  margin: 0 .12em;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.08em;
  line-height: 1.2;
}

.math-formula mi {
  font-style: italic;
  padding: 0 .015em;
}

.math-root {
  display: inline-block;
  vertical-align: -.04em;
  margin: 0 .025em;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.05em;
}

.math-vector {
  position: relative;
  display: inline-block;
  padding-top: .18em;
  margin: 0 .045em;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-style: italic;
  line-height: 1;
}

.math-vector .math-var {
  margin: 0;
}

.math-vector::before {
  content: "";
  position: absolute;
  top: .04em;
  left: -.015em;
  right: -.09em;
  border-top: 1px solid currentColor;
}

.math-vector::after {
  content: "";
  position: absolute;
  top: -.045em;
  right: -.095em;
  width: .19em;
  height: .19em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.math-integral {
  display: inline-flex;
  align-items: center;
  position: relative;
  font-size: 1.15em;
  margin-right: .15em;
}

.math-limits {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: .48em;
  line-height: .8;
  margin-left: -.18em;
  transform: translateY(-.28em);
}

.math-limits sup,
.math-limits sub {
  font-size: 1em;
  line-height: .8;
  vertical-align: baseline;
}

.math-power {
  font-size: .72em;
  line-height: 0;
  vertical-align: super;
}

.item-question sup,
.choice sup,
.review-answer sup,
.review-explanation sup {
  font-size: .7em;
  line-height: 0;
  vertical-align: super;
}

.item-question sub,
.choice sub,
.review-answer sub,
.review-explanation sub {
  font-size: .7em;
  line-height: 0;
  vertical-align: sub;
}

.math-var {
  font-style: italic;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  margin: 0 .025em;
}

.math-frac .math-var {
  margin: 0 .015em;
}

.math-var .math-var {
  margin: 0;
}

.item-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #ccd7e1;
  border-radius: 6px;
  color: #334455;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", "Noto Serif Thai", "Noto Sans Thai", serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

.choice:hover,
.choice:has(input:checked) {
  border-color: var(--blue);
  background: #eef7ff;
}

.choice input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--blue);
}

.submit-area {
  padding-top: 26px;
  text-align: center;
}

.submit-area .feedback {
  max-width: 620px;
  margin: 0 auto 14px;
}

.quiz-submit {
  min-width: 190px;
}

.result-actions,
.review-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.review-heading {
  justify-content: space-between;
  margin-bottom: 24px;
}

.review-heading h3 {
  margin: 7px 0 0;
  font-size: 24px;
}

.review-item.correct-review {
  border-left: 5px solid var(--success);
}

.review-item.wrong-review {
  border-left: 5px solid var(--danger);
}

.review-status {
  margin: 0 0 12px;
  font-weight: 800;
}

.correct-review .review-status {
  color: var(--success);
}

.wrong-review .review-status {
  color: var(--danger);
}

.review-answer {
  margin: 7px 0;
  color: #41566a;
  line-height: 1.55;
}

.review-explanation {
  margin: 14px 0 0;
  padding: 13px 14px;
  border-radius: 6px;
  background: #f3f7fa;
  color: #344b60;
  line-height: 1.6;
}

.pdf-download {
  width: max-content;
  margin: 28px auto 0;
}

.grade-coming {
  min-height: 360px;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
  display: grid;
  place-content: center;
}

.grade-coming[hidden] {
  display: none;
}

.coming-badge {
  justify-self: center;
  padding: 7px 12px;
  border-radius: 20px;
  background: var(--sky);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.grade-coming h3 {
  margin: 18px 0 8px;
  font-size: 26px;
}

.grade-coming p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 800px) {
  .question-image {
    margin-bottom: 18px;
  }

  .item-answers {
    grid-template-columns: 1fr;
  }

  .quiz-item,
  .review-item {
    padding: 19px 16px;
  }

  .review-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* CASIO brand header */
.site-header {
  background: #003399;
}

.site-header .brand {
  color: #fff;
  display: inline-flex;
  align-items: center;
}

.site-header .brand img {
  display: block;
  width: 112px;
  height: auto;
}

.site-header .nav-row nav a {
  color: #fff;
}

.site-header .nav-row nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-header .lang {
  border-color: rgba(255, 255, 255, 0.7);
  margin-left: auto;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-header .nav-row .header-social {
  flex: 0 0 auto;
}

.header-social a {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  transition: background-color 160ms ease, opacity 160ms ease;
}

.header-social a:hover,
.header-social a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.header-social svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.footer-row.footer-compact {
  justify-content: flex-end;
}

.site-header .lang {
  margin-left: 0;
}

/* Topic selection and standalone quiz pages */
.topic-picker-layout {
  display: block;
}

.topic-picker {
  padding: 28px;
  background: #fbfcfd;
}

.topic-picker-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.topic-picker-heading h3 {
  margin: 0;
  color: #17334f;
  font-size: 22px;
}

.topic-picker-heading > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 14px;
}

.topic-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.topic-button.topic-card {
  display: flex;
  min-height: 118px;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 22px;
  margin: 0;
  padding: 20px;
  border: 1px solid #d8e2eb;
  border-radius: 8px;
  background: #fff;
  color: #243d55;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.topic-button.topic-card:hover,
.topic-button.topic-card:focus-visible {
  border-color: #6f9fc9;
  box-shadow: 0 10px 24px rgba(36, 67, 96, 0.09);
  transform: translateY(-2px);
  outline: none;
}

.topic-card strong {
  display: block;
  color: #17334f;
  font-size: 16px;
  line-height: 1.45;
}

.topic-card .topic-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.topic-card .topic-start b {
  font-size: 18px;
}

.quiz-page-main {
  min-height: calc(100vh - 76px - 105px);
  padding: 42px 0 70px;
  background: linear-gradient(180deg, #f1f7fc 0, #fff 260px);
}

.quiz-page-shell {
  width: min(980px, calc(100% - 48px));
}

.back-to-topics {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #315a7e;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.back-to-topics:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.quiz-page-card {
  background: #fff;
}

.quiz-page-card .practice-top h1 {
  margin: 8px 0 0;
  color: #17334f;
  font-size: 25px;
  line-height: 1.4;
}

.calculator-guide {
  margin: 15px 0 20px;
  padding: 13px 15px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fafc;
}

.calculator-guide-label {
  display: block;
  margin-bottom: 9px;
  color: #5e7082;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.calculator-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.solution-keylog {
  gap: 4px;
  margin: 2px 0 14px;
}

.solution-keylog .cw-key {
  min-width: 0;
  min-height: 0;
  font-size: 28px;
}

.cw-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 37px;
  min-height: 37px;
  color: #111;
  font-family: "CASIO ClassWiz CW01";
  font-size: 34px;
  line-height: 1;
}

.calculator-menu {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid #aab8c5;
  border-radius: 5px;
  background: #fff;
  color: #24394d;
  font-size: 13px;
  font-weight: 700;
}

.calculator-arrow {
  color: #7a8997;
  font-size: 20px;
  line-height: 1;
}

.shop-offer {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) 1.2fr;
  gap: 34px;
  align-items: center;
  margin-top: 32px;
  padding: 26px 30px;
  overflow: hidden;
  border: 1px solid #c8dce8;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef8fc 0%, #fff 56%, #fff4e9 100%);
}

.home-shop-offer {
  margin-top: 38px;
}

.quiz-submit-offer {
  margin-top: 30px;
}

.result-shop-offer {
  width: 100%;
  margin-top: 28px;
  text-align: left;
}

.shop-products {
  position: relative;
  width: min(100%, 320px);
  min-height: 270px;
  margin-inline: auto;
}

.shop-product {
  position: absolute;
  display: block;
  height: auto;
  object-fit: contain;
}

.shop-product.black {
  left: 4%;
  bottom: 0;
  width: 72%;
}

.shop-product.pink {
  right: -7%;
  bottom: -2%;
  width: 61%;
}

.shop-products-hq {
  position: relative;
}

.shop-product-source {
  position: absolute;
  display: block;
  height: auto;
}

.shop-product-source.black-case {
  left: 0;
  bottom: 0;
  width: 78%;
}

.shop-product-source.pink-solo {
  right: 0;
  bottom: 0;
  width: 34%;
}

.b2s-logo {
  display: block;
  width: 118px;
  max-width: 42%;
  height: auto;
  margin: 0 0 12px;
}

.shop-kicker {
  display: inline-block;
  margin-bottom: 9px;
  color: #07618e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.shop-copy h4 {
  margin: 0 0 10px;
  color: #07577f;
  font-size: 23px;
  line-height: 1.35;
}

.shop-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.voucher {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px dashed #aeb735;
  border-radius: 7px;
  background: #fbfceb;
}

.voucher span {
  color: #68720e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.voucher strong {
  color: #172d43;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 1px;
}

.b2s-link {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 18px;
  padding: 13px 19px;
  border-radius: 6px;
  background: #f57f29;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.b2s-link:hover {
  background: #d9681d;
}

@media (max-width: 680px) {
  .site-header .nav-row {
    gap: 12px;
  }

  .header-social {
    gap: 7px;
  }

  .header-social a {
    width: 28px;
    height: 28px;
  }

  .footer-row.footer-compact {
    align-items: flex-end;
  }

  .topic-picker {
    padding: 20px 16px;
  }

  .topic-picker-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topic-card-grid {
    grid-template-columns: 1fr;
  }

  .topic-button.topic-card {
    min-height: 104px;
  }

  .quiz-page-main {
    padding: 28px 0 48px;
  }

  .quiz-page-shell {
    width: min(100% - 30px, 980px);
  }

  .quiz-page-card .practice-top h1 {
    font-size: 22px;
  }

  .shop-offer {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 18px;
  }

  .shop-products {
    min-height: 270px;
  }

  .shop-copy h4 {
    font-size: 21px;
  }
}

/* Keep the B2S product cutouts comfortably inside the promo card on phones. */
@media (max-width: 560px) {
  .shop-offer .shop-products.shop-products-hq {
    width: min(100%, 300px);
    min-height: 250px;
  }

  .shop-offer .shop-product-source.black-case {
    left: 4%;
    width: 72%;
  }

  .shop-offer .shop-product-source.pink-solo {
    right: 4%;
    width: 31%;
  }
}

/* Grade 11 source-form layouts and compact vector notation. */
.g11-source-q3 .question-supplement {
  margin-top: 6px;
  margin-bottom: 18px;
}

.g11-source-q3 .question-table-scroll {
  overflow: visible;
}

.g11-source-q3 .question-data-table {
  width: min(100%, 245px);
}

.g11-source-q3 .question-data-table th:first-child {
  border-color: #7b8794;
  background: #f3f6f9;
}

.g11-source-q3 .question-data-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.g11-source-q4 .question-table-group {
  gap: 24px 46px;
}

.g11-source-q4 .question-table-panel h4 {
  margin-bottom: 12px;
  font-size: 17px;
}

.source-question-after {
  white-space: normal;
}

.source-after-paragraph + .source-after-paragraph {
  margin-top: 18px;
}

.source-after-heading,
.source-scoring-line {
  display: block;
}

.source-after-heading {
  margin-bottom: 3px;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.g11-source-q6 .question-document-table {
  width: 100%;
}

.g11-source-q6 .question-matrices-stacked {
  margin-top: 16px;
}

.g11-source-q6 .question-matrix-intro {
  text-align: center;
}

.g11-source-q6 .question-matrix-figure {
  margin-top: 6px;
}

.g11-compact-root {
  display: inline-flex;
  align-items: baseline;
  margin: 0 .03em;
  line-height: 1;
  vertical-align: baseline;
}

.g11-compact-root::before {
  margin-right: -.015em;
  content: "√";
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.05em;
  line-height: 1;
}

.g11-compact-root > span {
  display: inline-block;
  padding: .02em .01em 0 .02em;
  border-top: 1px solid currentColor;
  line-height: 1;
}

/* Grade 11 Q7 keeps the adjusted vector bars; the radical uses the normal √ glyph. */
.g11-q7-over {
  display: inline-block;
  padding: 0;
  border-top: 1px solid currentColor;
  line-height: 1;
  vertical-align: baseline;
}

.g11-q7-over .math-var {
  position: relative;
  top: -.13em;
  display: inline-block;
  line-height: 1;
}

/* G11 Q4 calculator screens are individual panels with the same spacing as other solutions. */
.grade-11 .solution-steps-g12 .g12-answer-images.g11-sales-images {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  width: min(100%, 600px);
}

.grade-11 .solution-steps-g12 .g12-answer-images.g11-sales-images .answer-image {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 800px) {
  .grade-11 .solution-steps-g12 .g12-answer-images.g11-sales-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grade-11 .solution-steps-g12 .g12-answer-images.g11-sales-images {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Grade 10 Q6: match the supplied solution hierarchy and calculator-step alignment. */
.grade-10 .g10-q6-analysis-heading {
  margin-left: 0 !important;
  color: #245894;
  font-family: Arial, "Noto Sans Thai", Tahoma, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
}

.grade-10 #review-list > .review-item:nth-child(6) .solution-steps > .solution-step:nth-child(3),
.grade-10 #review-list > .review-item:nth-child(6) .solution-steps > .solution-step:nth-child(4),
.grade-10 #review-list > .review-item:nth-child(6) .solution-steps > .solution-step:nth-child(6) {
  text-align: center;
  font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
  font-size: 1.08em;
}

.grade-10 .answer-images.g10-q6-answer-images {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: calc(100% - 1.35rem);
  margin: 2px 0 12px 1.35rem;
  padding-top: 0;
  border-top: 0;
  gap: 10px;
}

.grade-10 .answer-images.g10-q6-answer-images.g10-q6-step2-image {
  margin-top: -.35rem;
}

.grade-10 .answer-images.g10-q6-answer-images .answer-image {
  flex: 0 0 174px;
  width: 174px;
  max-width: 174px;
  height: auto;
  object-position: left top;
}

@media (max-width: 700px) {
  .grade-10 .answer-images.g10-q6-answer-images {
    width: calc(100% - .55rem) !important;
    margin-left: .55rem !important;
    grid-template-columns: none !important;
  }
}

.g11-source-q7 .item-question .math-overbar,
.g11-source-q8 .item-question .math-overbar {
  position: relative;
  display: inline-block;
  padding-top: 0;
  text-decoration: none;
}

.g11-source-q7 .item-question .math-overbar::before,
.g11-source-q8 .item-question .math-overbar::before {
  position: absolute;
  top: .12em;
  right: -.1em;
  left: .1em;
  border-top: 1px solid currentColor;
  content: "";
}

@media (max-width: 700px) {
  .g11-source-q4 .question-table-group {
    grid-template-columns: 1fr;
  }

  .g11-source-q4 .question-table-panel .question-data-table {
    min-width: 430px;
  }

  .g11-source-q6 .question-matrix-intro {
    text-align: left;
  }
}

/* Keep the same hierarchy on the answer-review page. */
#review-list[data-grade="11"] .review-item:nth-child(3) .question-data-table {
  width: min(100%, 245px);
}

#review-list[data-grade="11"] .review-item:nth-child(3) .question-data-table th:first-child {
  border-color: #7b8794;
  background: #f3f6f9;
}

#review-list[data-grade="11"] .review-item:nth-child(3) .question-data-table td:first-child {
  text-align: left;
  font-weight: 700;
}

#review-list[data-grade="11"] .review-item:nth-child(4) .question-table-group {
  gap: 24px 46px;
}

#review-list[data-grade="11"] .review-item:nth-child(6) .question-matrix-intro {
  text-align: center;
}

#review-list[data-grade="11"] .review-item:nth-child(7) .item-question .math-overbar,
#review-list[data-grade="11"] .review-item:nth-child(8) .item-question .math-overbar {
  position: relative;
  display: inline-block;
  padding-top: 0;
  text-decoration: none;
}

#review-list[data-grade="11"] .review-item:nth-child(7) .item-question .math-overbar::before,
#review-list[data-grade="11"] .review-item:nth-child(8) .item-question .math-overbar::before {
  position: absolute;
  top: .12em;
  right: -.1em;
  left: .1em;
  border-top: 1px solid currentColor;
  content: "";
}

/* Grade 10 answer-guide layouts, matched to the approved source pages. */
.g10-q1-source,
.g10-q3-source,
.g10-q4-source {
  display: block;
  width: 100%;
  color: #273f55;
  font-size: 16px;
  line-height: 1.75;
  white-space: normal;
}

.grade-10 #review-list > .review-item .solution-steps > .solution-step:has(> .g10-q1-source),
.grade-10 #review-list > .review-item .solution-steps > .solution-step:has(> .g10-q3-source),
.grade-10 #review-list > .review-item .solution-steps > .solution-step:has(> .g10-q4-source) {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.g10-q1-menu {
  display: block;
}

.g10-q1-source-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0 44px;
}

.g10-q1-source-list > span {
  position: relative;
  display: block;
}

.g10-q1-source-list > span::before {
  position: absolute;
  left: -16px;
  content: "•";
}

.g10-q3-source {
  display: grid;
  grid-template-columns: minmax(145px, 220px) minmax(0, 1fr);
  gap: 7px 24px;
  align-items: baseline;
}

.g10-q3-source-label {
  white-space: nowrap;
}

.g10-q3-source-math {
  text-align: left;
}

.g10-q3-source-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 34px;
  align-items: baseline;
}

.g10-q3-source-result {
  gap: 8px 22px;
}

.g10-q4-source-intro {
  display: block;
}

.g10-q4-source-equations {
  display: grid;
  gap: 8px;
  margin: 18px auto 14px;
  text-align: center;
}

.g10-q4-source-grid {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(0, 1fr);
  gap: 7px 24px;
  align-items: baseline;
}

.g10-q4-source-result {
  display: block;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .g10-q1-source-list {
    margin-left: 28px;
  }

  .g10-q3-source {
    grid-template-columns: minmax(92px, 128px) minmax(0, 1fr);
    gap-inline: 12px;
  }

  .g10-q3-source-line,
  .g10-q3-source-result {
    gap: 4px 12px;
  }

  .g10-q4-source-grid {
    grid-template-columns: minmax(74px, 96px) minmax(0, 1fr);
    gap-inline: 12px;
  }
}


/* Teacher portal link in the shared header */
.site-header .teacher-site-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255,255,255,.06);
  transition: background-color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.site-header .teacher-site-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .22s ease;
}
.site-header .teacher-site-link:hover,
.site-header .teacher-site-link:focus-visible {
  color: #003399;
  background: #fff;
  border-color: #fff;
  box-shadow: 0 5px 15px rgba(0,15,65,.18);
  transform: translateY(-2px);
}
.site-header .teacher-site-link:hover svg,
.site-header .teacher-site-link:focus-visible svg { transform: translate(2px,-2px); }
.site-header .teacher-site-link:focus-visible { outline: 2px solid #ffdb65; outline-offset: 3px; }
@media (max-width: 450px) {
  .site-header .nav-row { gap: 8px; }
  .site-header .brand img { width: 86px; }
  .site-header .teacher-site-link { min-height: 34px; padding: 6px 8px; font-size: 11px; gap: 3px; }
  .site-header .teacher-site-link svg { width: 13px; height: 13px; }
  .site-header .header-social { gap: 2px; margin-left: auto; }
  .site-header .header-social a { width: 25px; height: 28px; }
  .site-header .header-social svg { width: 18px; height: 18px; }
  .site-header .lang { padding: 7px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .teacher-site-link,
  .site-header .teacher-site-link svg { transition: none; }
}
