@font-face {
  font-family: "KokugoKlee";
  src: url("kleeone-kokugo.woff") format("woff");
  font-display: block;
}

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

.kokugo-page {
  --kfont: "UD デジタル教科書体 NK-R", "UD Digi Kyokasho NK-R", "UD Digi Kyokasho NK",
           "UD デジタル教科書体 N-R", "UD Digi Kyokasho N",
           "游教科書体", "YuKyokasho", "HG教科書体", "HGKyokashotai",
           "KokugoKlee", serif;
}

.sheet-stage { padding: 1rem 0 2rem; overflow: hidden; }
.k-pages { width: 210mm; transform-origin: top left; }
@media screen {
  .k-pages { transform: scale(var(--k, 1)); margin-left: var(--x, 0px); }
  .k-pages .sheet + .sheet { margin-top: 8mm; }
}

.sheet.kokugo-sheet {
  position: relative;
  box-sizing: border-box;
  width: 210mm;
  height: 297mm;
  padding: 12mm 12mm 16mm;
  background: #fff;
  color: #000;
  font-family: var(--kfont);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 6px 24px rgba(0, 0, 0, .3);
}
.k-head {
  display: flex; align-items: baseline; gap: 5mm;
  border-bottom: .4mm solid #000; padding-bottom: 2mm; margin-bottom: 3mm;
}
.k-title { font-size: 7.5mm; line-height: 1.2; }
.k-sub   { font-size: 4.5mm; color: #333; }
.k-body  { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.k-lead  { font-size: 4.4mm; line-height: 1.4; margin: 0 0 2.5mm; word-break: keep-all; }
.k-foot {
  position: absolute; left: 12mm; right: 12mm; bottom: 5mm;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 4mm;
  font-family: var(--kfont);
}
.k-credit { flex: 1 1 auto; font-size: 2.3mm; line-height: 1.35; color: #444; }

.k-kigen { flex: 0 0 auto; font-size: 3mm; line-height: 1; color: #000; white-space: nowrap; }
.k-site { flex: 0 0 auto; font-size: 3mm; line-height: 1; color: #444; white-space: nowrap; }
.k-site b { color: #000; margin-right: 1.5mm; font-weight: normal; letter-spacing: .04em; }

.k-row { display: flex; gap: 4mm; margin-bottom: 4.5mm; }
.k-model { flex: 0 0 32mm; width: 32mm; }
.k-model-box, .k-box {
  position: relative; box-sizing: border-box; text-align: center;
}
.k-model-box {
  width: 32mm; height: 32mm; border: .45mm solid #000;
  font-size: 26mm; line-height: 31mm;
}

.k-model-box::before, .k-model-box::after, .k-box::before, .k-box::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
}
.k-model-box::before, .k-box::before { left: 50%; top: 0; bottom: 0; border-left: .25mm dashed #b5b5b5; }
.k-model-box::after,  .k-box::after  { top: 50%; left: 0; right: 0; border-top: .25mm dashed #b5b5b5; }
.k-yomi { font-size: 3.6mm; line-height: 1.3; text-align: center; margin-top: 1.2mm; word-break: keep-all; }
.k-practice { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1.6mm; min-width: 0; }
.k-strip { display: flex; gap: .8mm; height: 11mm; }
.k-step { position: relative; flex: 0 0 11mm; width: 11mm; height: 11mm; box-sizing: border-box; border: .2mm solid #999; }
.k-kj { display: block; width: 100%; height: 100%; }
.k-kj path { fill: none; stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.k-kj path.done { stroke: #b0b0b0; }
.k-kj path.now  { stroke: #000; }
.k-step-no { position: absolute; top: .2mm; left: .5mm; font-size: 2.2mm; line-height: 1; color: #555; font-family: sans-serif; }
.k-boxes { display: flex; gap: 1mm; }
.k-box {
  flex: 0 0 19mm; width: 19mm; height: 19mm; border: .3mm solid #000;
  font-size: 15.5mm; line-height: 18.5mm;
}
.k-box.trace { color: #c4c4c4; }

.k-tate { writing-mode: vertical-rl; text-orientation: mixed; }
.k-no {
  text-combine-upright: all; -webkit-text-combine: horizontal;
  font-size: 4.5mm; font-family: sans-serif; margin-inline-end: 3mm; color: #333;
}

.k-choice { height: 122mm; font-size: 7mm; line-height: 1.7; margin-bottom: 4mm; align-self: flex-end; }
.k-q { margin-block-end: 7mm; }
.k-cand { display: inline-block; margin-inline-start: 5mm; white-space: nowrap; }
.k-copy { height: 70mm; align-self: flex-end; }
.k-pair { margin-block-end: 6mm; }

.k-col { font-size: 0; line-height: 0; }
.k-masu {
  display: inline-block; box-sizing: border-box; vertical-align: top;
  width: 11mm; height: 11mm; border: .25mm solid #000;
  font-size: 8mm; line-height: 10.5mm; text-align: center;
}
.k-masu + .k-masu { border-top: 0; }

.k-masu.two { font-size: 4.4mm; letter-spacing: -.12em; }
.k-col.model .k-masu { color: #000; }
.k-genkou { height: 112mm; align-self: flex-end; margin-bottom: 4mm; }
.k-genkou .k-col + .k-col .k-masu { border-right: 0; }

.k-sentences { flex: 1 1 auto; font-size: 7mm; line-height: 2.3; align-self: flex-end; }
.k-line { margin: 0; margin-block-end: 2.5mm; letter-spacing: .04em; }
.k-paren { white-space: nowrap; }

.k-kanji { font-size: 7.5mm; line-height: 2.8; }
.k-ruby rt { font-size: 4mm; line-height: 1; }
.k-kw.underline { border-right: .4mm solid #000; padding-right: .6mm; }
.k-rbox {
  display: inline-block; box-sizing: border-box; vertical-align: middle;
  width: 7mm; height: calc(var(--n, 2) * 6.5mm + 1mm); border: .25mm solid #000; margin: .7mm 0 .7mm 1.6mm;
}
.k-sq { font-size: 0; line-height: 0; display: inline-block; vertical-align: middle; }
.k-sq1 { display: inline-block; box-sizing: border-box; width: 10mm; height: 10mm; border: .3mm solid #000; vertical-align: top; }
.k-sq1 + .k-sq1 { border-top: 0; }

.k-answers { font-size: 6mm; line-height: 1.9; margin: 2mm 0 0 8mm; padding: 0; }
.k-rt-ans { color: #000; }

body.no-answer .k-answer-sheet { display: none; }

.no-consent-print { display: none; }
@media print {
  html, body { background: #fff !important; margin: 0; padding: 0; }
  .no-print { display: none !important; }
  .sheet-stage { padding: 0; overflow: visible; height: auto !important; }
  .k-pages { transform: none; margin: 0; }
  .sheet.kokugo-sheet { box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  .sheet.kokugo-sheet:last-child { break-after: auto; page-break-after: auto; }

  body.print-page:not(.may-print) .sheet-stage { display: none !important; }
  body.print-page:not(.may-print) .no-consent-print {
    display: block !important; margin: 20mm 14mm; font-size: 14pt; line-height: 1.7; color: #000;
  }
}
