body {
  main {
	section.exam {
	  --border-color: oklch(from currentColor calc(0.6534 + (l - 0.6534) * 0.25) calc(c * 0.2) h / 0.8);
	  article {
		background: oklch(from currentColor clamp(0.45, var(--test-contrast), 0.85) 0 h / 0.8);
		> div {
		}
		h2 {
		  margin: 0.25em 0 0.5em;
		  padding: 4px 0.5em;
		  border-bottom: 3px double var(--border-color);
		  font-size: 1em;
		}
	  }
	}
  }
}

@media screen and (hover: hover) and (pointer: fine) {
  ruby {
	padding-top: 0px;
	rt {
	  margin-bottom: -0.25em;
	}
  }
}

div.mon {
  max-width: 95%;
  container-type: inline-size;
  container-name: mondai;
  display: block;
  line-height: 1.85;

  margin: 0; margin-bottom: 1.5em;
  border-bottom:1px dashed var(--border-color);
  padding: 0;
  font-size: 0.9em;
  @media (width > 400px) {
	margin-bottom: 1em;
	border-bottom:none;
	font-size: clamp(10pt, 1em, 16pt);
  }

  div {
	margin: 0; padding: 0;
  }

  &:has(> div.scrollable) {
	position: relative;
	margin-bottom: 2.5em;
	&::after {
	  content: "［\20\00AB\00BB\20一部横スクロール可］";
	  position: absolute;
	  bottom: -2.5em;
	  left: 1em;
	  font-size: 0.8em;
	}
  }

  > div {
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: oklch(from currentColor l c h / 0.5) transparent;
	scrollbar-gutter: stable both-edges;

	&, > div { margin-bottom: 0.5em; }

	&:empty { display: none; }
	&:first-of-type {
	  &:has(span) {
		display: grid;
		grid-template-columns: max-content 1fr;
		justify-content: flex-start;
		align-items: first baseline;
	  }
	  &:not(: has(span)) {
		text-indent: -4em;
		padding-left: 4em;
	  }
	}
	&:nth-of-type(2) {
	  margin-left: 1.5em;
	  margin: 1em 1.5em;
	  &:has(div > span) {
		> div {
		  display:grid;
		  grid-template-columns: max-content 1fr;
		  justify-content: flex-start;
		  align-items: first baseline;
		  > span {
		  }
		}
	  }
	  &:has(img) {
		margin-left: 2.5em;
		img {
		  display: inline-block;
		  background: oklch(1 0 0);
		  max-width: min(600px, 100%);
		  max-height: 50dvh;
		  width: auto;
		  height:auto;
		  
		}
	  }
	  &:not(: has(img)) {
		text-indent: -1em;
		padding-left: 1em;
	  }
	}
	&:last-of-type {
	  &:has(div > span) {
		display: grid;
		grid-template-columns: max-content 1fr;
		> span {
		  grid-column: 2 / -1;
		}
		> div {
		  grid-column: 1 / -1;
		  display: grid;
		  grid-template-columns: subgrid;
		  justify-content: flex-start;
		  align-items: first baseline;
		}
	  }
	  &.nowrap {
		> div, > span {
		  white-space: nowrap;
		}
	  }
	}
  }
}

input[name=answer] {
  + label[for=answer] {
	display: inline-block;
	margin: 8px 0.5em;
	padding: 0.25em 0.5em;
	border:2px solid oklch(from var(--bg-color) clamp(0.2, var(--test-contrast), 0.9) c h);
	border-radius: 8px;
	color: oklch(0 0 0);
	background: oklch(0.7 0.05 285.4);
	cursor: pointer;
  }
  &:checked {
	+ label[for=answer] {
	  background:oklch(1 0.15 109.4);
	}
	~ div.mon div.ans {
	  color:oklch(from var(--bg-color) clamp(0.4, var(--test-contrast), 0.8) 0.45 calc(h + 88));
	}
}}
