:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #53606d;
  --paper: #fff;
  --workspace: #eef1f3;
  --rule: #cfd6dc;
  --accent: #315f7d;
  --accent-soft: #e8f1f6;
  --answer: #245f42;
  --zoom: 1;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR",
    "Noto Sans KR", "Yu Gothic UI", "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--workspace);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.68;
}

body[data-worksheet="nona"] {
  --accent: #315f7d;
  --accent-soft: #e8f1f6;
}

body[data-worksheet="hepta"] {
  --accent: #786238;
  --accent-soft: #f5efe2;
}

button,
select,
input {
  font: inherit;
}

button,
select,
input[type="range"],
input[type="color"] {
  accent-color: var(--accent);
}

button,
select,
.button-link {
  min-height: 42px;
  border: 1px solid #aeb8c1;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.76rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, white);
  outline-offset: 2px;
}

button[aria-pressed="true"],
button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.4rem;
  left: 0.4rem;
  transform: translateY(-160%);
  padding: 0.55rem 0.8rem;
  background: #fff;
  color: var(--ink);
}

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

.classroom-toolbar {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid #bcc5cd;
  background: rgb(247 249 250 / 97%);
  box-shadow: 0 2px 8px rgb(26 35 44 / 10%);
  backdrop-filter: blur(8px);
}

.toolbar-row,
.annotation-panel {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0.5rem clamp(0.55rem, 2vw, 1.2rem);
}

.toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  overflow-x: visible;
  scrollbar-width: thin;
}

.toolbar-brand {
  margin-right: 0.35rem;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.toolbar-separator {
  width: 1px;
  height: 28px;
  flex: 0 0 1px;
  margin: 0 0.16rem;
  background: #cbd2d8;
}

.section-select {
  min-width: 10rem;
  padding: 0.4rem 2rem 0.4rem 0.55rem;
}

.section-indicator {
  min-width: 4.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  white-space: nowrap;
}

.annotation-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.48rem 0.62rem;
  border-top: 1px solid #d7dde2;
}

.annotation-panel[hidden] {
  display: none;
}

.tool-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-right: 0.6rem;
  border-right: 1px solid #d5dbe0;
}

.tool-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.tool-group-label,
.range-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.range-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.range-label input {
  width: 7rem;
}

.color-button {
  width: 42px;
  padding: 0;
}

.color-button::before {
  width: 21px;
  height: 21px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #909aa3;
  content: "";
}

.color-button[aria-pressed="true"]::before {
  box-shadow: 0 0 0 3px var(--accent);
}

.worksheet-stage {
  overflow-x: auto;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(0.5rem, 2vw, 1.2rem) 4rem;
}

.worksheet-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  zoom: var(--zoom);
}

.worksheet-header,
.source-page {
  background: var(--paper);
}

.worksheet-header {
  margin-bottom: 1rem;
  border-top: 7px solid var(--accent);
  padding: clamp(1.2rem, 3vw, 2.1rem);
  box-shadow: 0 2px 18px rgb(24 33 43 / 9%);
}

.worksheet-kicker {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.worksheet-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  line-height: 1.15;
}

.worksheet-subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.source-page {
  position: relative;
  isolation: isolate;
  margin: 0 0 1.15rem;
  padding: clamp(1.25rem, 4vw, 2.65rem);
  box-shadow: 0 2px 18px rgb(24 33 43 / 9%);
}

.source-page::before {
  position: absolute;
  z-index: 1;
  top: 0.65rem;
  right: 0.85rem;
  color: #7a858e;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  content: "SOURCE PAGE " attr(data-page);
}

.print-page-content,
.print-column {
  display: block;
}

.print-column + .print-column {
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 2px solid var(--rule);
}

.document-banner {
  margin: 0 0 1.2rem;
  background: #111;
  color: #fff;
  padding: 1rem 1.25rem;
  text-align: center;
}

.document-banner strong {
  display: block;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}

.document-banner span {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.03rem;
  font-weight: 700;
}

.section-bar {
  margin: 1.5rem 0 1rem;
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.55rem 0.75rem;
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1.35;
}

.section-bar:first-child {
  margin-top: 0;
}

.directions {
  margin: 0.85rem 0;
  font-weight: 800;
}

.passage,
.summary-box {
  margin: 0 0 1.3rem;
  border: 1.5px solid #6a737b;
  padding: 1.1rem 1.2rem;
  line-height: 1.85;
}

