/* ── mul_div_estimation3_4（かけ算わり算の答えをがい算しよう、単元仕様書 v1.3）── */
/* 画面：問題文、流れの図（元の数→丸める位→丸め方→がい数、二つのがい数から見積もり。回答前は元の数だけ）、回答案内、選択肢①〜④（§5-3・§7）。 */
#question-text .mde-q{display:block}
.mde-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.mde-flow{display:flex;align-items:center;justify-content:center;gap:6px;width:min(100%,760px);margin:2px auto 8px}
.mde-rows{display:flex;flex-direction:column;gap:6px;min-width:0}
.mde-row{display:flex;align-items:stretch;gap:2px}
.mde-box{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;min-width:76px;padding:3px 6px;border:2px solid #64748b;border-radius:8px;background:#fff;text-align:center;font-variant-numeric:tabular-nums}
.mde-box-h{font-size:11px;font-weight:700;color:#475569;white-space:nowrap}
.mde-box-v{font-size:16px;font-weight:800;color:#0f172a;white-space:normal;word-break:keep-all;overflow-wrap:normal;line-height:1.25}
.mde-box-original{border-color:#1e293b;background:#f8fafc}
/* PC：上下の行で同じ役割の箱の幅をそろえる（参考 MDE-IR1-08） */
@media (min-width:641px){.mde-box-original{width:96px}.mde-box-place{width:112px}.mde-box-way{width:84px}.mde-box-rounded{width:108px}}
.mde-box-rounded .mde-box-v,.mde-box-result .mde-box-v{color:#1e3a8a}
.mde-box.mde-blank .mde-box-v{color:#475569}
.mde-box-result{min-width:110px;max-width:200px;border:3px solid #1e3a8a;background:#eff6ff}
.mde-arrow{display:flex;align-items:center;justify-content:center;flex:none;width:14px;color:#64748b;font-weight:900}
.mde-arrow::before{content:'→'}
.mde-arrow-result{width:16px}
.mde-guide{margin:2px 0 6px;font-size:16px;font-weight:700;text-align:center;line-height:1.4}
.mde-guide[hidden]{display:none}
.mde-guide.mde-guide-warn{color:#b45309}
.mde-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,640px);margin:2px auto}
.mde-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:normal}
.mde-check{position:absolute;top:1px;left:6px;font-size:18px;font-weight:900;color:#1d4ed8}
.mde-choice.mde-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.mde-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.mde-choice:disabled{cursor:default;opacity:1}
.mde-choice.mde-ok,.mde-choice.mde-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.mde-choice.mde-ng,.mde-choice.mde-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.mde-choice.mde-right,.mde-choice.mde-right:disabled{border:3px solid #15803d;background:#f0fdf4;color:#14532d}
.mde-ok .mde-check,.mde-right .mde-check{color:#15803d}
.mde-ng .mde-check{color:#b91c1c}
.mde-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.mde-msg:empty{min-height:0;margin:0}
.feedback.has-text.mde-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.mde-correct{margin:2px 0 6px;font-weight:800;font-size:17px;overflow-wrap:anywhere}
.mde-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.mde-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}
/* せまい画面：流れの図を上から下へ（左の数と右の数を二つのたての列に）。選択肢は1列 */
@media (max-width:640px){
  .mde-flow{flex-direction:column;gap:4px}
  .mde-rows{flex-direction:row;gap:6px;width:100%;justify-content:center}
  .mde-row{flex-direction:column;align-items:stretch;flex:1 1 0;min-width:0;max-width:170px}
  .mde-box{min-width:0;width:100%}
  .mde-arrow{width:auto;height:14px;line-height:14px}
  .mde-arrow::before{content:'↓'}
  .mde-box-result{width:auto;min-width:min(100%,200px);max-width:100%}
  .mde-box-result .mde-box-v{white-space:normal}
  .mde-choices{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:360px){.mde-box-v{font-size:15px}.mde-choice{font-size:.98rem;padding-left:24px}}

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

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

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