/* Closed research choices: compact, legible, and consistent across browsers. */
.choices:not(.multiple-choice-mode) {
  direction: rtl;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  flex: 0 1 auto;
  max-height: min(42dvh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
}

.choices:not(.multiple-choice-mode) > .muted {
  grid-column: 1 / -1;
  margin-inline: 2px;
}

.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 12px 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: normal;
}

.choice-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.7em;
  min-height: 2.25em;
  padding-inline: 5px;
  border: 1px solid #cad9ee;
  border-radius: 8px;
  background: #edf4ff;
  color: #24538d;
  font-size: 0.82em;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.choice-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.choices.multiple-choice-mode {
  grid-template-columns: minmax(0, 1fr);
}

.choices.multiple-choice-mode > .muted,
.choices.multiple-choice-mode > .primary {
  grid-column: 1 / -1;
}

@media (min-width: 721px) and (max-height: 850px) {
  /* Give the closed choices room on short laptop/Windows viewports. */
  .messages {
    min-height: 100px;
  }
}

@media (max-width: 600px) {
  .choices:not(.multiple-choice-mode) {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    max-height: min(34dvh, 280px);
  }

  .choice {
    min-height: 56px;
  }

  .messages {
    min-height: 160px;
  }
}