.passage p,
.summary-box p {
  margin: 0 0 1rem;
}

.passage p:last-child,
.summary-box p:last-child {
  margin-bottom: 0;
}

.blank {
  display: inline-block;
  min-width: 4.2em;
  border-bottom: 1.5px solid currentColor;
  color: transparent;
  line-height: 0.95;
  user-select: none;
}

.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.question {
  position: relative;
  z-index: 2;
  margin: 0 0 1.5rem;
  padding-left: 2.15rem;
  break-inside: avoid;
}

.question-number {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.75rem;
  color: var(--accent);
  font-weight: 850;
  text-align: right;
}

.question-prompt {
  margin: 0 0 0.45rem;
  font-weight: 650;
}

.question-image {
  display: block;
  width: min(100%, 330px);
  max-height: 230px;
  margin: 0.25rem 0 0.65rem;
  object-fit: contain;
  object-position: left center;
}

.choices {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.choice {
  position: relative;
  margin: 0.18rem 0;
  padding-left: 2.25rem;
}

.choice-label {
  position: absolute;
  left: 0;
  font-weight: 650;
}

.statement-list {
  margin: 0.3rem 0;
  padding: 0;
  list-style: none;
}

.statement-list li {
  margin: 0.18rem 0;
}

.answer-controls {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  margin: 0.55rem 0 0;
}

.answer-toggle {
  min-height: 38px;
  border-color: color-mix(in srgb, var(--accent) 45%, #aeb8c1);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 750;
}

.answer-slot {
  min-height: 1.55rem;
  color: var(--answer);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
}

.answer-content {
  visibility: hidden;
  opacity: 0;
}

.question.answer-visible .answer-content {
  visibility: visible;
  opacity: 1;
}

.annotation-canvas {
  position: absolute;
  z-index: 12;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

body[data-annotation-tool="pen"] .annotation-canvas,
body[data-annotation-tool="eraser"] .annotation-canvas {
  pointer-events: auto;
}

body.annotations-hidden .annotation-canvas {
  visibility: hidden;
}

.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.home-card {
  width: min(100%, 850px);
  border-top: 8px solid #283947;
  background: #fff;
  padding: clamp(1.5rem, 5vw, 3.4rem);
  box-shadow: 0 15px 50px rgb(24 33 43 / 13%);
}

.home-card h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 1.1;
}

.home-card > p {
  color: var(--muted);
}

.worksheet-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.worksheet-choice {
  display: block;
  border: 1px solid var(--rule);
  border-top: 5px solid var(--choice-accent);
  padding: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}

.worksheet-choice:hover {
  border-color: var(--choice-accent);
  background: color-mix(in srgb, var(--choice-accent) 7%, white);
}

.worksheet-choice strong,
.worksheet-choice span {
  display: block;
}

.worksheet-choice strong {
  font-size: 1.4rem;
}

.worksheet-choice span {
  margin-top: 0.3rem;
  color: var(--muted);
}

.screen-only-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .toolbar-brand,
  .toolbar-separator.hide-small,
  .hide-small {
    display: none;
  }

  .toolbar-row {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .worksheet-choices {
    grid-template-columns: 1fr;
  }

  .answer-controls {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .answer-toggle {
    width: max-content;
  }

  .source-page {
    padding: 1.2rem 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  :root {
    --ink: #000;
  }

  html,
  body {
    width: 210mm;
    margin: 0;
    background: #fff;
    color: #000;
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR",
      "Noto Sans KR", "Yu Gothic UI", "Microsoft YaHei UI", sans-serif;
    font-size: 8.45pt;
    line-height: 1.38;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .classroom-toolbar,
  .worksheet-header,
  .screen-only-note,
  .answer-controls,
  .annotation-canvas,
  .skip-link {
    display: none !important;
  }

  .worksheet-stage,
  .worksheet-shell {
    width: 210mm;
    margin: 0;
    padding: 0;
    overflow: visible;
    zoom: 1;
  }

  .source-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    padding: 8.5mm 9mm 9mm;
    overflow: hidden;
    break-after: page;
    box-shadow: none;
  }

  .source-page:last-child {
    break-after: auto;
  }

  .source-page::before {
    display: none;
  }

  .source-page::after {
    position: absolute;
    bottom: 3.5mm;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8pt;
    content: attr(data-page);
  }

  .print-page-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 8mm;
    height: 100%;
  }

  .print-column {
    min-width: 0;
  }

  .print-column + .print-column {
    margin: 0;
    border: 0;
    border-left: 0.35mm solid #444;
    padding: 0 0 0 4mm;
  }

  .document-banner {
    margin: 0 0 3mm;
    padding: 3mm 2.5mm;
  }

  .document-banner strong {
    font-size: 15pt;
  }

  .document-banner span {
    font-size: 11pt;
  }

  .section-bar {
    margin: 2.6mm 0 1.8mm;
    border-left-width: 1.2mm;
    padding: 1.2mm 1.8mm;
    font-size: 10.6pt;
  }

  .directions {
    margin: 1.8mm 0;
  }

  .passage,
  .summary-box {
    margin: 0 0 2.2mm;
    border-width: 0.35mm;
    padding: 2mm 2.4mm;
    line-height: 1.46;
  }

  .passage p,
  .summary-box p {
    margin: 0 0 2.2mm;
  }

  .question {
    margin: 0 0 2.8mm;
    padding-left: 5.2mm;
  }

  .question-number {
    width: 4.2mm;
  }

  .question-prompt {
    margin-bottom: 0.7mm;
  }

  .choice {
    margin: 0;
    padding-left: 6mm;
  }

  .question-image {
    width: auto;
    max-width: 43mm;
    height: 25mm;
    max-height: 25mm;
    margin: 0.5mm 0 1mm;
    object-fit: contain;
  }

  .statement-list li {
    margin: 0;
  }

  .blank {
    min-width: 3.5em;
  }
}

/* 2026 compact classroom and paper-efficient layout */
:root {
  --toolbar-offset: 64px;
}

.toolbar-compact {
  display: flex;
  width: min(100%, 1500px);
  min-height: 48px;
  margin: 0 auto;
  padding: 0.35rem 0.65rem;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-compact .toolbar-brand {
  margin-right: auto;
}

.toolbar-compact button,
.toolbar-compact .button-link,
.annotation-panel button {
  min-height: 36px;
  padding: 0.35rem 0.62rem;
  font-size: 0.86rem;
}

.annotation-panel {
  width: min(100%, 1500px);
  padding: 0.4rem 0.65rem 0.55rem;
  gap: 0.4rem;
}

.annotation-panel .tool-group {
  gap: 0.28rem;
  padding-right: 0.45rem;
}

.worksheet-stage {
  overflow: visible;
  padding: 0.7rem clamp(0.35rem, 1vw, 0.9rem) 2rem;
}

.worksheet-shell {
  width: min(100%, 1500px);
}

.worksheet-header {
  margin: 0 0 0.6rem;
  border-top-width: 4px;
  padding: 0.65rem 1rem;
  box-shadow: none;
}

.worksheet-header h1 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.worksheet {
  background: #fff;
  padding: clamp(0.8rem, 1.8vw, 1.5rem);
  box-shadow: 0 2px 14px rgb(24 33 43 / 8%);
}

.source-page {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.source-page::before,
.source-page::after,
.document-banner {
  display: none;
}

.print-page-content,
.print-column {
  display: contents;
}

.print-column + .print-column {
  margin: 0;
  padding: 0;
  border: 0;
}

.section-bar {
  margin: 1.3rem 0 0.75rem;
}

.directions {
  margin: 0.7rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.reading-workspace {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
  margin: 0 0 1.5rem;
  padding: 0.2rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.print-only-worksheet {
  display: none;
}

.sticky-passage {
  position: sticky;
  z-index: 20;
  top: var(--toolbar-offset);
  align-self: start;
  max-height: calc(100vh - var(--toolbar-offset) - 12px);
  overflow: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
}

.sticky-passage .passage {
  margin-bottom: 0.65rem;
  background: #fbfcfd;
  box-shadow: 0 2px 8px rgb(24 33 43 / 7%);
}

.reading-questions {
  min-width: 0;
}

.standalone-summary {
  width: 100%;
  max-width: none;
  margin: 0 0 1.5rem;
  padding: 0 0 0 2.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.image-question-workspace {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
  margin: 0 0 1.5rem;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.sticky-picture {
  position: sticky;
  z-index: 20;
  top: var(--toolbar-offset);
  align-self: start;
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: calc(100vh - var(--toolbar-offset) - 12px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #f7f9fa;
}

.sticky-picture .question-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - var(--toolbar-offset) - 32px);
  margin: 0;
  object-fit: contain;
}

.image-question-content {
  min-width: 0;
}

.image-question-content .question {
  margin-bottom: 0;
}

@media screen {
  .reading-workspace .passage {
    font-size: 1.25rem;
    line-height: 1.82;
  }

  .standalone-summary {
    font-size: 1.22rem;
    line-height: 1.62;
  }

  .standalone-summary .summary-box {
    font-size: 1em;
    line-height: 1.7;
  }

  body[data-worksheet="nona"] .question {
    font-size: 1.22rem;
    line-height: 1.62;
  }

  body[data-worksheet="nona"] .standalone-summary {
    font-size: 1.22rem;
  }

  body[data-worksheet="nona"] .question .question-prompt {
    line-height: 1.78;
  }

  .dialogue-box {
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #a8b1b8;
    border-radius: 4px;
    background: #f8fafb;
    line-height: 1.9 !important;
  }

  .dialogue-question .choices {
    gap: 0.32rem;
  }

  .dialogue-question .choice {
    margin-top: 0.14rem;
    margin-bottom: 0.14rem;
  }

  .question[id*="-vocabulary-"],
  .question[id*="-grammar-"] {
    font-size: 1.22rem;
    line-height: 1.62;
  }

  .question[id*="-vocabulary-"] .question-prompt,
  .question[id*="-grammar-"] .question-prompt {
    line-height: 1.5;
  }

  .question[id*="-vocabulary-"] .choice,
  .question[id*="-grammar-"] .choice {
    min-height: 2.2rem;
    padding-top: 0.24rem;
    padding-bottom: 0.24rem;
  }
}

.passage,
.summary-box {
  padding: 1rem 1.1rem;
  line-height: 1.75;
}

.question {
  margin-bottom: 1.05rem;
}

.choices {
  display: grid;
  gap: 0.18rem;
}

.choice {
  min-height: 2rem;
  padding: 0.18rem 0.45rem 0.18rem 2.5rem;
  border-left: 3px solid transparent;
  border-radius: 3px;
}

.choice.is-answer {
  border-left-color: #c48a00;
  background: #fff0a8;
  color: #241b00;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgb(151 104 0 / 18%);
}

.answer-controls {
  display: block;
  min-height: 0;
  margin: 0.38rem 0 0;
}

.answer-toggle {
  min-height: 34px;
  padding: 0.28rem 0.62rem;
}

.answer-slot,
.answer-content {
  display: none !important;
}

.blank,
.blank-box {
  display: inline-block;
  width: clamp(4.5em, 9vw, 7.5em);
  min-width: 4.5em;
  height: 1.35em;
  margin: 0 0.12em;
  border: 1.5px solid #788691;
  border-radius: 3px;
  background: #fff;
  color: transparent;
  line-height: 1;
  vertical-align: -0.25em;
  user-select: none;
}

body[data-annotation-tool="pen"] .annotation-canvas {
  cursor: crosshair;
}

body[data-annotation-tool="eraser"] .annotation-canvas {
  cursor: none;
}

.eraser-cursor {
  position: fixed;
  z-index: 9999;
  display: none;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 2px solid #202832;
  border-radius: 50%;
  background: rgb(255 255 255 / 38%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 80%);
  pointer-events: none;
}

body[data-annotation-tool="eraser"] .eraser-cursor.is-visible {
  display: block;
}

@media screen and (max-width: 900px) {
  .reading-workspace,
  .image-question-workspace {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .sticky-passage,
  .sticky-picture {
    top: var(--toolbar-offset);
    max-height: min(42vh, 360px);
  }

  .sticky-picture {
    min-height: 180px;
  }

  .sticky-picture .question-image {
    max-height: min(40vh, 340px);
  }

  .worksheet {
    padding: 0.8rem;
  }
}

@media screen and (max-width: 600px) {
  .toolbar-compact {
    overflow-x: auto;
  }

  .toolbar-compact .toolbar-brand {
    display: block;
  }

  .annotation-panel {
    max-height: 45vh;
    overflow: auto;
  }

  .question {
    padding-left: 1.9rem;
  }
}

@page {
  size: A4 portrait;
  margin: 7mm;
}

@media print {
  html,
  body {
    width: auto;
    margin: 0;
    font-size: 8.6pt;
    line-height: 1.32;
  }

  .worksheet-stage,
  .worksheet-shell {
    width: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    zoom: 1;
  }

  .worksheet {
    column-count: 2;
    column-gap: 7mm;
    column-rule: 0.25mm solid #777;
    padding: 0;
    box-shadow: none;
  }

  .source-page,
  .print-page-content,
  .print-column {
    display: contents;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    break-after: auto;
  }

  .source-page::before,
  .source-page::after {
    display: none;
    content: none;
  }

  .document-banner {
    display: block;
    column-span: all;
    margin: 0 0 3mm;
    padding: 2.2mm;
  }

  .document-banner strong {
    font-size: 13pt;
  }

  .section-bar {
    column-span: all;
    margin: 2.5mm 0 1.4mm;
    padding: 1mm 1.6mm;
    font-size: 10pt;
    break-after: avoid;
  }

  .reading-workspace {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    column-span: all;
    gap: 5mm;
    margin: 0 0 3mm;
    padding: 0 0 2mm;
    border-bottom: 0.25mm solid #999;
    break-inside: avoid-page;
  }

  .sticky-passage {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .sticky-passage .passage {
    margin: 0;
    background: #fff;
    box-shadow: none;
  }

  .passage,
  .summary-box {
    margin: 0 0 1.7mm;
    padding: 1.7mm 2mm;
    line-height: 1.38;
  }

  .passage p,
  .summary-box p {
    margin-bottom: 1.6mm;
  }

  .directions {
    margin: 1.2mm 0;
    font-size: 8.2pt;
  }

  .question {
    margin: 0 0 2.1mm;
    padding-left: 4.5mm;
    break-inside: avoid;
  }

  .question-number {
    width: 3.7mm;
  }

  .choice {
    min-height: 0;
    margin: 0;
    padding: 0 0 0 5.5mm;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: #000 !important;
    font-weight: 400 !important;
    box-shadow: none !important;
  }

  .question-image {
    max-width: 42mm;
    height: 22mm;
    max-height: 22mm;
  }

  .blank,
  .blank-box {
    width: 5em;
    min-width: 5em;
    height: 1.2em;
    border-width: 0.3mm;
    border-radius: 0.5mm;
  }
}

/* Keep the original page-by-page worksheet exclusively for printing. */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  .worksheet:not(.print-only-worksheet) {
    display: none !important;
  }

  .print-only-worksheet {
    display: block;
    width: 210mm;
    padding: 0;
    column-count: auto;
    column-gap: normal;
    column-rule: 0;
    box-shadow: none;
  }

  .print-only-worksheet .source-page {
    --print-density: 1;
    position: relative;
    display: block;
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    padding: 8.5mm 9mm 9mm;
    overflow: hidden;
    break-after: page;
    box-shadow: none;
    font-size: calc(8.45pt * var(--print-density));
  }

  .print-only-worksheet .source-page:last-child {
    break-after: auto;
  }

  .print-only-worksheet .source-page::before {
    display: none;
  }

  .print-only-worksheet .source-page::after {
    position: absolute;
    bottom: 3.5mm;
    left: 50%;
    display: block;
    transform: translateX(-50%);
    font-size: 8pt;
    content: attr(data-page);
  }

  .print-only-worksheet .print-page-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 8mm;
    align-items: start;
    height: 100%;
  }

  .print-only-worksheet .print-column {
    display: block;
    min-width: 0;
  }

  .print-only-worksheet .print-column + .print-column {
    margin: 0;
    border: 0;
    border-left: 0.35mm solid #444;
    padding: 0 0 0 4mm;
  }

  .print-only-worksheet .document-banner {
    display: block;
    margin: 0 0 calc(3mm * var(--print-density));
    padding: calc(3mm * var(--print-density)) calc(2.5mm * var(--print-density));
    column-span: none;
  }

  .print-only-worksheet .document-banner strong {
    font-size: calc(15pt * var(--print-density));
  }

  .print-only-worksheet .section-bar {
    margin: calc(2.6mm * var(--print-density)) 0 calc(1.8mm * var(--print-density));
    border-left-width: 1.2mm;
    padding: calc(1.2mm * var(--print-density)) calc(1.8mm * var(--print-density));
    column-span: none;
    font-size: calc(10.6pt * var(--print-density));
  }

  .print-only-worksheet .directions {
    margin: calc(1.8mm * var(--print-density)) 0;
  }

  .print-only-worksheet .passage,
  .print-only-worksheet .summary-box {
    margin: 0 0 calc(2.2mm * var(--print-density));
    border-width: 0.35mm;
    padding: calc(2mm * var(--print-density)) calc(2.4mm * var(--print-density));
    line-height: 1.52;
  }

  .print-only-worksheet .passage p,
  .print-only-worksheet .summary-box p {
    margin: 0 0 calc(2.2mm * var(--print-density));
  }

  .print-only-worksheet .question {
    margin: 0 0 calc(2.8mm * var(--print-density));
    padding-left: calc(5.2mm * var(--print-density));
    line-height: 1.44;
  }

  .print-only-worksheet .question-number {
    width: calc(4.2mm * var(--print-density));
  }

  .print-only-worksheet .question-prompt {
    margin-bottom: calc(0.7mm * var(--print-density));
  }

  .print-only-worksheet .choice {
    min-height: 0;
    margin: 0;
    padding: 0 0 0 calc(6mm * var(--print-density));
    border: 0;
    background: transparent !important;
    color: #000 !important;
    font-weight: 400 !important;
    box-shadow: none !important;
  }

  .print-only-worksheet .question-image {
    width: auto;
    max-width: calc(43mm * var(--print-density));
    height: calc(25mm * var(--print-density));
    max-height: calc(25mm * var(--print-density));
    margin: calc(0.5mm * var(--print-density)) 0 calc(1mm * var(--print-density));
    object-fit: contain;
  }
}

/* Continuous print flow: keep the two-column look without source-page gaps. */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  body {
    font-size: 9.2pt;
    line-height: 1.46;
  }

  .worksheet-shell {
    width: auto;
    margin: 0;
  }

  .print-only-worksheet {
    display: block;
    width: auto;
    padding: 0;
    column-count: 2;
    column-fill: balance;
    column-gap: 6.5mm;
    column-rule: 0.3mm solid #666;
  }

  .print-only-worksheet .source-page,
  .print-only-worksheet .print-page-content,
  .print-only-worksheet .print-column {
    display: contents;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    break-after: auto;
    font-size: inherit;
  }

  .print-only-worksheet .source-page::before,
  .print-only-worksheet .source-page::after {
    display: none;
    content: none;
  }

  .print-only-worksheet .document-banner {
    display: block;
    margin: 0 0 2.4mm;
    padding: 2.4mm;
    column-span: all;
    break-after: avoid-column;
  }

  .print-only-worksheet .document-banner strong {
    font-size: 14pt;
  }

  .print-only-worksheet .section-bar {
    margin: 2.2mm 0 1.3mm;
    padding: 1mm 1.5mm;
    column-span: none;
    break-after: avoid-column;
    font-size: 10.5pt;
  }

  .print-only-worksheet .directions {
    margin: 1.7mm 0;
    break-after: avoid-column;
    font-size: 8.8pt;
    line-height: 1.42;
  }

  .print-only-worksheet .passage,
  .print-only-worksheet .summary-box {
    margin: 0 0 2.5mm;
    padding: 2mm 2.2mm;
    break-inside: avoid-column;
    font-size: 10.5pt;
    line-height: 1.6;
  }

  .print-only-worksheet .passage p,
  .print-only-worksheet .summary-box p {
    margin: 0 0 2mm;
  }

  .print-only-worksheet .question {
    margin: 0 0 3mm;
    padding-left: 5mm;
    break-inside: avoid-column;
    font-size: 9.2pt;
    line-height: 1.46;
  }

  .print-only-worksheet .question-number {
    width: 4mm;
  }

  .print-only-worksheet .question-prompt {
    margin-bottom: 1mm;
    line-height: 1.5;
  }

  .print-only-worksheet .choice {
    margin: 0.35mm 0;
    padding-left: 5.7mm;
    line-height: 1.42;
  }

  .print-only-worksheet .question-image {
    width: auto;
    max-width: 38mm;
    height: 22mm;
    max-height: 22mm;
    margin: 0.5mm 0 1mm;
    object-fit: contain;
  }

  body[data-worksheet="hepta"] .print-only-worksheet .question {
    margin-bottom: 2.2mm;
    font-size: 9pt;
    line-height: 1.42;
  }

  body[data-worksheet="hepta"] .print-only-worksheet .choice {
    margin-top: 0.15mm;
    margin-bottom: 0.15mm;
  }

  body[data-worksheet="hepta"] .print-only-worksheet .question-prompt {
    margin-bottom: 0.8mm;
  }

  body[data-worksheet="hepta"] .print-only-worksheet .question-image {
    max-width: 35mm;
    height: 19mm;
    max-height: 19mm;
  }
}
