/* ── sum_difference_product2_3（和とちがいのかけ算を同じ数のかけ算のちがいで表そう、単元仕様書 v1.4）── */
/* 画面：問題文の下に、式の二つの□の位置に左右の欄を置いた式、回答案内、欄ごとの案内、テンキー、「こたえる！」ボタン（§5-3・§7 画面表示）。図は使わない。 */
.sdp-main{display:flex;flex-direction:column;align-items:center;gap:4px;margin:4px auto 2px;max-width:600px;width:100%;box-sizing:border-box}
/* 式は＝の前で折り返せるが、数・×・＋・－・＝と欄は同じまとまりの中で分けない。 */
.sdp-expr{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;column-gap:6px;row-gap:4px;font-size:1.35rem;font-weight:800;line-height:1.3}
.sdp-expr-part{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.sdp-times{padding:0 2px}
.sdp-input{width:3.2em;min-width:44px;min-height:44px;font-size:1.35rem;font-weight:800;padding:2px 4px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:10px;text-align:center;font-family:inherit;box-sizing:border-box}
.sdp-input:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
.sdp-input.ufk-input-active{box-shadow:0 0 0 3px #f59e0b}
.sdp-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.sdp-input.sdp-input-ok{border:3px solid #15803d;background:#dcfce7}
.sdp-input.sdp-input-ng{border:3px dashed #b91c1c;background:#fff1f2}
/* 型2：ア・イ・ウの三つのボタン（えらぶと色が変わり、「こたえる！」で採点）。 */
.sdp-choices{display:flex;flex-direction:column;gap:8px;width:100%;max-width:420px}
.sdp-choice{display:flex;align-items:center;gap:10px;min-height:48px;padding:6px 12px;border:3px solid #94a3b8;border-radius:12px;background:#fff;font-family:inherit;font-size:1.25rem;font-weight:800;color:#111827;cursor:pointer;text-align:left}
.sdp-choice:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
.sdp-choice-mark{flex:none;display:inline-flex;align-items:center;justify-content:center;width:1.8em;height:1.8em;border-radius:50%;background:#e2e8f0;font-size:1rem}
.sdp-choice-text{overflow-wrap:anywhere}
.sdp-choice.sdp-choice-picked{border-color:#1d4ed8;background:#eff6ff}
.sdp-choice.sdp-choice-picked .sdp-choice-mark{background:#1d4ed8;color:#fff}
.sdp-choice:disabled{cursor:default;opacity:1}
.sdp-choice.sdp-choice-ok{border:3px solid #15803d;background:#dcfce7}
.sdp-choice.sdp-choice-ng{border:3px dashed #b91c1c;background:#fff1f2}
.sdp-expr-word{padding-left:2px}
.sdp-guide{margin:4px auto 2px;font-weight:700;text-align:center;max-width:32em}
.sdp-msgs{display:flex;flex-direction:column;align-items:center;gap:2px}
.sdp-msg{margin:0;color:#b91c1c;font-weight:700;font-size:.95rem;text-align:center;max-width:32em;overflow-wrap:anywhere}
.sdp-msg:empty{display:none}
.feedback.has-text.sdp-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.sdp-field-result{margin:2px 0;font-weight:700}
.sdp-field-ok{color:#15803d}
.sdp-field-ng{color:#b91c1c}
.sdp-correct{margin:2px 0 6px;font-weight:700}
.sdp-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.sdp-lesson-ex{display:inline-block;margin-top:4px;font-weight:700;overflow-wrap:anywhere}
.sdp-lesson-ref{margin:4px 0 0;font-size:.9em;color:#475569}
#page-quiz.active:has(.sdp-main) #question-text{word-break:keep-all;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.sdp-choices) #question-text{word-break:normal}
#page-quiz.active:has(.sdp-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.sdp-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.sdp-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.sdp-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0;white-space:pre-line;overflow-wrap:anywhere}
@media (max-width:400px){
  .sdp-expr{font-size:1.15rem;column-gap:4px}
  .sdp-input{font-size:1.15rem;width:2.8em}
}

/* 印刷：A4縦・2列×5段・1ページ（§7。用紙の余白10mm、本文190×277mm、列92mm・列の間6mm）。
   共通の領域33mm（題名7mm・記入欄7mmと実線・共通の案内16mm・間隔3mm）、各問の領域35mm（1行目8mm・2行目8mm・計算欄14mm・余り5mm）、
   答え：見出し6mmと1件10mm（1行5mmと余り5mm）×5段。 */
.sdp-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}
.sdp-pr-head{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:15mm}
.sdp-pr-title{box-sizing:border-box;margin:0;height:7mm;font-size:14pt;font-weight:700;line-height:5.9mm;text-align:center;white-space:nowrap;padding:0;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.sdp-pr-head .pp-fields{margin:0;height:7mm;line-height:6mm!important;font-size:12pt}
.sdp-pr-head hr.pp-fields-solid{margin:0.5mm 0!important}
.sdp-pr-inst{flex:none;box-sizing:border-box;margin:0;height:15mm;padding-top:1mm;padding-bottom:3mm;font-size:12.5pt;line-height:5.5mm;overflow:hidden}
.sdp-pr-problems{display:grid;grid-template-columns:92mm 92mm;column-gap:6mm;flex:none;height:175mm;margin-top:3mm}
.sdp-pr-col{display:grid;grid-template-rows:repeat(5,35mm)}
.sdp-pr-cell{box-sizing:border-box;height:35mm;overflow:hidden;display:flex;flex-direction:column;padding-bottom:5mm}
.sdp-pr-q1{margin:0;height:8mm;font-size:12.5pt;line-height:8mm;white-space:pre;font-weight:700}
.sdp-pr-q2{margin:0;height:8mm;font-size:12.5pt;line-height:8mm;white-space:nowrap;display:flex;align-items:center}
.sdp-pr-expr{white-space:pre}
.sdp-pr-paren{display:inline-flex;align-items:center;white-space:pre}
.sdp-pr-box{display:inline-block;box-sizing:border-box;width:16mm;height:8mm}
.sdp-pr-work{box-sizing:border-box;height:14mm;width:89mm;border:0.35mm solid #888;border-radius:1mm;padding:0.5mm 1mm}
/* 型2の三つの式（計算欄と同じ高さ14mmに3行）。 */
.sdp-pr-choices{box-sizing:border-box;height:14mm;width:89mm;padding:0 1mm;display:flex;flex-direction:column;justify-content:space-between}
.sdp-pr-choice{margin:0;height:4.6mm;font-size:11pt;line-height:4.6mm;white-space:pre}
.sdp-pr-work-label{font-size:9.5pt;line-height:4mm;color:#333}
.sdp-pr-answers{flex:none;box-sizing:border-box;margin-top:3mm}
.sdp-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 0.5mm;padding:0;border:0;border-top:2pt dashed #aaa}
.sdp-pr-answers-title{font-weight:700;font-size:12.5pt;height:6mm;line-height:6mm}
.sdp-pr-ans-grid{display:grid;grid-template-columns:92mm 92mm;column-gap:6mm}
.sdp-pr-ans-col{display:grid;grid-template-rows:repeat(5,10mm)}
.sdp-pr-ans{box-sizing:border-box;margin:0;height:10mm;padding-right:3mm;padding-bottom:5mm;font-size:10pt;line-height:5mm;white-space:nowrap;overflow:hidden}
.sdp-app-pdf-page .sdp-pr-page{box-shadow:none;margin:0}

#pr-sheet[data-unit="sum_difference_product2_3"]{width:190mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="sum_difference_product2_3"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="sum_difference_product2_3"]>#pr-problems{display:block}
/* 画面のプレビューでは、用紙の余白10mmを白い縁で見せる（印刷の寸法は変えない）。 */
#pr-sheet[data-unit="sum_difference_product2_3"] .sdp-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="sum_difference_product2_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="sum_difference_product2_3"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="sum_difference_product2_3"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="sum_difference_product2_3"] .sdp-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
/* v1.4 型3：①まん中の数・②ちがい・③答えの3行。各行は文と欄で、狭い画面では欄が次の行へ回る。 */
.sdp-steps{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:2px auto;max-width:100%;font-size:1.15rem;font-weight:700;line-height:1.35}
.sdp-step{margin:0;display:flex;flex-wrap:wrap;align-items:center;column-gap:6px;row-gap:4px}
.sdp-step-text{overflow-wrap:anywhere}
.sdp-pr-steps{box-sizing:border-box;height:14mm;width:89mm;display:flex;align-items:flex-start}
