/* ── common_factor_grouping3_4（共通の数で計算をまとめよう、単元仕様書 v1.2）── */
/* 画面：問題文、もとの式（数を一つずつ区切る。回答後は共通の数に○と線、残りの数に△、対応の表示）、選択肢①〜④（§5-3・§7）。 */
#question-text .cfg-q{display:block}
.cfg-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.cfg-layout{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;width:min(100%,760px)}
.cfg-src{display:flex;flex-direction:column;align-items:center;padding:8px 12px 4px;border:2px solid #64748b;border-radius:10px;background:#fff;max-width:100%}
.cfg-src-expr{position:relative;display:flex;flex-wrap:nowrap;align-items:flex-end;gap:2px;padding-bottom:16px;font-size:22px;font-weight:800;color:#0f172a;font-variant-numeric:tabular-nums;white-space:nowrap}
.cfg-num{display:inline-flex;flex-direction:column;align-items:center;min-width:1.6em;padding:0 3px;border:1.5px dashed #94a3b8;border-radius:6px;line-height:1.2}
.cfg-num-k{border:2.5px solid #b45309;background:#fff7ed}
.cfg-num-r{border:2px solid #1e3a8a;background:#eff6ff}
.cfg-sign{font-size:12px;line-height:1;color:#334155}
.cfg-num-k .cfg-sign{color:#b45309}
.cfg-sym{padding:0 3px;color:#334155}
.cfg-link{position:absolute;left:0;top:0;pointer-events:none;overflow:visible}
.cfg-link-path{fill:none;stroke:#b45309;stroke-width:2.5}
.cfg-match{margin:2px 0 2px;font-size:15px;font-weight:700;color:#334155;text-align:center}
.cfg-guide{margin:4px 0 2px;font-size:15px;font-weight:700;text-align:center;line-height:1.4}
.cfg-guide[hidden]{display:none}
.cfg-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:min(100%,360px)}
.cfg-choice{position:relative;box-sizing:border-box;min-height:50px;padding:6px 8px 6px 26px;border:3px solid #64748b;border-radius:10px;background:#fff;color:#1e293b;font-size:1.05rem;font-weight:800;font-variant-numeric:tabular-nums;cursor:pointer;touch-action:manipulation;text-align:left;white-space:nowrap}
.cfg-check{position:absolute;top:1px;left:6px;font-size:18px;font-weight:900;color:#1d4ed8}
.cfg-choice.cfg-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.cfg-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.cfg-choice:disabled{cursor:default;opacity:1}
.cfg-choice.cfg-ok,.cfg-choice.cfg-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.cfg-choice.cfg-ng,.cfg-choice.cfg-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.cfg-choice.cfg-right,.cfg-choice.cfg-right:disabled{border:3px solid #15803d;background:#f0fdf4;color:#14532d}
.cfg-ok .cfg-check,.cfg-right .cfg-check{color:#15803d}
.cfg-ng .cfg-check{color:#b91c1c}
.cfg-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.cfg-msg:empty{min-height:0;margin:0}
.feedback.has-text.cfg-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.cfg-correct{margin:2px 0 6px;font-weight:800;font-size:17px;overflow-wrap:anywhere}
.cfg-nobr{white-space:nowrap}
.cfg-expl-text{margin:4px 0 6px;word-break:normal;overflow-wrap:normal;line-break:strict}
.cfg-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}
@media (max-width:520px){.cfg-layout{flex-direction:column}.cfg-choices{width:100%}}
@media (max-width:360px){.cfg-src-expr{font-size:18px}.cfg-num{min-width:1.4em;padding:0 2px}.cfg-choice{font-size:.98rem;padding-left:24px}}

.cfg-example .cfg-ex-a{margin:4px 0 6px;overflow-wrap:anywhere}
#page-quiz.active:has(.cfg-main) #question-text{word-break:normal;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.cfg-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.cfg-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.cfg-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.cfg-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}

/* 印刷：A4縦・2列×5段・1ページ（§7）。題名の枠（幅いっぱい・中央）とその下の記入欄、共通の案内、2列×5段（各問 38mm）、破線、答え2列。 */
.cfg-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}
.cfg-pr-headrow{display:flex;flex-direction:column;gap:1.5mm;flex:none}
.cfg-pr-title{box-sizing:border-box;margin:0;height:8mm;width:100%;padding:0 2mm;font-size:14pt;font-weight:700;line-height:7.4mm;white-space:nowrap;text-align:center;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact;flex:none}
.cfg-pr-hfields{display:flex;gap:2mm;align-items:flex-end;min-width:0;height:6mm;font-size:12pt;line-height:6mm;white-space:nowrap}
.cfg-pr-hfield{display:inline-flex;align-items:flex-end;gap:1mm;flex:none}
.cfg-pr-hfield-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:2px solid #555}
.cfg-hfield-name{flex:1;min-width:0}
.cfg-hfield-name .cfg-pr-hfield-line{flex:1;width:auto;min-width:30mm}
.cfg-pr-headline{display:block;height:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.cfg-pr-inst{flex:none;box-sizing:border-box;width:184mm;margin:1.2mm 0 0;font-size:12.5pt;line-height:5.3mm}
.cfg-pr-problems{flex:none;display:grid;grid-template-columns:repeat(2,92mm);column-gap:3mm;margin:5.2mm 0 0}
.cfg-pr-col{display:flex;flex-direction:column}
.cfg-pr-cell{box-sizing:border-box;height:38mm;overflow:hidden;padding:0.4mm 0 0;background:linear-gradient(#bbb,#bbb) top left/100% 2px no-repeat;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.cfg-pr-q{display:flex;align-items:center;height:8.6mm;font-size:12.5pt;font-weight:700;white-space:pre}
.cfg-pr-box{display:inline-block;box-sizing:border-box;width:12mm;height:8.2mm;margin-left:1mm;border:2px solid #333;color:transparent;overflow:hidden;font-weight:400}
.cfg-pr-choices{margin-top:0.6mm;font-size:12.5pt;line-height:5.5mm;white-space:nowrap}
.cfg-pr-choice{height:5.5mm}
.cfg-pr-answers{flex:none;box-sizing:border-box;width:190mm;margin-top:auto;padding-bottom:5.2mm}
.cfg-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 0.8mm;padding:0;border:0;border-top:2pt dashed #aaa}
.cfg-pr-answers-title{height:6mm;line-height:6mm;font-size:12.5pt;font-weight:700}
.cfg-pr-anscols{display:grid;grid-template-columns:repeat(2,92mm);column-gap:3mm}
.cfg-pr-ans{height:4.5mm;line-height:4.5mm;font-size:10pt;white-space:nowrap}
.cfg-app-pdf-page .cfg-pr-page{box-shadow:none;margin:0}

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