:root {
  color-scheme: light;
  font-family: system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

body {
  max-width: 42rem;
  margin: 2rem auto;
  padding: 0 1rem;
  background: white;
  color: black;
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-underline-offset: .15em;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

h1, h2, h3 {
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.75rem; }
h3 { font-size: 1.05rem; margin-bottom: .25rem; }

.skip-link {
  position: absolute;
  top: 0;
  transform: translateY(-150%);
  background: white;
}

.skip-link:focus { transform: none; }

.unit-list { list-style: none; padding: 0; }
.footnotes { font-size: .875rem; }

.activity + .activity { margin-top: 1.5rem; }
.activity p { margin: .35rem 0; }
.worksheet-row { display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: .1em 1.65em;
  margin: .35em 0 .6em;
  padding-inline-start: 1.15em;
  list-style-type: disc;
}
.questions > li + li { margin-top: .55rem; }

.matching {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.75rem, 12%, 5rem);
  margin-block: .55rem;
}
.matching ol { list-style: none; margin: 0; padding: 0; }
.matching li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .4em;
  min-height: 1.75em;
  margin-block-end: .45em;
}
.matching-prompts li { padding-inline-end: 1em; }
.matching-options li { padding-inline-start: 1em; }
.matching-prompts li::after, .matching-options li::before {
  content: "";
  position: absolute;
  inset-block-start: .62em;
  border: .19em solid currentColor;
  border-radius: 50%;
}
.matching-prompts li::after { inset-inline-end: 0; }
.matching-options li::before { inset-inline-start: 0; }

.table-scroll { max-width: 100%; overflow-x: auto; margin: .5rem 0; }
.table-scroll:focus-visible { outline: 2px solid; outline-offset: 2px; }
.table-scroll table { border-collapse: collapse; overflow-wrap: normal; }
.table-scroll caption { text-align: left; margin-bottom: .35rem; }
.table-scroll th, .table-scroll td { border: 1px solid #aaa; padding: .25rem .5rem; text-align: left; vertical-align: top; }
.table-scroll th[colspan], .table-scroll .survey-choice { text-align: center; }
.survey-name { min-width: 5.5rem; }
.empty-cell { height: 1.8rem; min-width: 5rem; }

.lesson-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lesson-actions button {
  font: inherit;
  background: white;
  color: black;
  border: 1px solid currentColor;
  padding: .15rem .6rem;
  cursor: pointer;
}

.choices { list-style: none; padding: 0; margin: .25rem 0; }
.choices li + li { margin-top: .2rem; }

.answer-mark {
  display: inline-block;
  box-sizing: border-box;
  width: .85em;
  height: .85em;
  margin-inline-end: .5em;
  border: 1px solid currentColor;
  vertical-align: -.02em;
  text-align: center;
  line-height: .8;
}
.answer-mark.round { border-radius: 50%; }
.survey-choice .answer-mark { margin: 0; }

.blank {
  display: inline-block;
  width: 6em;
  max-width: 100%;
  border-bottom: 1px solid currentColor;
  color: inherit;
  line-height: 1.2;
  text-indent: -999px;
  overflow: hidden;
  vertical-align: bottom;
}
.response { margin: .35rem 0 .65rem; }
.response span { font-size: .875em; }
.answer-line { height: 1.6em; border-bottom: 1px solid currentColor; }
.response.one-line { display: flex; align-items: baseline; gap: .5em; }
.response.one-line .answer-line { flex: 1; }

@page {
  size: A4 portrait;
  margin: 14mm 15mm;
}

@media print {
  .screen-only, .skip-link { display: none; }

  body {
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 11pt;
    line-height: 1.4;
  }

  h1 { font-size: 18pt; margin: 0 0 9pt; }
  h2 { font-size: 14pt; margin: 12pt 0 5pt; }
  h3 { font-size: 12pt; }
  h1, h2, h3, .skill, .instruction, .word-bank, caption { break-after: avoid; }
  p, li { orphans: 2; widows: 2; }
  #story p { margin: 0 0 7pt; }
  .activity + .activity { margin-top: 10pt; }

  .table-scroll { overflow: visible; }
  .table-scroll table { max-width: 100%; }
  .table-scroll th, .table-scroll td { border-color: #666; padding: 3pt 5pt; }
  thead { display: table-header-group; }
  .activity:has(table, .checklist, .matching),
  .activity:has(> .response):not(:has(.answer-item, .questions)),
  tr, .questions > li, .answer-item, .response, .checklist, .word-bank { break-inside: avoid; }
  .questions .choices { display: flex; flex-wrap: wrap; gap: 1pt 14pt; }
  .checklist .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2pt 12pt; }
  .choices li + li { margin-top: 0; }
  .matching { column-gap: 24mm; }
  .answer-line { height: 6mm; }
}
