/* ── parity_finite_iteration3_5（ぐう数・き数で分かれる有限反復を追おう、単元仕様書 v1.4）── */
/* 画面：決まりの文と問題文、表（ぐう数の行・き数の行）、作業用の表（採点しない）、答えの欄または4つの選択肢、共通のテンキー（§5-3・§7）。 */
#question-text .pfi-rule{display:block;font-size:.88em;font-weight:700;color:#334155;margin-bottom:4px}
#question-text .pfi-q{display:block}
.pfi-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center;gap:6px}
.pfi-table{display:flex;flex-direction:column;gap:4px;max-width:100%}
.pfi-trow{display:flex;align-items:stretch;gap:4px}
.pfi-tname{flex:none;display:flex;align-items:center;justify-content:center;min-width:3.6em;padding:0 4px;font-weight:800;font-size:14px;border:2px solid #475569;border-radius:6px;background:#f1f5f9;box-sizing:border-box}
.pfi-odd .pfi-tname{border-style:dashed}
.pfi-tcells{display:grid;grid-template-columns:repeat(8,auto);gap:3px}
.pfi-tcell{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:32px;padding:0 3px;border:2px solid #64748b;border-radius:6px;background:#fff;font-size:15px;font-weight:700;white-space:nowrap;box-sizing:border-box;font-variant-numeric:tabular-nums}
@media (max-width:560px){.pfi-tcells{grid-template-columns:repeat(4,auto)}}
.pfi-workwrap{max-width:100%;overflow-x:auto}
.pfi-work{border-collapse:collapse;font-size:13px}
.pfi-work th{border:1px solid #94a3b8;background:#f8fafc;padding:2px 4px;font-weight:800;min-width:4.2em;line-height:1.25}
.pfi-work td{border:1px solid #94a3b8;padding:1px;text-align:center}
.pfi-wcell{width:3.2em;min-height:44px;font-size:1.05rem;text-align:center;border:1px solid #cbd5e1;border-radius:4px;background:#fff;box-sizing:border-box;font-family:inherit}
.pfi-wcell.ufk-input-active{outline:3px solid #1d4ed8;outline-offset:-2px}
.pfi-wtog{min-width:4.4em;min-height:44px;font-size:13px;font-weight:700;border:1px dashed #94a3b8;border-radius:4px;background:#fff;cursor:pointer;font-family:inherit}
.pfi-wcell:disabled,.pfi-wtog:disabled{background:#f8fafc;color:#111827;opacity:1}
.pfi-row-input{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:2px}
.pfi-input{width:5em;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}
.pfi-input.ufk-input-active{outline:3px solid #1d4ed8;outline-offset:1px}
.pfi-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.pfi-input.pfi-ok,.pfi-input.pfi-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.pfi-input.pfi-ng,.pfi-input.pfi-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.pfi-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%;max-width:520px}
.pfi-choice{min-height:48px;padding:4px 8px;border:2px solid #64748b;border-radius:10px;background:#fff;font-size:16px;font-weight:700;cursor:pointer;font-family:inherit}
.pfi-choice.pfi-ch-sel{border:3px solid #1d4ed8;background:#dbeafe}
.pfi-choice:disabled{cursor:default;color:#111827;opacity:1}
.pfi-choice.pfi-ch-right{border:3px solid #15803d;background:#dcfce7}
.pfi-choice.pfi-ch-wrong{border:3px dashed #b91c1c;background:#fff1f2}
@media (max-width:400px){.pfi-choices{grid-template-columns:1fr}.pfi-tcell{min-width:40px;font-size:14px}}
/* 独立検査 PFI-IR1-05：320pxでも、ますの文字を枠の中におさめる。 */
@media (max-width:340px){.pfi-tcells{gap:2px}.pfi-tcell{min-width:0;padding:0 2px;font-size:12.5px;letter-spacing:-0.2px}.pfi-tname{min-width:3.2em;font-size:13px}}
.pfi-guide{margin:2px 0 0;font-size:16px;font-weight:700;text-align:center}
.pfi-guide[hidden]{display:none}
.pfi-msg{min-height:1.4em;margin:2px 0;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.pfi-msg:empty{min-height:0;margin:0}
.pfi-main .ufk-keypad{margin-top:4px}
.feedback.has-text.pfi-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.pfi-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.pfi-ex-q{font-weight:700;margin:6px 0 4px}.pfi-ex-a{margin:6px 0}
.pfi-ex-table .pfi-tcells{grid-template-columns:repeat(4,auto)}
#page-quiz.active:has(.pfi-main) #question-text{word-break:normal;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.pfi-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.pfi-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.pfi-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.pfi-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
#page-quiz:has(#question-text[data-unit="parity_finite_iteration3_5"]) .ufk-keypad{max-width:240px;width:100%}
#page-quiz:has(#question-text[data-unit="parity_finite_iteration3_5"]) .ufk-keypad .num-btn{font-family:var(--font-ui)}

/* 印刷：A4横・1ページ（§7）。1行目に題名の枠、2行目に記入欄（共通仕様 CP-08a・CP-08b）、3行目に決まりの文、2列×5段で1問135×30.2mm、破線と答え1行。 */
.pfi-pr-page{width:277mm;height:190mm;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}
.pfi-pr-headblock{display:flex;flex-wrap:wrap;align-items:flex-end;flex:none;height:16mm;border-bottom:1.5pt solid #333;box-sizing:border-box}
.pfi-pr-title{box-sizing:border-box;flex:1 0 100%;margin:0;height:7mm;font-size:14pt;font-weight:700;line-height:6mm;text-align:center;white-space:nowrap;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.pfi-pr-hfields{display:flex;flex:1 0 100%;gap:5mm;align-items:flex-end;height:7mm;margin-bottom:1mm;font-size:12.5pt;line-height:6mm;white-space:nowrap}
.pfi-pr-hfield{display:inline-flex;align-items:flex-end;gap:1.2mm;flex:none}
.pfi-pr-hfield-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:1.5px solid #555}
.pfi-pr-hfield.pfi-hfield-name{flex:1}
.pfi-hfield-name .pfi-pr-hfield-line{flex:1;width:auto;min-width:40mm}
.pfi-pr-rule{flex:none;margin:1mm 0 0;font-size:12.5pt;line-height:5.3mm;height:5.3mm;white-space:nowrap}
.pfi-pr-problems{flex:none;display:grid;grid-template-columns:135mm 135mm;column-gap:4mm;margin-top:1mm}
.pfi-pr-col{display:grid;grid-template-rows:repeat(5,30.2mm)}
.pfi-pr-cell{box-sizing:border-box;width:135mm;height:30.2mm;overflow:hidden;padding:0;border-top:1px solid transparent}
.pfi-pr-q{margin:0;width:132mm;font-size:12.5pt;line-height:5.3mm;max-height:10.6mm;word-break:normal;overflow-wrap:anywhere;line-break:strict}
.pfi-pr-body{display:flex;align-items:center;gap:1mm;margin-top:0.3mm}
.pfi-pr-table{gap:0}
.pfi-pr-table .pfi-trow{gap:0}
.pfi-pr-table .pfi-tname{min-width:0;width:10mm;height:4.5mm;font-size:9pt;border:1px solid #444;border-radius:0;padding:0;background:#fff}
.pfi-pr-table .pfi-odd .pfi-tname{border-style:solid}
.pfi-pr-page[lang="en"] .pfi-pr-table .pfi-tname{width:8mm}
/* v1.4（独立検査 PFI-IR1-01・PFI-IR2-01）：今の数が1けたの左5こは10.8mm、2けた（10〜15）の右3こは12.4mm。
   2けた→2けたの文字（約11.2mm）も、数字の両がわに枠線とのすき間が残る。 */
.pfi-pr-table .pfi-tcells{grid-template-columns:repeat(5,10.8mm) repeat(3,12.4mm);gap:0}
.pfi-pr-table .pfi-tcell{min-width:0;width:auto;height:4.5mm;font-size:9pt;border:1px solid #444;border-radius:0;padding:0;margin:0 0 0 -1px}
.pfi-pr-table .pfi-odd .pfi-tname,.pfi-pr-table .pfi-odd .pfi-tcell{margin-top:-1px}
.pfi-pr-anslabel{margin-left:1.5mm;font-size:12.5pt;white-space:nowrap}
.pfi-pr-ansbox{display:inline-block;width:12mm;height:6mm;border:1.5px solid #333;box-sizing:border-box}
.pfi-pr-trace{display:flex;align-items:center;margin-top:0.3mm;height:5mm;font-size:12.5pt}
.pfi-pr-start{display:inline-block;min-width:4.8mm;text-align:center;font-size:12.5pt}
.pfi-pr-arrow{display:inline-block;width:3.2mm;text-align:center;font-size:9pt}
.pfi-pr-box{display:inline-block;width:7.2mm;height:5mm;border:1px solid #444;box-sizing:border-box}
.pfi-pr-choices{margin-top:0.3mm;font-size:12.5pt;line-height:5.3mm}
.pfi-pr-choices>div{white-space:nowrap}
.pfi-pr-choice{display:inline-block;margin-right:4.4mm}
.pfi-pr-choices-en .pfi-pr-choice{width:60mm;margin-right:4.8mm}
.pfi-pr-answers{flex:none;margin-top:auto;padding-bottom:5mm}
.pfi-pr-dashed{display:block;height:0;margin:0 0 0.8mm;padding:0;border:0;border-top:1.5pt dashed #aaa}
.pfi-pr-ansline{display:flex;align-items:baseline;gap:4mm;white-space:nowrap;font-size:10pt;line-height:5mm}
.pfi-pr-anshead{font-size:12.5pt;font-weight:700}
.pfi-app-pdf-page .pfi-pr-page{box-shadow:none;margin:0}

#pr-sheet[data-unit="parity_finite_iteration3_5"]{width:277mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="parity_finite_iteration3_5"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="parity_finite_iteration3_5"]>#pr-problems{display:block}
#pr-sheet[data-unit="parity_finite_iteration3_5"] .pfi-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="parity_finite_iteration3_5"]{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="parity_finite_iteration3_5"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="parity_finite_iteration3_5"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="parity_finite_iteration3_5"] .pfi-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
