/* ── rank_total_from_both_ends2_1（まえとうしろの じゅんから ぜんいんを もとめよう、単元仕様書 v1.4）── */
/* 画面：問題文の下に、一列の人型の図、答えの欄とテンキー（§5-3・§7 画面表示）。 */
.rtb-main{display:flex;flex-direction:column;align-items:center;margin:4px 0 6px;max-width:100%}
.rtb-fig{width:100%;max-width:440px;box-sizing:border-box;display:flex;justify-content:center}
.rtb-svg{display:block;height:auto;overflow:visible}
.rtb-end-label{font-size:13px;font-weight:700;fill:#1f2937}
.rtb-arrow{stroke:#64748b;stroke-width:2}
.rtb-arrow-head{fill:#64748b}
.rtb-head,.rtb-body{fill:#fff;stroke:#1f2937;stroke-width:1.4}
.rtb-marked .rtb-head,.rtb-marked .rtb-body{fill:#f59e0b;stroke:#92400e;stroke-width:1.8}
.rtb-mark-ring{fill:none;stroke:none}
/* ヒント段階1：二つの順位（矢印と まえ・うしろ）を強める。段階2：しるしの人を重ねて強める（§6）。 */
.rtb-hint-ranks .rtb-arrow{stroke:#b91c1c;stroke-width:3}
.rtb-hint-ranks .rtb-arrow-head{fill:#b91c1c}
.rtb-hint-ranks .rtb-end-label{fill:#b91c1c}
.rtb-hint-marked .rtb-mark-ring{stroke:#b91c1c;stroke-width:2.2;stroke-dasharray:4 2}
.rtb-hint-frame{margin:4px 0 0;font-size:1.25rem;font-weight:700;text-align:center;letter-spacing:.08em}
.rtb-box{display:inline-block;width:1em;height:1em;border:3px solid currentColor;border-radius:3px;vertical-align:-.15em;margin:0 3px}
.rtb-example-title{margin:0 0 4px;font-weight:700}
.rtb-example-answer{margin:6px 0 0;font-weight:700}
.rtb-fields{display:flex;justify-content:center;align-items:center;gap:8px;margin:6px auto 2px;flex-wrap:wrap}
.rtb-input-label{font-weight:700;font-size:1.05rem}
.rtb-input{width:4em;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}
.rtb-input:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
.rtb-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.rtb-input.rtb-input-ok{border:3px solid #15803d;background:#dcfce7}
.rtb-input.rtb-input-ng{border:3px dashed #b91c1c;background:#fff1f2}
.rtb-unit{font-weight:700;font-size:1.05rem}
.feedback.has-text.rtb-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.feedback.has-text.rtb-error{color:#b45309}
.rtb-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
#page-quiz.active:has(.rtb-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.rtb-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.rtb-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.rtb-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
.lesson-card .rtb-fig{margin:4px 0}

/* 印刷：A4縦・1ページ（§7。用紙の余白 上下5mm・左右8mm、本文194×287mm、1列10行）。 */
.rtb-pr-page{width:194mm;height:287mm;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}
.rtb-pr-head{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:194mm;height:17mm}
.rtb-pr-title{box-sizing:border-box;margin:0;height:8.5mm;font-size:15pt;font-weight:700;line-height:7.5mm;text-align:center;white-space:nowrap;padding:0;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.rtb-pr-fields{display:flex;gap:8mm;align-items:flex-end;height:6.5mm;margin-top:0.5mm;font-size:12pt;line-height:6mm;white-space:nowrap}
.rtb-pr-group{display:inline-flex;align-items:flex-end;gap:3mm;flex:none}
.rtb-pr-field{display:inline-flex;align-items:flex-end;gap:1.5mm;flex:none}
.rtb-pr-field-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:1pt solid #555}
.rtb-field-name{flex:1;min-width:0}
.rtb-field-name .rtb-pr-field-line{flex:1;width:auto;min-width:40mm}
.rtb-pr-solid{box-sizing:content-box;display:block;height:0;padding:0;border:0;border-top:1.5pt solid #333;margin:0.8mm 0 0}
.rtb-pr-common{flex:none;margin:0;height:7.5mm;line-height:7.5mm;font-size:13pt;font-weight:700}
.rtb-pr-problems{display:flex;flex-direction:column;flex:none;margin-top:1.5mm}
.rtb-pr-row{box-sizing:border-box;display:flex;height:23.4mm;padding-bottom:2.4mm;overflow:hidden}
.rtb-pr-no{flex:none;width:10mm;font-size:13pt;font-weight:700;line-height:6.5mm}
.rtb-pr-body-col{flex:1;min-width:0;display:flex;flex-direction:column}
.rtb-pr-q{margin:0;height:6.5mm;font-size:13pt;line-height:6.5mm;white-space:nowrap;overflow:hidden}
.rtb-pr-band{display:flex;align-items:flex-end;gap:3mm;height:14.5mm;flex:none}
.rtb-pr-svg{display:block;flex:none;width:129mm;height:14.5mm;overflow:visible}
.rtb-pr-end{font-size:3.53px;font-weight:700;fill:#000;font-family:inherit}
.rtb-pr-phead,.rtb-pr-pbody{fill:#fff;stroke:#000;stroke-width:0.3}
.rtb-pr-marked .rtb-pr-phead,.rtb-pr-marked .rtb-pr-pbody{fill:#555;stroke:#000;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.rtb-pr-ring{fill:none;stroke:none}
.rtb-pr-arrow{stroke:#000;stroke-width:0.3}
.rtb-pr-arrow-head{fill:#000}
.rtb-pr-answer{flex:none;width:52mm;display:flex;align-items:center;justify-content:flex-end;gap:1.2mm;height:12mm;font-size:13pt;white-space:nowrap}
.rtb-pr-box{display:inline-block;box-sizing:border-box;width:18mm;height:11mm;border:1pt solid #333;flex:none}
.rtb-pr-answers{flex:none;box-sizing:border-box;margin-top:0.5mm}
.rtb-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 0.5mm;padding:0;border:0;border-top:2pt dashed #aaa}
.rtb-pr-answers-title{font-weight:700;font-size:13pt;height:6mm;line-height:6mm}
.rtb-pr-ans-row{display:grid;grid-template-columns:repeat(5,38.8mm);height:7mm}
.rtb-pr-ans{margin:0;font-size:13pt;line-height:7mm;white-space:nowrap}
.rtb-app-pdf-page .rtb-pr-page{box-shadow:none;margin:0}

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