:root {
  --mcq-red: #9b3f4b;
  --mcq-coral: #c95d64;
  --mcq-cream: #fff9f4;
  --mcq-ink: #3f3436;
  --mcq-muted: #735d60;
  --mcq-line: #ead2ca;
  --mcq-green: #28745a;
}

.chemistry-mcq-page {
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--mcq-cream);
  color: var(--mcq-ink);
}

.chemistry-mcq-page *,
.chemistry-mcq-page *::before,
.chemistry-mcq-page *::after {
  box-sizing: border-box;
}

.chemistry-mcq-page img,
.chemistry-mcq-page svg {
  max-width: 100%;
}

.mcq-shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.mcq-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 2.5rem;
  color: var(--mcq-muted);
  font-size: .9rem;
}

.mcq-breadcrumb a {
  color: inherit;
}

.mcq-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

.mcq-hero > *,
.mcq-result-hero > *,
.mcq-topic > *,
.mcq-options span > * {
  min-width: 0;
}

.mcq-hero h1,
.mcq-quiz-heading h1,
.mcq-result-hero h1 {
  margin: .35rem 0 1rem;
  overflow-wrap: anywhere;
  font: 500 clamp(2.5rem, 6vw, 4.8rem) / 1 Georgia, serif;
  letter-spacing: -.045em;
}

.mcq-hero > div > p:last-child,
.mcq-quiz-heading > p:last-child {
  max-width: 720px;
  color: var(--mcq-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.mcq-hero aside {
  display: grid;
  gap: .5rem;
  padding: 1.4rem;
  border: 1px solid var(--mcq-line);
  border-radius: 1rem;
  background: #fff;
}

.mcq-hero aside strong {
  color: var(--mcq-red);
  font-size: 1.1rem;
}

.mcq-hero aside span {
  color: var(--mcq-muted);
  line-height: 1.5;
}

.mcq-eyebrow {
  margin: 0;
  color: var(--mcq-red);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mcq-alert {
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--mcq-coral);
  border-radius: .5rem;
  background: #fff1dd;
  overflow-wrap: anywhere;
}

.mcq-builder {
  display: grid;
  gap: 2rem;
}

.mcq-builder fieldset,
.mcq-question {
  min-width: 0;
}

.mcq-builder fieldset {
  margin: 0;
  padding: 1.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--mcq-line);
}

.mcq-builder legend {
  font-size: 1.3rem;
  font-weight: 800;
}

.mcq-builder legend span {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  margin-right: .6rem;
  place-items: center;
  border-radius: 50%;
  background: #f5d2cf;
  color: var(--mcq-red);
}

.mcq-help {
  color: var(--mcq-muted);
  overflow-wrap: anywhere;
}

.mcq-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.mcq-pill {
  cursor: pointer;
}

.mcq-pill input,
.mcq-options input {
  position: absolute;
  opacity: 0;
}

.mcq-pill span {
  display: block;
  min-height: 44px;
  padding: .7rem 1rem;
  border: 1px solid var(--mcq-line);
  border-radius: 999px;
  background: #fff;
  font-weight: 750;
  text-align: center;
}

.mcq-pill input:checked + span {
  border-color: var(--mcq-red);
  background: var(--mcq-red);
  color: #fff;
}

.mcq-pill input:focus-visible + span {
  outline: 3px solid #efb1b7;
  outline-offset: 2px;
}

.mcq-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.mcq-topic {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--mcq-line);
  border-radius: .85rem;
  background: #fff;
}

.mcq-topic:has(input:checked) {
  border-color: var(--mcq-red);
  box-shadow: 0 0 0 2px rgba(155, 63, 75, .12);
}

.mcq-topic input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--mcq-red);
}

.mcq-topic__copy {
  display: grid;
  gap: .25rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mcq-topic__copy small {
  color: var(--mcq-muted);
}

.mcq-topic > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--mcq-red);
  font-size: .82rem;
  font-weight: 750;
}

.mcq-topic:has(input:disabled) {
  opacity: .62;
}

.mcq-primary {
  display: inline-flex;
  width: max-content;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--mcq-red);
  color: #fff !important;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.mcq-primary:hover {
  background: var(--mcq-coral);
}

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

.mcq-seo-copy {
  margin-top: 4rem;
  padding: 2rem;
  border-radius: 1rem;
  background: #f4e9df;
  overflow-wrap: anywhere;
}

.mcq-seo-copy h2 {
  font: 500 2rem / 1.1 Georgia, serif;
}

.mcq-seo-copy p {
  color: var(--mcq-muted);
  line-height: 1.65;
}

.mcq-quiz-heading {
  margin-bottom: 2rem;
  overflow-wrap: anywhere;
}

.mcq-question-list {
  display: grid;
  gap: 1.25rem;
}

.mcq-question {
  margin: 0;
  padding: 1.4rem;
  border: 1px solid var(--mcq-line);
  border-radius: 1rem;
  background: #fff;
}

