/* ── box_mixed_inverse3_4（□をふくむまじった式をぎゃく算しよう、単元仕様書 v1.2）── */
/* 画面：問題文（等式は改行しない）、4択（2×2）、回答案内。回答後は正しい答え・解説・式の木ともどす矢印（§5-3・§7 画面表示）。 */
#question-text .bmi-q{display:block}
.bmi-eq{display:inline-block;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:800}
.bmi-box{display:inline-block;font-family:'Segoe UI Symbol','Noto Sans Symbols 2','Arial Unicode MS',sans-serif;font-weight:400}
.bmi-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.bmi-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,420px);margin:2px auto}
.bmi-choice{position:relative;box-sizing:border-box;min-height:52px;padding:6px 4px;border:3px solid #64748b;border-radius:10px;background:#fff;color:#1e293b;font-size:1.15rem;font-weight:800;font-variant-numeric:tabular-nums;cursor:pointer;touch-action:manipulation}
.bmi-check{position:absolute;top:1px;left:6px;font-size:18px;font-weight:900;color:#1d4ed8}
.bmi-choice.bmi-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.bmi-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.bmi-choice:disabled{cursor:default;opacity:1}
.bmi-choice.bmi-ok,.bmi-choice.bmi-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.bmi-choice.bmi-ng,.bmi-choice.bmi-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.bmi-choice.bmi-right,.bmi-choice.bmi-right:disabled{border:3px solid #15803d;background:#f0fdf4;color:#14532d}
.bmi-ok .bmi-check,.bmi-right .bmi-check{color:#15803d}
.bmi-ng .bmi-check{color:#b91c1c}
.bmi-guide{margin:6px 0 0;font-size:16px;font-weight:700;text-align:center;line-height:1.4}
.bmi-guide[hidden]{display:none}
.bmi-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.bmi-msg:empty{min-height:0;margin:0}
.feedback.has-text.bmi-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.bmi-correct{margin:2px 0 6px;font-weight:800;font-size:17px}
.bmi-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.bmi-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}

/* 回答後の式の木ともどす矢印：PC幅は左右、狭い幅は上下（§7・AC-11）。番号・太線・矢印の形で示し、色だけに頼らない。 */
.bmi-figure{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:10px 18px;margin:6px 0 4px;padding:8px;border:2px solid #cbd5e1;border-radius:10px;background:#f8fafc}
.bmi-fig-tree{display:flex;flex-direction:column;align-items:center;max-width:100%}
.bmi-tree{display:block;max-width:100%;height:auto}
.bmi-edge{stroke:#64748b;stroke-width:1.6}
.bmi-edge-path{stroke:#1e293b;stroke-width:4.5}
.bmi-opnode{fill:#fff;stroke:#64748b;stroke-width:2}
.bmi-opnode-path{stroke:#1e293b;stroke-width:3.5}
.bmi-optext{font-size:20px;font-weight:800;text-anchor:middle;fill:#1e293b}
.bmi-numtext{font-size:18px;font-weight:800;text-anchor:middle;fill:#1e293b;font-variant-numeric:tabular-nums}
.bmi-boxleaf{fill:#fff;stroke:#1e293b;stroke-width:3}
.bmi-orderbadge{fill:#334155}
.bmi-undobadge{fill:#fff;stroke:#1e293b;stroke-width:2}
.bmi-badgetext{font-size:13px;font-weight:800;text-anchor:middle;fill:#1e293b}
.bmi-orderbadge+.bmi-badgetext{fill:#fff}
.bmi-legend{display:flex;flex-wrap:wrap;gap:4px 12px;justify-content:center;font-size:13px;font-weight:700;margin-top:2px}
.bmi-legend>span{display:inline-flex;align-items:center;gap:4px}
.bmi-legend-order{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:#334155;color:#fff;font-size:12px}
.bmi-legend-undo,.bmi-undobadge-text{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:20px;padding:0 2px;border:2px solid #1e293b;border-radius:3px;background:#fff;font-size:12px;font-weight:800;box-sizing:border-box}
.bmi-fig-chain{min-width:0;max-width:100%}
.bmi-chain-title{font-weight:800;font-size:14px;margin-bottom:2px;text-align:center}
.bmi-chain{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;align-items:flex-start}
.bmi-chain-start{font-size:18px;font-weight:800;padding:2px 8px;border:2px solid #1e293b;border-radius:6px;background:#fff;font-variant-numeric:tabular-nums}
.bmi-chain-step{display:flex;align-items:center;gap:6px;margin-top:2px;font-size:17px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.bmi-chain-arrow{font-size:22px;font-weight:900;line-height:1;width:22px;text-align:center}
@media (max-width:480px){.bmi-figure{flex-direction:column;align-items:center}}

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

/* 印刷：A4縦・1ページ（§7）。題名の枠と記入欄、共通の案内、2列×5段で1問92×41mm（等式の行8mm・4択7mm・計算欄19mm・余り5mm以上）、破線、答え2行×5。 */
.bmi-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}
.bmi-pr-headblock{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:19.5mm}
.bmi-pr-title{box-sizing:border-box;margin:0;height:9mm;font-size:15pt;font-weight:700;line-height:8mm;text-align:center;white-space:nowrap;padding:0;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.bmi-pr-page[lang="en"] .bmi-pr-title{font-size:14pt}
.bmi-pr-hfields{display:flex;gap:5mm;align-items:flex-end;height:7mm;margin-top:1mm;font-size:12.5pt;line-height:6mm;white-space:nowrap}
.bmi-pr-hgroup{display:inline-flex;align-items:flex-end;gap:3mm;flex:none}
.bmi-pr-hfield{display:inline-flex;align-items:flex-end;gap:1.5mm;flex:none}
.bmi-pr-hfield-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:2px solid #555}
.bmi-hfield-name{flex:1;min-width:0}
.bmi-hfield-name .bmi-pr-hfield-line{flex:1;width:auto;min-width:30mm}
.bmi-pr-solid{box-sizing:content-box;display:block;height:0;padding:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.bmi-pr-inst{flex:none;box-sizing:border-box;width:190mm;height:7mm;margin:1.5mm 0 0;padding:0 2mm;font-size:12.5pt;line-height:6mm;white-space:nowrap}
.bmi-pr-problems{flex:none;display:grid;grid-template-columns:92mm 92mm;column-gap:6mm;width:190mm;margin:1mm 0 0}
.bmi-pr-col{display:grid;grid-template-rows:repeat(5,41mm)}
.bmi-pr-cell{box-sizing:border-box;width:92mm;height:41mm;overflow:hidden;padding:0.6mm 0 0;border-top:2px solid transparent}
.bmi-pr-line{height:8mm;line-height:8mm;font-size:12.5pt;white-space:nowrap}
.bmi-pr-num{display:inline-block;font-weight:700;margin-right:0.5mm}
.bmi-pr-page[lang="en"] .bmi-pr-line{word-spacing:-0.1em}
.bmi-pr-eq{font-weight:700}
.bmi-pr-choices{display:flex;gap:3mm;height:7mm;align-items:center;font-size:12.5pt;white-space:nowrap}
.bmi-pr-choice{display:inline-block;min-width:18mm}
.bmi-pr-work{box-sizing:border-box;width:89mm;height:19mm;margin-top:0.5mm;border:2px solid #888;border-radius:1.5mm;padding:0.5mm 1.5mm}
.bmi-pr-work-label{font-size:9pt;color:#333}
.bmi-pr-answers{flex:none;box-sizing:border-box;width:190mm;margin-top:auto;padding-bottom:5mm}
.bmi-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}
.bmi-pr-answers-title{font-weight:700;font-size:12.5pt;line-height:5.5mm;height:5.5mm}
.bmi-pr-ansrow{display:grid;grid-template-columns:repeat(5,37mm);column-gap:0}
.bmi-pr-ans{height:5mm;line-height:5mm;font-size:10pt;white-space:nowrap;overflow:hidden}
.bmi-app-pdf-page .bmi-pr-page{box-shadow:none;margin:0}

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