/* ── multi_term_estimation3_4（多くの数をまとめてがい算しよう、単元仕様書 v1.4）── */
/* 画面：問題文、数のカード（記号と元の数、回答前はがい数の場所に□）、回答案内、選択肢①〜④。回答後は B群・C群でまとまりと小計（§5-3・§7）。 */
#question-text .mte-q{display:block}
.mte-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.mte-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:min(100%,640px);margin:2px auto 8px}
.mte-card{display:flex;flex-direction:column;align-items:center;min-width:96px;padding:6px 10px;border:2px solid #64748b;border-radius:10px;background:#fff;font-variant-numeric:tabular-nums}
.mte-card-top{font-size:17px;font-weight:800;white-space:nowrap}
.mte-card-r{margin-top:2px;padding-top:2px;border-top:1px dashed #94a3b8;font-size:16px;font-weight:700;color:#1e3a8a;white-space:nowrap;min-width:3em;text-align:center}
.mte-cards-grouped{gap:12px}
.mte-group{display:flex;flex-direction:column;align-items:center;padding:6px;border:3px solid #1e293b;border-radius:12px;background:#f8fafc}
.mte-group-cards{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.mte-subtotal{margin-top:4px;font-size:15px;font-weight:800;white-space:nowrap}
.mte-guide{margin:2px 0 6px;font-size:16px;font-weight:700;text-align:center;line-height:1.4}
.mte-guide[hidden]{display:none}
.mte-guide.mte-guide-warn{color:#b45309}
.mte-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,640px);margin:2px auto}
.mte-choices-C{grid-template-columns:minmax(0,1fr)}
.mte-choice{position:relative;box-sizing:border-box;min-height:52px;padding:6px 8px 6px 26px;border:3px solid #64748b;border-radius:10px;background:#fff;color:#1e293b;font-size:1.02rem;font-weight:800;font-variant-numeric:tabular-nums;cursor:pointer;touch-action:manipulation;text-align:left;word-break:keep-all;overflow-wrap:anywhere}
.mte-check{position:absolute;top:1px;left:6px;font-size:18px;font-weight:900;color:#1d4ed8}
.mte-choice.mte-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.mte-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.mte-choice:disabled{cursor:default;opacity:1}
.mte-choice.mte-ok,.mte-choice.mte-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.mte-choice.mte-ng,.mte-choice.mte-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.mte-choice.mte-right,.mte-choice.mte-right:disabled{border:3px solid #15803d;background:#f0fdf4;color:#14532d}
.mte-ok .mte-check,.mte-right .mte-check{color:#15803d}
.mte-ng .mte-check{color:#b91c1c}
.mte-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.mte-msg:empty{min-height:0;margin:0}
.feedback.has-text.mte-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.mte-correct{margin:2px 0 6px;font-weight:800;font-size:17px;overflow-wrap:anywhere}
.mte-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.mte-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}
@media (max-width:400px){.mte-cards{flex-direction:column;align-items:stretch}.mte-card{min-width:0}.mte-choices{grid-template-columns:minmax(0,1fr)}.mte-group{align-self:stretch}}

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

/* 印刷：A4縦・1列・1ページ（§7）。題名と記入欄を同じ行、共通の案内2行、問題（A 21.5mm・B 16mm・C 32.5mm）、破線、答え1行。 */
.mte-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}
.mte-pr-headrow{display:flex;flex-wrap:wrap;align-items:flex-end;column-gap:4mm;row-gap:1mm;flex:none}
.mte-pr-title{box-sizing:border-box;margin:0;height:8mm;padding:0 2mm;font-size:14pt;font-weight:700;line-height:7.4mm;white-space:nowrap;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact;flex:1 0 100%;text-align:center}
.mte-pr-page[lang="en"] .mte-pr-title{font-size:14pt;padding:0 1mm}
/* 記入欄は題名の下の行に置き、共通の目安（CP-08b）どおり月・日・年・組の下線14mm、名前は行ののこりいっぱい（v1.4。独立検査 MTE-IR4-02） */
.mte-pr-hfields{display:flex;gap:2mm;align-items:flex-end;flex:1 0 100%;min-width:0;font-size:12pt;line-height:6mm;white-space:nowrap}
.mte-pr-hfield{display:inline-flex;align-items:flex-end;gap:1mm;flex:none}
.mte-pr-hfield-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:2px solid #555}
.mte-hfield-name{flex:1;min-width:0}
.mte-hfield-name .mte-pr-hfield-line{flex:1;width:auto;min-width:40mm}
.mte-pr-headline{display:block;height:0;border:0;border-top:1.5pt solid #333;margin:1.4mm 0 0}
.mte-pr-inst{flex:none;margin:1.4mm 0 0;font-size:12.5pt;line-height:5.5mm}
.mte-pr-inst p{margin:0;white-space:nowrap}
.mte-pr-problems{flex:none;margin:2mm 0 0}
.mte-pr-cell{box-sizing:border-box;overflow:hidden;padding:0;background:linear-gradient(#bbb,#bbb) top left/100% 2px no-repeat;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.mte-pr-cell-A{height:21.7mm}.mte-pr-cell-B{height:16.2mm}.mte-pr-cell-C{height:32.7mm}
.mte-pr-q{margin-top:1.1mm;height:5.4mm;line-height:5.4mm;font-size:12.5pt;white-space:pre;font-weight:700}
.mte-pr-choices{display:grid;font-size:12.5pt;line-height:5.4mm;white-space:nowrap;column-gap:6mm}
.mte-pr-choices-A{grid-template-columns:repeat(2,max-content)}
.mte-pr-choices-B{grid-template-columns:repeat(5,max-content)}
.mte-pr-cond{height:5.4mm;font-weight:700}
.mte-pr-choices-C{grid-template-columns:max-content}
.mte-pr-choice{height:5.4mm}
.mte-pr-answers{flex:none;box-sizing:border-box;width:190mm;margin-top:auto;padding-bottom:5mm}
.mte-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0.8mm 0 0.6mm;padding:0;border:0;border-top:2pt dashed #aaa}
.mte-pr-ansrow{display:grid;grid-template-columns:15mm repeat(10,17mm);height:5mm;line-height:5mm;font-size:10pt;white-space:nowrap}
.mte-pr-answers-title{font-weight:700}
.mte-app-pdf-page .mte-pr-page{box-shadow:none;margin:0}

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