/* ── decimal_multi_term_addsub3_4（三つ以上の小数を続けて計算しよう、単元仕様書 v1.4）── */
/* 画面：問題文の下に、式と答えのらん（1行）、途中欄、回答案内、テンキー、こたえるボタン（§5-3・§7 画面表示）。 */
.dmt-main{display:flex;flex-direction:column;align-items:center;gap:6px;margin:4px 0 8px;max-width:100%}
/* 式・＝・入力らんは1行に保つ。画面の幅に合わせて文字を小さくし、13pxより小さくしない（§7 v1.4）。 */
.dmt-expr{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;gap:.3em;max-width:100%;white-space:nowrap;font-size:clamp(13px,4.1vw,1.55rem);font-weight:700;color:#0f172a;line-height:1.6}
.dmt-expr-text{white-space:nowrap}
.dmt-op,.dmt-eq{padding:0 .05em}
.dmt-input{width:5.2em;min-height:44px;font-size:1em;padding:2px 4px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:10px;text-align:center;font-family:inherit;font-weight:700;box-sizing:border-box;flex:none}
.dmt-input:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
.dmt-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.dmt-input.dmt-input-ok{border:3px solid #15803d;background:#dcfce7}
.dmt-input.dmt-input-ng{border:3px dashed #b91c1c;background:#fff1f2}
/* 途中欄：未回答では空のまま置き、回答後に各段を1行ずつ出す（§5-3）。 */
.dmt-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;align-items:center;gap:2px}
.dmt-step{font-size:clamp(13px,3.9vw,1.25rem);font-weight:700;line-height:1.5;white-space:nowrap;color:#1e293b}
.dmt-step:empty{min-height:0}
.dmt-steps-done{border:2px solid #94a3b8;border-radius:8px;padding:4px 12px;background:#f8fafc}
.dmt-guide{margin:6px auto 4px;font-weight:700;text-align:center;max-width:32em}
.dmt-msg{margin:2px auto 0;color:#b91c1c;font-weight:700;font-size:1rem;text-align:center;max-width:32em}
.dmt-msg:empty{display:none}
.feedback.has-text.dmt-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.dmt-correct{margin:2px 0 6px;font-weight:700;font-size:1rem}
.dmt-expl-text{margin:4px 0 6px;overflow-wrap:anywhere;font-size:1rem}
#page-quiz.active:has(.dmt-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.dmt-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.dmt-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.dmt-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0;overflow-wrap:anywhere}

/* 印刷：A4横・2列・1ページ（§7。用紙の余白10mm、本文277×190mm、各列134mm・列の間5mm、各問の領域は幅134mm・高さ26mm）。 */
.dmt-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}
.dmt-pr-head-area{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:277mm}
.dmt-pr-title{box-sizing:border-box;margin:0;height:8mm;font-size:14.3pt;font-weight:700;line-height:7mm;text-align:center;white-space:nowrap;padding:0;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.dmt-pr-head-area .pp-fields{margin-top:1mm}
.dmt-pr-head-area hr.pp-fields-solid{margin:1mm 0!important}
.dmt-pr-instruction{margin:0;height:6mm;font-size:12.6pt;line-height:6mm;white-space:nowrap}
.dmt-pr-problems{display:grid;grid-template-columns:134mm 134mm;column-gap:5mm;flex:none;margin-top:2mm}
.dmt-pr-col{display:grid;grid-template-rows:repeat(5,26mm)}
.dmt-pr-cell{box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;width:134mm;height:26mm}
/* 問と問のさかいめに点線（線は背景で描き、各問の高さ26mmを減らさない）。 */
.dmt-pr-cell+.dmt-pr-cell{background-image:linear-gradient(to right,#888 50%,transparent 50%);background-size:1.2mm 0.3mm;background-repeat:repeat-x;background-position:left top;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.dmt-pr-row{display:flex;align-items:center;gap:1.5mm;height:8mm;flex:none;font-size:12.6pt;white-space:nowrap;margin-top:.6mm}
.dmt-pr-q{white-space:pre}
.dmt-pr-box{display:inline-block;box-sizing:border-box;width:24mm;height:8mm;border:0.35mm solid #333;flex:none}
.dmt-pr-work{height:13mm;flex:none}
.dmt-pr-answers{flex:none;box-sizing:border-box;margin-top:2mm}
.dmt-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 1mm;padding:0;border:0;border-top:2pt dashed #aaa}
.dmt-pr-answers-title{font-weight:700;font-size:12.6pt;height:6mm;line-height:6mm}
.dmt-pr-answer-grid{display:grid;grid-template-columns:repeat(5,53mm);column-gap:2mm}
.dmt-pr-ans{margin:0;font-size:10.2pt;line-height:4.5mm;height:4.5mm;white-space:nowrap}
.dmt-app-pdf-page .dmt-pr-page{box-shadow:none;margin:0}

#pr-sheet[data-unit="decimal_multi_term_addsub3_4"]{width:277mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="decimal_multi_term_addsub3_4"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="decimal_multi_term_addsub3_4"]>#pr-problems{display:block}
/* 画面のプレビューでは、用紙の余白10mmを白い縁で見せる（印刷の寸法は変えない）。 */
#pr-sheet[data-unit="decimal_multi_term_addsub3_4"] .dmt-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="decimal_multi_term_addsub3_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="decimal_multi_term_addsub3_4"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="decimal_multi_term_addsub3_4"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="decimal_multi_term_addsub3_4"] .dmt-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
