/* ── add_sub_estimation3_4（たし算ひき算の答えをがい算しよう、単元仕様書 v1.3）── */
/* 画面：問題文、二段の表（上の段は元の式、下の段はがい数の式。回答前は□）、回答案内、選択肢①〜④（§5-3・§7）。 */
#question-text .ase-q{display:block}
.ase-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.ase-table{display:grid;grid-template-columns:auto auto auto auto;grid-template-areas:"ho ol or ." "hr rl rr re";column-gap:10px;row-gap:4px;align-items:center;margin:2px auto 8px;padding:6px 12px;border:2px solid #64748b;border-radius:10px;background:#fff;font-variant-numeric:tabular-nums}
.ase-cell{white-space:nowrap;text-align:right;font-size:18px;font-weight:800;color:#0f172a}
.ase-head{text-align:left;font-size:13px;font-weight:700;color:#475569}
.ase-h-original{grid-area:ho}.ase-o-left{grid-area:ol}.ase-o-right{grid-area:or}
.ase-h-rounded{grid-area:hr}.ase-r-left{grid-area:rl}.ase-r-right{grid-area:rr}.ase-r-result{grid-area:re}
.ase-r-left,.ase-r-right,.ase-r-result{color:#1e3a8a;border-top:1px dashed #94a3b8;padding-top:3px}
.ase-op{display:inline-block;min-width:1.2em;margin-right:4px;text-align:center;color:#334155}
.ase-num.ase-blank{color:#64748b}
.ase-guide{margin:2px 0 6px;font-size:16px;font-weight:700;text-align:center;line-height:1.4}
.ase-guide[hidden]{display:none}
.ase-guide.ase-guide-warn{color:#b45309}
.ase-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,640px);margin:2px auto}
.ase-choices-C{grid-template-columns:minmax(0,1fr)}
.ase-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}
.ase-check{position:absolute;top:1px;left:6px;font-size:18px;font-weight:900;color:#1d4ed8}
.ase-choice.ase-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.ase-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.ase-choice:disabled{cursor:default;opacity:1}
.ase-choice.ase-ok,.ase-choice.ase-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.ase-choice.ase-ng,.ase-choice.ase-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.ase-choice.ase-right,.ase-choice.ase-right:disabled{border:3px solid #15803d;background:#f0fdf4;color:#14532d}
.ase-ok .ase-check,.ase-right .ase-check{color:#15803d}
.ase-ng .ase-check{color:#b91c1c}
.ase-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.ase-msg:empty{min-height:0;margin:0}
.feedback.has-text.ase-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.ase-correct{margin:2px 0 6px;font-weight:800;font-size:17px;overflow-wrap:anywhere}
.ase-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.ase-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}
/* せまい画面：一つ目の数の組（元の数とがい数）の下に二つ目の数の組を置く（§7） */
@media (max-width:520px){
  .ase-table{grid-template-columns:auto auto;grid-template-areas:"ho hr" "ol rl" "or rr" ". re";column-gap:14px}
  .ase-r-left,.ase-r-right,.ase-r-result{border-top:0;padding-top:0}
  .ase-choices{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:360px){.ase-cell{font-size:16px}.ase-choice{font-size:.98rem;padding-left:24px}}

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

/* 印刷：A4横・2列・1ページ（§7・v1.3）。題名の枠（幅いっぱい・中央）とその下の記入欄、共通の案内、2列（各5問。A・B群 22mm、C群 33mm）、破線、答え1行。 */
.ase-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}
.ase-pr-headrow{display:flex;flex-direction:column;gap:1.5mm;flex:none}
.ase-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}
.ase-pr-hfields{display:flex;gap:3mm;align-items:flex-end;min-width:0;height:6mm;font-size:12pt;line-height:6mm;white-space:nowrap}
.ase-pr-hfield{display:inline-flex;align-items:flex-end;gap:1mm;flex:none}
.ase-pr-hfield-line{display:inline-block;box-sizing:border-box;width:20mm;height:6mm;border-bottom:2px solid #555}
.ase-hfield-name{flex:1;min-width:0}
.ase-hfield-name .ase-pr-hfield-line{flex:1;width:auto;min-width:30mm}
.ase-pr-headline{display:block;height:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.ase-pr-inst{flex:none;box-sizing:border-box;width:270mm;margin:1.2mm 0 0;font-size:12.5pt;line-height:5.5mm}
.ase-pr-problems{flex:none;display:grid;grid-template-columns:repeat(2,133mm);column-gap:8mm;height:141.2mm;margin:5.2mm 0 0}
.ase-pr-col{display:flex;flex-direction:column;justify-content:space-between;height:141.2mm}
.ase-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}
.ase-pr-cell-A,.ase-pr-cell-B{height:21.6mm}.ase-pr-cell-C{height:32.6mm}
.ase-pr-q{height:5.5mm;line-height:5.5mm;font-size:12.5pt;white-space:pre;font-weight:700}
.ase-pr-choices{display:grid;font-size:12.5pt;line-height:5.5mm;white-space:nowrap;column-gap:6mm}
.ase-pr-choices-A,.ase-pr-choices-B{grid-template-columns:repeat(2,max-content)}
.ase-pr-choices-C{grid-template-columns:max-content}
.ase-pr-choice{height:5.5mm}
.ase-pr-answers{flex:none;box-sizing:border-box;width:277mm;margin-top:auto;padding-bottom:5.2mm}
.ase-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 0.8mm;padding:0;border:0;border-top:2pt dashed #aaa}
.ase-pr-ansrow{display:grid;grid-template-columns:20mm repeat(10,25.5mm);align-items:baseline;height:5.5mm;line-height:5.5mm;font-size:10pt;white-space:nowrap}
.ase-pr-answers-title{font-weight:700;font-size:12.5pt}
.ase-app-pdf-page .ase-pr-page{box-shadow:none;margin:0}

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