.mcq-question legend {
  float: left;
  width: 100%;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.55;
}

.mcq-question legend span {
  display: block;
  color: var(--mcq-red);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mcq-question__image {
  display: block;
  max-width: min(100%, 620px);
  max-height: 430px;
  object-fit: contain;
  margin: 0 auto 1rem;
  border-radius: .6rem;
}

.mcq-options {
  display: grid;
  clear: both;
  gap: .6rem;
}

.mcq-options label {
  min-width: 0;
  cursor: pointer;
}

.mcq-options span {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  min-width: 0;
  min-height: 48px;
  padding: .8rem;
  border: 1px solid var(--mcq-line);
  border-radius: .65rem;
  overflow-wrap: anywhere;
}

.mcq-options span strong {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: #f7dfd0;
  color: var(--mcq-red);
}

.mcq-options input:checked + span {
  border-color: var(--mcq-red);
  background: #fff8f5;
}

.mcq-options input:focus-visible + span {
  outline: 3px solid #efb1b7;
}

.mcq-result-hero {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 2rem;
  border-radius: 1.2rem;
  background: #f4d3d0;
}

.mcq-result-hero h1 {
  margin: .3rem 0;
}

.mcq-result-list {
  display: grid;
  gap: 1rem;
}

.mcq-result {
  padding: 1.4rem;
  border: 1px solid var(--mcq-line);
  border-left: 5px solid var(--mcq-coral);
  border-radius: .8rem;
  background: #fff;
  overflow-wrap: anywhere;
}

.mcq-result.is-correct {
  border-left-color: var(--mcq-green);
}

.mcq-result h2 {
  font-size: 1.05rem;
  line-height: 1.5;
}

.mcq-result__status {
  color: var(--mcq-red);
  font-weight: 850;
}

.mcq-result.is-correct .mcq-result__status {
  color: var(--mcq-green);
}

.mcq-explanation {
  padding: 1rem;
  border-radius: .6rem;
  background: #f8f2ed;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.chemistry-mcq-page .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 760px) {
  .mcq-shell {
    width: min(calc(100% - 1.5rem), 1080px);
    padding: 3.75rem 0 3.5rem;
  }

  .mcq-breadcrumb {
    gap: .4rem;
    margin-bottom: 1.75rem;
    font-size: .84rem;
    line-height: 1.4;
  }

  .mcq-hero,
  .mcq-topic-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mcq-hero {
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .mcq-hero h1,
  .mcq-quiz-heading h1,
  .mcq-result-hero h1 {
    font-size: clamp(2.1rem, 10vw, 3.15rem);
    line-height: 1.03;
  }

  .mcq-hero > div > p:last-child,
  .mcq-quiz-heading > p:last-child {
    font-size: 1rem;
    line-height: 1.55;
  }

  .mcq-hero aside {
    padding: 1rem;
  }

  .mcq-builder {
    gap: 1.65rem;
  }

  .mcq-builder fieldset {
    padding-top: 1.25rem;
  }

  .mcq-builder legend {
    font-size: 1.12rem;
    line-height: 1.35;
  }

  .mcq-choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }

  .mcq-pill,
  .mcq-pill span {
    width: 100%;
    height: 100%;
  }

  .mcq-topic {
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem .75rem;
    padding: .9rem;
  }

  .mcq-topic > a {
    grid-column: 2;
    width: max-content;
    max-width: 100%;
  }

  .mcq-primary {
    width: 100%;
  }

  .mcq-seo-copy {
    margin-top: 3rem;
    padding: 1.35rem;
  }

  .mcq-seo-copy h2 {
    font-size: 1.75rem;
  }

  .mcq-question {
    padding: 1rem;
    border-radius: .8rem;
  }

  .mcq-options span {
    padding: .7rem;
  }

  .mcq-result-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .mcq-result {
    padding: 1rem;
  }
}

@media (max-width: 420px) {
  .mcq-shell {
    width: calc(100% - 1rem);
  }

  .mcq-breadcrumb {
    font-size: .78rem;
  }

  .mcq-hero h1,
  .mcq-quiz-heading h1,
  .mcq-result-hero h1 {
    font-size: clamp(2rem, 10.5vw, 2.65rem);
  }

  .mcq-builder legend span {
    width: 1.8rem;
    height: 1.8rem;
    margin-right: .4rem;
  }

  .mcq-choice-row {
    gap: .5rem;
  }

  .mcq-pill span {
    padding: .65rem .5rem;
    font-size: .9rem;
  }

  .mcq-topic {
    padding: .8rem;
  }

  .mcq-question {
    padding: .85rem;
  }

  .mcq-options span {
    grid-template-columns: 1.85rem minmax(0, 1fr);
    gap: .55rem;
    padding: .65rem;
  }

  .mcq-options span strong {
    width: 1.85rem;
    height: 1.85rem;
  }

  .mcq-result-hero,
  .mcq-result,
  .mcq-seo-copy {
    border-radius: .7rem;
  }
}
