/* ── rectangle_array_expression3_4（長方形配列の不足とあまりを式にしよう、単元仕様書 v1.3）── */
/* 画面：問題文、ブロックの図（行と列の番号・三つの状態・凡例）、4択（1行に1つ）。PC幅では図と4択を左右に並べる。回答後は外まわりの線と部分ごとの式（§5-3・§7）。 */
#question-text .rae-q{display:block}
.rae-main{--rae-cell:24px;--rae-lab:22px;margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center;gap:8px}
.rae-figbox{max-width:100%;display:flex;flex-direction:column;align-items:center;gap:6px}
.rae-figscroll{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:6px 16px 8px;box-sizing:border-box}
.rae-grid{display:grid;gap:2px;position:relative;width:max-content}
.rae-colnum,.rae-rownum{display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#334155;line-height:1}
.rae-c{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:var(--rae-cell);height:var(--rae-cell);border-radius:3px}
.rae-c-block{background:#93c5fd;border:2px solid #1e3a8a}
.rae-c-miss{background:#fff;border:2px dashed #64748b}
.rae-c-extra{background:#fed7aa;border:2px solid #9a3412}
.rae-dot{display:block;width:8px;height:8px;border-radius:50%;background:#7c2d12}
.rae-ol{pointer-events:none;box-sizing:border-box;margin:-4px;border-radius:5px;z-index:1}
.rae-ol-base{border:3px solid #dc2626}
.rae-ol-miss{margin:-1px;border:3px dashed #6d28d9}
.rae-ol-extra{margin:-1px;border:3px solid #15803d}
.rae-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 14px;font-size:14px;font-weight:700;color:#1e293b}
.rae-lg{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.rae-sw{--rae-cell:20px}
.rae-sw .rae-dot{width:7px;height:7px}
.rae-ol-tag{z-index:2;place-self:center;white-space:nowrap;padding:0 5px;border-radius:6px;background:#fff;font-size:15px;font-weight:800;line-height:20px;pointer-events:none}
.rae-tag-left{justify-self:end;margin-right:4px}
.rae-tag-right{justify-self:start;margin-left:4px}
.rae-tag-top{margin-bottom:4px}
.rae-tag-bottom{margin-top:4px}
.rae-after-base{color:#b91c1c;border:3px solid #dc2626}
.rae-after-miss{color:#5b21b6;border:3px dashed #6d28d9}
.rae-after-extra{color:#166534;border:3px solid #15803d}
.rae-side{width:min(100%,560px);display:flex;flex-direction:column}
.rae-guide{margin:4px 0 2px;font-size:15px;font-weight:700;text-align:center;line-height:1.4}
.rae-guide[hidden]{display:none}
.rae-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:100%;margin:2px auto}
.rae-choice{position:relative;box-sizing:border-box;min-height:48px;padding:6px 10px 6px 28px;border:3px solid #64748b;border-radius:10px;background:#fff;color:#1e293b;font-size:1.08rem;font-weight:800;text-align:left;cursor:pointer;line-height:1.35;overflow-wrap:anywhere}
.rae-check{position:absolute;top:50%;left:7px;transform:translateY(-50%);font-size:18px;font-weight:900;color:#1d4ed8}
.rae-choice.rae-on{background:#dbeafe;border-color:#1d4ed8;color:#1e3a8a}
.rae-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.rae-choice:disabled{cursor:default;opacity:1}
.rae-choice.rae-ok,.rae-choice.rae-ok:disabled{border:3px solid #15803d;background:#dcfce7;color:#14532d}
.rae-choice.rae-ng,.rae-choice.rae-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2;color:#7f1d1d}
.rae-choice.rae-right,.rae-choice.rae-right:disabled{border:3px solid #15803d;background:#f0fdf4;color:#14532d}
.rae-ok .rae-check,.rae-right .rae-check{color:#15803d}
.rae-ng .rae-check{color:#b91c1c}
.rae-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.rae-msg:empty{min-height:0;margin:0}
.feedback.has-text.rae-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.rae-correct{margin:2px 0 6px;font-weight:800;font-size:17px;overflow-wrap:anywhere}
.rae-expl-text{margin:4px 0 6px;word-break:normal;overflow-wrap:anywhere;line-break:strict}
.rae-score{margin:6px 0 2px;font-weight:800;color:#1e3a8a}
/* スマホ幅では図が横にスクロールすることがあるので、回答後の式は帯の左はしからならべ、見える範囲に置く（独立検査 RAE-IR3-01） */
@media (max-width:759px){.rae-grid .rae-ol-tag{grid-column:1/-1!important;justify-self:start!important}}
@media (min-width:760px){
  .rae-main{--rae-cell:26px;flex-direction:row;align-items:flex-start;justify-content:center;gap:18px}
  .rae-figbox{flex:0 0 auto}
  .rae-side{flex:1 1 240px;min-width:240px;max-width:440px;padding-top:24px}
}
@media (max-width:360px){.rae-choice{font-size:.98rem;padding-left:26px}}
.rae-example .rae-ex-q{font-weight:700;margin:6px 0 2px;overflow-wrap:anywhere}
.rae-example .rae-ex-a{margin:2px 0 8px;overflow-wrap:anywhere}
#page-quiz.active:has(.rae-main) #question-text{word-break:normal;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.rae-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.rae-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.rae-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.rae-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}

/* 印刷：A4縦・2列・1ページ（§7）。題名の枠と記入欄、共通の案内、2列×5問（左に図〔列の数・行の数つき、ます目2.0mm〕、右に番号と4択10pt）、破線、答え2行。 */
.rae-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','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif}
.rae-pr-headrow{display:flex;flex-direction:column;gap:0;flex:none}
.rae-pr-headrow .pp-fields{height:7mm;margin:1mm 0 0}
.rae-pr-headrow .pp-field-line{height:6mm}
.rae-pr-headrow hr.pp-fields-solid{margin:1mm 0 0!important;border:0;border-top:1.5pt solid #333}
.rae-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}
.rae-pr-inst{flex:none;box-sizing:border-box;width:186mm;margin:2mm 0 0;font-size:12.5pt;line-height:5.5mm}
.rae-pr-problems{flex:none;display:grid;grid-template-columns:91mm 91mm;column-gap:4mm;margin:2mm 0 0}
.rae-pr-col{display:flex;flex-direction:column}
.rae-pr-cell{box-sizing:border-box;display:grid;grid-template-columns:33mm 56mm;column-gap:2mm;align-items:center;height:41mm;padding:0;border-top:2px solid transparent}
.rae-pr-col .rae-pr-cell:last-child{border-bottom:2px solid transparent}
.rae-pr-fig{display:flex;align-items:center;justify-content:center;width:33mm;height:36mm}
.rae-pr-figin{display:grid;grid-template-columns:5mm auto;grid-template-rows:4mm auto;align-items:center}
.rae-pr-cols{height:4mm;line-height:4mm;font-size:9pt;font-weight:700;text-align:center}
.rae-pr-rows{width:5mm;font-size:9pt;font-weight:700;text-align:center}
.rae-pr-grid{margin:0 auto}
.rae-pr-grid{--rae-cell:2mm;gap:0;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.rae-pr-grid .rae-c{border-radius:0}
.rae-pr-grid .rae-c-block{background:#cbd5e1;border:1px solid #000}
.rae-pr-grid .rae-c-miss{background:#fff;border:1px dashed #000}
.rae-pr-grid .rae-c-extra{background:#fff;border:1px solid #000}
.rae-pr-grid .rae-dot{width:0.9mm;height:0.9mm;background:#000}
.rae-pr-body{min-width:0;display:flex;flex-direction:column;justify-content:center}
.rae-pr-num{font-size:12.5pt;font-weight:700;line-height:5.5mm}
.rae-pr-choice{font-size:10pt;line-height:4.5mm;white-space:nowrap}
.rae-pr-answers{flex:none;box-sizing:border-box;width:190mm;margin-top:auto;padding-bottom:5mm}
.rae-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 0.8mm;padding:0;border:0;border-top:2pt dashed #aaa}
.rae-pr-anshead{font-weight:700;font-size:12.5pt;line-height:6mm}
.rae-pr-ansgrid{display:grid;grid-template-columns:repeat(5,35.6mm);column-gap:3mm;font-size:10pt;line-height:4.5mm;white-space:nowrap}
.rae-app-pdf-page .rae-pr-page{box-shadow:none;margin:0}

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