.xr-question {
  position: relative;
  color: #111827;
  font-family: "Sarabun", "Noto Sans Thai", sans-serif;
  line-height: 1.85;
  color-scheme: light;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.xr-font-noto .xr-question {
  font-family: "Noto Sans Thai", sans-serif;
}

.xr-question .rt-b {
  font-weight: 700;
}

.xr-question .rt-u {
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.24em;
  text-decoration-skip-ink: auto;
}

.xr-body-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: auto;
}

.xr-image-btn {
  display: block;
  position: relative;
  margin: 12px auto 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  cursor: zoom-in;
  max-width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.xr-image {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 36vh;
  max-height: min(36vh, 420px);
  max-height: min(36dvh, 420px);
  margin: 0 auto;
  object-fit: contain;
  -webkit-user-drag: none;
  pointer-events: none;
}

.xr-image-hint {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  font-size: 12.5px;
  line-height: 1.8;
  white-space: nowrap;
  pointer-events: none;
}

.xr-choices {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xr-choice {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  line-height: 1.8;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.xr-choice:active {
  background: #f3f4f6;
}

.xr-choice.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.xr-choice:disabled {
  cursor: default;
  opacity: 0.7;
}

.xr-choice-label {
  flex: 0 0 auto;
  min-width: 1.9em;
  font-weight: 700;
}

.xr-choice-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.xr-text-answer {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 10px 12px;
  min-height: 96px;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  font: inherit;
  font-size: max(16px, 1em);
  line-height: 1.7;
  color: #111827;
  background: #ffffff;
  resize: vertical;
  -webkit-user-select: text;
  user-select: text;
}

.xr-text-answer:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.xr-viewer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: rgba(10, 12, 16, 0.94);
  -webkit-user-select: none;
  user-select: none;
}

.xr-viewer-bar {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
}

.xr-viewer-btn {
  min-height: 44px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font: inherit;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.xr-viewer-close {
  background: #ffffff;
  color: #111827;
  border-color: #ffffff;
}

.xr-viewer-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.xr-viewer-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #ffffff;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

.xr-viewer.is-zoomed .xr-viewer-stage {
  display: block;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.xr-viewer.is-zoomed .xr-viewer-img {
  max-width: none;
  max-height: none;
  width: 200%;
  height: auto;
  cursor: zoom-out;
}

html.xr-viewer-open,
html.xr-viewer-open body {
  overflow: hidden;
}

.wm-layer {
  position: fixed;
  inset: 0;
  z-index: 9500;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  display: block;
}

.wm-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260vmax;
  height: 260vmax;
  transform: translate(-50%, -50%) rotate(-30deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wm-row {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(17, 24, 39, var(--wm-alpha, 0.12));
}

.wm-row:nth-child(even) {
  margin-left: -140px;
}

.wm-item {
  flex: 0 0 auto;
}
