/* ── ratio_base_difference2_5（わりあいの差からもとの量を求めよう、単元仕様書 v1.2）── */
/* 画面：問題文の下に線分図（A群）・水の表（B群）・シュートの表（C群）、答えの欄（欄・単位）、回答案内、テンキー、こたえるボタン（§5-3・§7 画面表示）。 */
.rbd-main{display:flex;flex-direction:column;align-items:center;margin:4px 0 6px;max-width:100%}
.rbd-fig-line{display:grid;grid-template-columns:auto minmax(0,200px) auto;column-gap:8px;row-gap:6px;align-items:center;font-size:1.1rem;font-weight:700;max-width:100%}
.rbd-fig-row,.rbd-pr-fig-row{display:contents}
.rbd-fig-label{text-align:left;white-space:nowrap}
.rbd-fig-bar{display:block;width:200px;max-width:100%}
.rbd-fig-value{white-space:nowrap;text-align:left;min-width:4.5em}
.rbd-bar{display:block;width:100%;height:18px;overflow:visible}
.rbd-bar rect{vector-effect:non-scaling-stroke;stroke:#1f2937;stroke-width:1.5}
.rbd-bar .rbd-bar-whole{fill:#fff}
.rbd-bar .rbd-bar-fill{fill:#cbd5e1}
.rbd-bar .rbd-bar-gap{fill:#fff;stroke:none}
.rbd-bar .rbd-bar-outline{fill:none}
.rbd-bar .rbd-bar-hatch line{stroke:#111827;stroke-width:1.2;vector-effect:non-scaling-stroke}
.rbd-fig{border-collapse:collapse;background:#fff;font-size:1.1rem;margin:0 auto}
table.rbd-fig th,table.rbd-fig td{border:2px solid #475569;padding:4px 12px;text-align:center;white-space:nowrap}
table.rbd-fig thead th{background:#f1f5f9;font-weight:800}
table.rbd-fig tbody th{background:#f8fafc;font-weight:800}
table.rbd-fig td{font-weight:700;font-variant-numeric:tabular-nums}
table.rbd-fig-shot td{text-align:left}
.rbd-fig-water-wrap{display:flex;flex-direction:column;align-items:center;max-width:100%}
.rbd-fig-moved{margin:6px 0 0;font-weight:800;font-size:1.1rem;white-space:nowrap}
.rbd-fields{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px;margin:8px auto 2px}
.rbd-field-unit{font-weight:700;font-size:1.2rem}
.rbd-input{width:6em;max-width:45vw;min-height:44px;font-size:1.4rem;padding:4px 8px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:10px;text-align:center;font-family:inherit;box-sizing:border-box}
.rbd-input:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
.rbd-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.rbd-input.rbd-input-ok{border:3px solid #15803d;background:#dcfce7}
.rbd-input.rbd-input-ng{border:3px dashed #b91c1c;background:#fff1f2}
.rbd-guide{margin:6px auto 4px;font-weight:700;text-align:center;max-width:32em}
.rbd-msg{margin:2px auto 0;color:#b91c1c;font-weight:700;font-size:1rem;text-align:center;max-width:32em}
.rbd-msg:empty{display:none}
.feedback.has-text.rbd-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.rbd-correct{margin:2px 0 6px;font-weight:700;font-size:1rem}
.rbd-expl-text{margin:4px 0 6px;overflow-wrap:anywhere;font-size:1rem}
.rbd-expl-text .rbd-nw{white-space:nowrap}
#page-quiz.active:has(.rbd-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.rbd-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.rbd-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.rbd-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0;overflow-wrap:anywhere}
/* 360 CSS px幅以下（320をふくむ）：線分図の線を短くし、表の文字と余白を小さくして、横スクロール・欠けを出さない（§7）。 */
@media (max-width:360px){
  .rbd-fig-line{grid-template-columns:auto minmax(0,120px) auto;column-gap:5px;font-size:.95rem}
  .rbd-fig-bar{width:120px}
  .rbd-fig-value{min-width:0}
  .rbd-fig{font-size:.95rem}
  table.rbd-fig th,table.rbd-fig td{padding:3px 6px}
  .rbd-fig-moved{font-size:.95rem}
}

/* 印刷：A4縦・2列・1ページ（§7。用紙の余白10mm、本文190×277mm、列92mm・列の間3mm。各問の領域は高さ38mm：
   番号と線分図または表、間2mm、答えの行6mm、余り）。 */
.rbd-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}
.rbd-pr-head{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm}
.rbd-pr-title{box-sizing:border-box;margin:0;height:9mm;font-size:14.3pt;font-weight:700;line-height:7.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}
.rbd-pr-instruction{margin:0 0 2mm;font-size:12.6pt;line-height:5.2mm}
.rbd-pr-problems{display:grid;grid-template-columns:92mm 92mm;column-gap:3mm;flex:none;margin-left:1.5mm}
.rbd-pr-col{display:grid;grid-template-rows:repeat(5,38mm)}
.rbd-pr-cell{position:relative;box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;height:38mm;padding:1mm 0 0}
/* 問と問のさかいめに点線（次の問の番号と前の問の答えの行を見分ける）。線は各問の領域の高さに数えないよう、上の端に重ねて引く。 */
.rbd-pr-cell+.rbd-pr-cell::before{content:'';position:absolute;top:0;left:0;right:0;border-top:0.3mm dotted #888}
.rbd-pr-top{display:flex;align-items:flex-start;gap:2mm}
.rbd-pr-q{margin:0;font-size:12.6pt;line-height:5mm;white-space:nowrap;font-weight:700;flex:none;min-width:9mm}
.rbd-pr-fig-line{display:grid;grid-template-columns:auto 30mm auto;column-gap:2mm;row-gap:0;align-items:center;font-size:10.2pt;line-height:4.5mm}
.rbd-pr-fig-label,.rbd-pr-fig-value{white-space:nowrap}
.rbd-pr-fig-bar{display:block;width:30mm}
.rbd-pr-fig-line .rbd-bar{height:3.2mm}
.rbd-pr-fig-line .rbd-bar rect{stroke:#000;stroke-width:1}
.rbd-pr-fig-line .rbd-bar .rbd-bar-fill{fill:#d4d4d4;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.rbd-pr-fig-line .rbd-bar .rbd-bar-hatch line{stroke:#000;stroke-width:1}
table.rbd-pr-fig{border-collapse:collapse;font-size:10.2pt;flex:none}
table.rbd-pr-fig th,table.rbd-pr-fig td{border:0.3mm solid #333;height:4.2mm;line-height:3.8mm;padding:0 1.5mm;text-align:center;white-space:nowrap;box-sizing:border-box;font-weight:400}
table.rbd-pr-fig thead th,table.rbd-pr-fig tbody th{font-weight:700}
table.rbd-pr-fig-shot td{text-align:left}
.rbd-pr-fig-water-wrap{display:flex;flex-direction:column}
.rbd-pr-fig-moved{margin:0;font-size:10.2pt;line-height:4.2mm;white-space:nowrap;font-weight:700}
.rbd-pr-blank{margin:2mm 0 0;font-size:12.6pt;line-height:6mm;height:6mm;white-space:nowrap;display:flex;align-items:center}
.rbd-pr-gap{display:inline-block;width:20mm}
.rbd-pr-answers{flex:none;box-sizing:border-box;margin-top:2mm}
.rbd-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 1mm;padding:0;border:0;border-top:2pt dashed #aaa}
.rbd-pr-answers-title{font-weight:700;font-size:12.6pt;height:6mm;line-height:6mm}
.rbd-pr-answer-grid{display:grid;grid-template-columns:repeat(5,36.4mm);column-gap:1mm}
.rbd-pr-ans{margin:0;font-size:10.2pt;line-height:4.5mm;height:4.5mm;white-space:nowrap}
.rbd-app-pdf-page .rbd-pr-page{box-shadow:none;margin:0}

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