/* ── chained_subtraction_intermediate2_1（ひくたびのとちゅうをたしかめよう、単元仕様書 v1.4）── */
/* 画面（§7）：始めの数・引く数・答え欄を矢印でつないだ鎖（狭い画面では段ごとに折り返す）、欄ごとのラベル、共通のテンキー。操作対象44px以上。 */
.csi-q{display:block;font-weight:700;line-height:1.5}
.csi-main{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;max-width:640px;margin:0 auto;box-sizing:border-box}
.csi-chain{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:center;gap:4px 2px;max-width:100%}
.csi-step{display:inline-flex;align-items:flex-end;flex-wrap:nowrap;gap:2px}
.csi-start{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:52px;height:50px;padding:0 8px;border:3px double #92400e;border-radius:50%;background:#fff7ed;font-size:1.5rem;font-weight:800}
.csi-sub{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:40px;height:50px;padding:0 4px;font-size:1.4rem;font-weight:800;color:#b91c1c;border-radius:8px}
.csi-arrow{display:inline-flex;align-items:center;height:50px;font-size:1.2rem;font-weight:900;color:#475569}
.csi-box{display:inline-flex;flex-direction:column;align-items:center;gap:2px}
.csi-label{font-size:.8rem;font-weight:700;color:#334155;white-space:nowrap;line-height:1.2}
.csi-inwrap{display:inline-flex;align-items:center;gap:2px}
.csi-input{box-sizing:border-box;width:60px;height:50px;font-size:1.4rem;text-align:center;border:2px solid #475569;border-radius:8px;background:#fff}
.csi-input:focus{outline:3px solid #2563eb;outline-offset:1px}
.csi-input.csi-ok{border-color:#16a34a;background:#f0fdf4}
.csi-input.csi-ng{border:3px solid #dc2626;background:#fef2f2}
.csi-mark{font-weight:900;font-size:1.1rem}
.csi-input.csi-ok+.csi-mark{color:#16a34a}
.csi-input.csi-ng+.csi-mark{color:#dc2626}
.csi-hl.csi-start,.csi-hl.csi-sub{background:#fef08a;box-shadow:0 0 0 3px #facc15}
.csi-hl.csi-box .csi-input{box-shadow:0 0 0 3px #facc15}
.csi-msg{min-height:1.4em;margin:0;color:#b91c1c;font-weight:700;text-align:center}
.feedback.has-text.csi-feedback{display:block;height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45;word-break:keep-all;overflow-wrap:anywhere}
.csi-expl-text{margin:4px 0 6px;line-height:1.8;word-break:keep-all;overflow-wrap:anywhere}
.csi-ex{margin:2px 0;word-break:keep-all;overflow-wrap:anywhere}
@media (max-width:360px){.csi-input{width:52px}.csi-start{min-width:46px;font-size:1.3rem}.csi-sub{min-width:34px;font-size:1.25rem}.csi-arrow{font-size:1rem}}

/* 印刷：A4横・1ページ（§7。v1.4）。題名の枠（紙面の幅いっぱい）と、その下の記入らん・実線（共通仕様 CP-08a・CP-08b）、共通の問い1回、
   2列×5段の鎖（1段23mm＝枠19mm＋段間4mm）、破線、こたえ、解答2列5行。 */
.csi-pr-page{width:277mm;height:190mm;box-sizing:border-box;display:flex;flex-direction:column;padding:0.8mm 0 0;margin:0 auto 8mm;overflow:hidden;background:#fff;color:#000;font-family:'Atkinson Hyperlegible','BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.csi-pr-top{flex:none}
.csi-pr-title{box-sizing:border-box;width:100%;margin:0;height:8mm;padding:0 2mm;font-size:13pt;font-weight:700;line-height:calc(8mm - 3pt);white-space:nowrap;text-align:center;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.csi-pr-top .pp-fields{height:8mm;margin:1mm 0 0;gap:6mm;font-size:12pt!important}
.csi-pr-top .pp-fields-group{gap:4mm}
.csi-pr-top .pp-field{gap:1mm}
.csi-pr-top .pp-field-line{width:16mm;height:6.5mm}
.csi-pr-top .pp-field-name .pp-field-line{min-width:40mm}
.csi-pr-top hr.pp-fields-solid{display:none}
.csi-pr-solid{box-sizing:content-box;height:0;margin:1mm 0 1mm;padding:0;border:0;border-top:1.5pt solid #333}
.csi-pr-inst{margin:0 0 0.6mm;font-size:13pt;line-height:6.4mm;height:6.4mm;flex:none}
.csi-pr-problems{flex:none;display:grid;grid-template-columns:137mm 137mm;column-gap:3mm}
.csi-pr-col{display:flex;flex-direction:column;gap:3mm}
.csi-pr-cell{box-sizing:border-box;height:19mm;border:0.3mm solid transparent;border-radius:1mm;padding:0 1mm 0.6mm;display:flex;align-items:flex-end;overflow:hidden;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.csi-pr-num{flex:none;width:9mm;font-weight:700;font-size:12.5pt;line-height:11mm;align-self:flex-end}
.csi-pr-start{flex:none;box-sizing:border-box;min-width:11mm;height:11mm;padding:0 1mm;display:inline-flex;align-items:center;justify-content:center;border:0.6mm double #1e3a8a;border-radius:1mm;font-size:14pt;font-weight:800}
.csi-pr-sub{flex:none;width:6.58mm;margin:0 0.35mm;height:11mm;display:inline-flex;align-items:center;justify-content:center;font-size:14pt;font-weight:800}
.csi-pr-arrow{flex:none;width:3mm;margin:0 0.18mm;height:11mm;display:inline-flex;align-items:center;justify-content:center;font-size:10pt;font-weight:900}
.csi-pr-group{flex:none;width:28mm;display:inline-flex;flex-direction:column;align-items:stretch}
.csi-pr-label{height:5mm;font-size:10pt;font-weight:700;line-height:5mm;white-space:nowrap;text-align:right}
.csi-pr-row{display:flex;align-items:center}
.csi-pr-box{box-sizing:border-box;width:14mm;height:11mm;border:0.4mm solid #000;border-radius:1mm}
.csi-pr-answers{flex:none;box-sizing:border-box;width:277mm;margin-top:auto;margin-bottom:1mm}
.csi-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0.5mm 0 0.5mm;padding:0;border:0;border-top:2pt dashed #aaa}
.csi-pr-anshead{margin:0;height:6mm;font-size:12.5pt;font-weight:700;line-height:6mm}
.csi-pr-agrid{display:grid;grid-template-columns:137mm 137mm;column-gap:3mm}
.csi-pr-answer{margin:0;height:7.5mm;font-size:12.5pt;line-height:7.5mm;white-space:nowrap}
.csi-pr-page[lang=en] .csi-pr-inst,.csi-pr-page[lang=en] .csi-pr-answer,.csi-pr-page[lang=en] .csi-pr-label{font-family:Arial,'Helvetica Neue','Liberation Sans',sans-serif}
.csi-app-pdf-page .csi-pr-page{box-shadow:none;margin:0}

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