/* ── cycle_nth_prefix_count3_3（くり返す列のn番目といくつあるかを調べよう、単元仕様書 v1.2）── */
/* 画面：問題文の下に、くり返しの列（1組を2回、各ますに形・記号・位置番号、1組の区切りは太い線）、回答（A群は4択、B・C群は数の欄と単位と数のキー）（§5-3・§7 画面表示）。 */
.cnpc-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.cnpc-figure{margin:2px 0 4px;max-width:100%;display:flex;justify-content:center}
.cnpc-strip{max-width:100%}
.cnpc-strip-inner{display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;row-gap:6px}
/* 1組ごとに太い線でかこむ。折り返すときも1組の中では切らない。 */
.cnpc-block{display:inline-flex;border:3px solid #1e3a8a;border-radius:4px;background:#fff}
.cnpc-block+.cnpc-block{margin-left:-3px}
.cnpc-item{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:38px;padding:3px 1px 2px;box-sizing:border-box;border-left:1px solid #94a3b8}
.cnpc-item:first-child{border-left:0}
.cnpc-shape{font-size:22px;line-height:1.1;color:#111}
.cnpc-mark{font-size:16px;font-weight:700;line-height:1.2;color:#111}
.cnpc-pos{font-size:14px;line-height:1.2;color:#334155;border-top:1px dashed #cbd5e1;width:100%;text-align:center;margin-top:2px;padding-top:1px}
.cnpc-dots{display:inline-flex;align-items:center;padding:0 6px;font-size:22px;font-weight:700}
.cnpc-choices{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:6px 0 2px}
.cnpc-choice{min-width:60px;min-height:52px;padding:4px 8px;border:3px solid #64748b;border-radius:10px;background:#fff;font-family:inherit;display:inline-flex;align-items:center;gap:4px;cursor:pointer;color:#111}
.cnpc-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.cnpc-choice-shape{font-size:24px;line-height:1}
.cnpc-choice-mark{font-size:20px;font-weight:700;line-height:1}
.cnpc-choice.cnpc-selected{border-color:#1d4ed8;background:#dbeafe;box-shadow:0 0 0 2px #1d4ed8 inset}
.cnpc-choice:disabled{cursor:default;opacity:1;color:#111}
/* 採点後：選んだものが正しいときは緑の実線、まちがえたときは赤の点線。正しい答えには緑の実線とチェックのしるし（色だけにしない）。 */
.cnpc-choice.cnpc-ok{border:3px solid #15803d;background:#dcfce7}
.cnpc-choice.cnpc-ng{border:3px dashed #b91c1c;background:#fff1f2}
.cnpc-choice.cnpc-right{border:3px solid #15803d}
.cnpc-choice.cnpc-right::after{content:'✓';font-weight:700;color:#15803d;margin-left:2px}
.cnpc-row{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:6px}
.cnpc-input-wrap{display:inline-flex;align-items:center;gap:6px}
.cnpc-input{width:5.2em;min-height:44px;font-size:1.3rem;padding:2px 6px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:8px;text-align:center;font-family:inherit;box-sizing:border-box}
.cnpc-input:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.cnpc-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.cnpc-input.cnpc-ok,.cnpc-input.cnpc-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.cnpc-input.cnpc-ng,.cnpc-input.cnpc-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.cnpc-unit{font-weight:700;font-size:1.15rem;white-space:nowrap}
.cnpc-guide{margin:4px 0 0;font-size:15px;text-align:center;line-height:1.4}
.cnpc-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.cnpc-msg:empty{min-height:0;margin:0}
/* キーはほかの数の問いと同じ共通テンキーの配置（main.css の .numpad・.num-btn：3列、1〜9、最下段に0（2列分）と⌫）。ここでは幅と上の余白だけを変える（2026-11-18 オーナー指摘「テンキーのレイアウトが他と異なります」）。 */
/* 共通テンキーは renderQuestion が max-width:240px を直接指定するので、狭い画面でも同じ幅にそろえる。 */
.cnpc-keypad{width:100%;max-width:240px;margin-top:10px}
.cnpc-keypad[hidden]{display:none}
/* キーは操作の部品なので、共通テンキーと同じ UI の字体（--font-ui）にする（デザイン層仕様書 §1-2「UI 字体は非波及」。学習の字体だと 0 に斜線が入り、共通テンキーと字の形が違って見える）。 */
.cnpc-key{min-height:44px;font-family:var(--font-ui)}
.feedback.has-text.cnpc-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.cnpc-answer{margin:4px 0;font-weight:700;overflow-wrap:anywhere}
.cnpc-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.cnpc-example .cnpc-strip{margin:6px 0}
.cnpc-example-fig{font-size:14px;color:#475569;margin:2px 0 6px}
.cnpc-example-q{font-weight:700;margin:8px 0 2px}
.cnpc-example-answer{margin:2px 0 6px}
#page-quiz.active:has(.cnpc-main) #question-text,#page-quiz.active:has(.cnpc-main) #hint-area .kp-body,#page-quiz.active:has(.cnpc-main) #feedback,.cnpc-expl-text,.cnpc-answer,.cnpc-guide,.cnpc-msg{overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.cnpc-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.cnpc-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.cnpc-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.cnpc-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
@media (max-width:360px){
  .cnpc-item{min-width:36px}
  .cnpc-choice{min-width:54px;padding:4px 5px;gap:2px}
  .cnpc-choice-shape{font-size:21px}
  .cnpc-choice-mark{font-size:18px}
}

/* 印刷：A4縦・1ページ（§7。用紙の余白 上下5mm・左右6mm、本文198×287mm。題名と記入欄19.5mm、共通の案内27.5mm、2列×5段で1問35mm、答え55.5mm）。 */
.cnpc-pr-page{width:190mm;height:277mm;box-sizing:border-box;display:flex;flex-direction:column;padding:0;margin:0 auto 8mm;overflow:hidden;background:#fff;color:#000;font-family:'Atkinson Hyperlegible','BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.cnpc-pr-headblock{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:19.5mm}
.cnpc-pr-title{box-sizing:border-box;margin:0;height:9mm;font-size:15pt;font-weight:700;line-height:8mm;text-align:center;white-space:nowrap;padding:0;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.cnpc-pr-page[lang="en"] .cnpc-pr-title{font-size:14pt}
.cnpc-pr-fields{display:flex;gap:6mm;align-items:flex-end;height:7mm;margin-top:1mm;font-size:12pt;line-height:6mm;white-space:nowrap}
.cnpc-pr-group{display:inline-flex;align-items:flex-end;gap:3mm;flex:none}
.cnpc-pr-field{display:inline-flex;align-items:flex-end;gap:1.5mm;flex:none}
.cnpc-pr-field-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:1pt solid #555}
.cnpc-field-name{flex:1;min-width:0}
.cnpc-field-name .cnpc-pr-field-line{flex:1;width:auto;min-width:40mm}
.cnpc-pr-solid{box-sizing:content-box;display:block;height:0;padding:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.cnpc-pr-common{flex:none;box-sizing:border-box;width:186mm;margin:2mm 0 0;height:27.5mm;font-size:12.5pt;line-height:5.5mm;overflow:hidden;overflow-wrap:anywhere;line-break:strict}
.cnpc-pr-problems{display:flex;gap:6mm;flex:none;width:186mm;height:170mm}
.cnpc-pr-col{flex:none;width:90mm;display:flex;flex-direction:column}
.cnpc-pr-cell{box-sizing:border-box;height:34mm;display:flex;flex-direction:column;align-items:flex-start;padding:1mm 0 0;border-bottom:0.2mm solid transparent;overflow:hidden}
.cnpc-pr-line{flex:none;height:6mm;font-size:12.5pt;font-weight:700;line-height:6mm;white-space:nowrap}
.cnpc-pr-strip{flex:none;height:14mm;display:flex;align-items:center}
.cnpc-pr-strip-inner{display:flex;align-items:stretch;flex-wrap:nowrap}
.cnpc-pr-block{display:inline-flex;border:0.8mm solid #111}
.cnpc-pr-block+.cnpc-pr-block{margin-left:-0.8mm}
.cnpc-pr-item{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:6.7mm;height:12.6mm;border-left:0.2mm solid #666}
.cnpc-pr-item:first-child{border-left:0}
.cnpc-pr-shape{font-size:11pt;line-height:4.4mm}
.cnpc-pr-mark{font-size:9pt;font-weight:700;line-height:3.8mm}
.cnpc-pr-pos{font-size:9pt;line-height:3.8mm;color:#222}
.cnpc-pr-dots{display:inline-flex;align-items:center;width:4mm;justify-content:center;font-size:11pt;font-weight:700}
.cnpc-pr-row{flex:none;height:9mm;display:flex;align-items:center;gap:3mm;font-size:12.5pt;white-space:nowrap}
.cnpc-pr-choices{display:inline-flex;gap:1.5mm}
.cnpc-pr-choice{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:11mm;height:7mm;border:0.25mm solid #555;border-radius:1mm;font-size:12.5pt}
/* （　）の中の書き込み用の空白は、3けたが書ける16mmに広げる（§7 教育領域）。 */
.cnpc-pr-blank{display:inline-block;min-width:16mm;white-space:pre}
.cnpc-pr-answers{flex:none;box-sizing:border-box;width:186mm;height:55.5mm}
.cnpc-pr-dashed{box-sizing:content-box;display:block;height:0;margin:1.5mm 0 2.5mm;padding:0;border:0;border-top:2pt dashed #aaa}
.cnpc-pr-answers-title{font-weight:700;font-size:12.5pt;line-height:6mm;height:6mm}
.cnpc-pr-answers-grid{display:flex;gap:6mm}
.cnpc-pr-ans-col{flex:none;width:90mm}
.cnpc-pr-ans{height:9mm;line-height:4.5mm;font-size:10pt;overflow:hidden;word-break:keep-all;overflow-wrap:anywhere}
.cnpc-app-pdf-page .cnpc-pr-page{box-shadow:none;margin:0}

#pr-sheet[data-unit="cycle_nth_prefix_count3_3"]{width:190mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="cycle_nth_prefix_count3_3"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="cycle_nth_prefix_count3_3"]>#pr-problems{display:block}
/* 画面のプレビューでは、用紙の余白を白い縁で見せる（印刷の寸法は変えない）。 */
#pr-sheet[data-unit="cycle_nth_prefix_count3_3"] .cnpc-pr-page{box-shadow:0 0 0 10mm #fff,0 0 4px 10mm rgba(0,0,0,.12);margin-bottom:calc(8mm + 10mm)}
@media print{
  #page-print #pr-sheet[data-unit="cycle_nth_prefix_count3_3"]{width:auto!important;max-width:none!important;margin:0!important;padding:0!important;transform:none!important;box-shadow:none!important}
  #page-print #pr-sheet[data-unit="cycle_nth_prefix_count3_3"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="cycle_nth_prefix_count3_3"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="cycle_nth_prefix_count3_3"] .cnpc-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
