/* ── forward_backward_relative2_5（二人の進む・もどるから位置の差を求めよう、単元仕様書 v1.2）── */
/* 画面：問題文、はじめの位置と動きの表（表の説明の文はARIA名）、おわりの差の行、答えの欄（B群は回を欄の外）と共通のテンキー（A群・B群）又はア〜エ（C群）、案内。回答後は正しい答えと解説（§5-3・§7）。 */
#question-text .fbr-q{display:block;overflow-wrap:anywhere}
.fbr-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center;gap:6px}
.fbr-field{display:inline-flex;align-items:center;gap:8px;font-weight:800;font-size:1.2rem}
.fbr-input{width:6em;min-height:48px;font-size:1.4rem;padding:0 6px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:8px;text-align:center;font-family:inherit;font-weight:800;box-sizing:border-box}
.fbr-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.fbr-input.fbr-ok,.fbr-input.fbr-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.fbr-input.fbr-ng,.fbr-input.fbr-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.fbr-choices{display:flex;flex-direction:column;gap:8px;width:min(100%,480px);margin:2px auto}
.fbr-choice{position:relative;box-sizing:border-box;min-height:48px;padding:6px 10px 6px 34px;border:3px solid #64748b;border-radius:10px;background:#fff;color:#1e293b;font-size:1.05rem;font-weight:800;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.fbr-check{position:absolute;top:50%;left:10px;transform:translateY(-50%);font-size:18px;font-weight:900;color:#1d4ed8}
.fbr-choice.fbr-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.fbr-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.fbr-choice:disabled{cursor:default;opacity:1}
.fbr-choice.fbr-ok,.fbr-choice.fbr-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.fbr-choice.fbr-ng,.fbr-choice.fbr-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.fbr-choice.fbr-right,.fbr-choice.fbr-right:disabled{border:3px dashed #15803d;background:#fff;color:#14532d}
.fbr-ok .fbr-check,.fbr-right .fbr-check{color:#15803d}
.fbr-ng .fbr-check{color:#b91c1c}
.fbr-guide{margin:2px 0 0;font-size:16px;font-weight:700;text-align:center}
.fbr-guide[hidden]{display:none}
.fbr-msg{min-height:1.4em;margin:2px 0;color:#b45309;font-weight:700;text-align:center;line-height:1.4;max-width:560px}
.fbr-msg:empty{min-height:0;margin:0}
.fbr-main .ufk-keypad{margin-top:4px}
.feedback.has-text.fbr-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.fbr-correct{margin:2px 0 6px;font-weight:800;font-size:17px;overflow-wrap:anywhere}
.fbr-expl-text{margin:4px 0 6px;overflow-wrap:anywhere;word-break:normal;line-break:strict}
.fbr-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}
.fbr-example .fbr-ex-q{margin:6px 0 2px;font-weight:700}
.fbr-example .fbr-ex-a{margin:0 0 8px}
#page-quiz.active:has(.fbr-main) #question-text{word-break:normal;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.fbr-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.fbr-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.fbr-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.fbr-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
#page-quiz.active:has(.fbr-main) #tts-btn{min-width:44px;min-height:44px}
#page-quiz:has(#question-text[data-unit="forward_backward_relative2_5"]) .ufk-keypad{max-width:240px;width:100%}
#page-quiz:has(#question-text[data-unit="forward_backward_relative2_5"]) .ufk-keypad .num-btn{font-family:var(--font-ui)}

.fbr-tablewrap{max-width:100%;overflow:visible}
.fbr-table{border-collapse:collapse;font-size:16px;background:#fff;margin:0 auto}
.fbr-table th,.fbr-table td{border:1.5px solid #64748b;padding:4px 5px;text-align:center;white-space:nowrap;min-width:2.2em}
@media (max-width:420px){.fbr-table{font-size:14px}.fbr-table th,.fbr-table td{padding:3px 3px}.fbr-table thead th{max-width:5.2em}}
.fbr-table thead th{white-space:normal;max-width:6.5em;line-height:1.3}
.fbr-table thead th{background:#f1f5f9;font-weight:800}
.fbr-table tbody th{background:#f8fafc;font-weight:800;text-align:left}
.fbr-gap{margin:0;font-size:15px;font-weight:700;color:#1e293b;text-align:center;overflow-wrap:anywhere}
.fbr-nb{white-space:nowrap}
.fbr-unit{font-weight:800;font-size:1.15rem;white-space:nowrap}
.fbr-ctext{display:inline}
.fbr-expl-text{line-height:1.8;overflow-wrap:anywhere}
/* 印刷：A4縦・2列・1ページ（§7）。題名の枠と記入欄、共通の問い、2列×5段（番号と表（はじめ・おもて・うら）、短い問題文、A群・B群は答えの行、C群は4択を1行に2つ）、破線、答え（2行）。 */
.fbr-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}
.fbr-pr-headrow{display:flex;flex-direction:column;gap:0;flex:none}
.fbr-pr-headrow .pp-fields{height:7mm;margin:1mm 0 0}
.fbr-pr-headrow .pp-field-line{height:6mm}
.fbr-pr-headrow hr.pp-fields-solid{margin:1mm 0 2mm!important;border:0;border-top:1.5pt solid #333}
.fbr-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}
.fbr-pr-problems{flex:none;display:grid;grid-template-columns:92mm 92mm;column-gap:3mm}
.fbr-pr-col{display:flex;flex-direction:column}
.fbr-pr-cell{box-sizing:border-box;height:42mm;border-top:2px solid transparent;padding:0.5mm 0 0;overflow:hidden;display:flex;flex-direction:column;gap:0.5mm}
.fbr-pr-col .fbr-pr-cell:last-child{border-bottom:2px solid transparent}
.fbr-pr-q{font-size:12.5pt;line-height:5mm;overflow-wrap:anywhere;padding-right:3mm}
.fbr-pr-inst{margin:0 0 2mm;font-size:12.5pt;line-height:5mm;flex:none}
.fbr-pr-chead{display:flex;align-items:flex-start;gap:2mm;font-size:12.5pt}
.fbr-pr-table{border-collapse:collapse;font-size:10pt;line-height:3.9mm}
.fbr-pr-table th,.fbr-pr-table td{border:1px solid #444;padding:0 1.2mm;text-align:center;white-space:nowrap}
.fbr-pr-blank{font-size:12.5pt;line-height:6mm;white-space:pre}
.fbr-pr-choices{display:grid;grid-template-columns:44.5mm 44.5mm;font-size:12.5pt;line-height:5mm}
.fbr-pr-choices>div{white-space:nowrap}
.fbr-pr-num{font-weight:700;white-space:nowrap}
.fbr-pr-answers{flex:none;box-sizing:border-box;width:190mm;margin-top:auto;padding-bottom:5mm}
.fbr-pr-dashed{box-sizing:content-box;display:block;height:0;margin:1.5mm 0 1mm;padding:0;border:0;border-top:2pt dashed #aaa}
.fbr-pr-anshead{font-weight:700;font-size:12.5pt;line-height:6mm;white-space:nowrap}
.fbr-pr-ansrow{display:grid;grid-template-columns:repeat(5,36mm);column-gap:1mm}
.fbr-pr-answer{font-size:10pt;line-height:4.5mm;white-space:nowrap}
.fbr-app-pdf-page .fbr-pr-page{box-shadow:none;margin:0}

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


/* 印刷の答えの（　）の内側は20mm（§7） */
.fbr-pr-gap{display:inline-block;width:20mm;white-space:pre;overflow:hidden;vertical-align:bottom}
.fbr-choice .fbr-ctext{overflow-wrap:normal}
@media (max-width:420px){.fbr-table td{white-space:normal}}
@media (max-width:340px){.fbr-table thead th{white-space:nowrap;max-width:none}.fbr-table th,.fbr-table td{padding:3px 2px}}
