/* ── square_tile_factor_pairs3_3（正方形タイルで正方形と長方形を作ろう、単元仕様書 v1.5）── */
/* 画面：問題文、タイルの図（1行に10まいずつ）、回答欄（数の欄と単位／4つの一覧の選択）、案内、共通のテンキー。回答後は正誤・正しい答え・考え方・回答後の図（§5-3・§7） */
#question-text .stf-q{display:block;overflow-wrap:normal}
.stf-nb{white-space:nowrap}
.stf-phrase-group{display:inline;min-width:0}
.stf-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center;gap:8px}
.stf-input{width:5.6em;min-height:48px;font-size:1.35rem;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}
.stf-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.stf-input.stf-ok,.stf-input.stf-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.stf-input.stf-ng,.stf-input.stf-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.stf-guide{margin:2px 0 0;font-size:16px;font-weight:700;text-align:center;max-width:560px;line-height:1.7}
.stf-guide[hidden]{display:none}
.stf-msg{min-height:1.4em;margin:2px 0;color:#b45309;font-weight:700;text-align:center;line-height:1.6;max-width:560px}
.stf-msg:empty{min-height:0;margin:0}
.stf-msg-line{display:block}
.stf-main .ufk-keypad{margin-top:4px}
.feedback.has-text.stf-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.stf-correct{margin:4px 0 6px;font-weight:800;font-size:17px;line-height:1.9}
.stf-expl-text{margin:4px 0 8px;line-height:2;overflow-wrap:normal;word-break:normal;line-break:strict}
.stf-example .stf-ex-q{margin:6px 0 4px;font-weight:700;line-height:2}
.stf-example .stf-ex-a{margin:4px 0 14px;line-height:2}
.stf-learning-focus{word-break:normal;line-break:strict}
#page-quiz.active:has(.stf-main) #question-text{word-break:normal;overflow-wrap:normal;line-break:strict;font-size:17px;line-height:2}
#page-quiz.active:has(.stf-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.stf-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.stf-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.stf-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
#page-quiz:has(#question-text[data-unit="square_tile_factor_pairs3_3"]) .ufk-keypad{max-width:240px;width:100%}
#page-quiz:has(#question-text[data-unit="square_tile_factor_pairs3_3"]) .ufk-keypad .num-btn{font-family:var(--font-ui)}
/* 結果画面の単元名：狭い幅でも省略せず、文節で折り返す */
.result-unit-badge.stf-badge{max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;height:auto;border-radius:14px;line-height:1.5}
.result-unit-badge.stf-badge .rub-name{white-space:normal;overflow:visible;text-overflow:clip}
@media (max-width:400px){
  #page-lesson:has(.stf-example) .lesson-point,#page-lesson:has(.stf-example) .lesson-point *{font-size:15px}
  #page-lesson:has(.stf-example) .lesson-point{padding-left:10px;padding-right:10px;gap:6px}
  #page-lesson:has(.stf-example) .lesson-point .pt-icon{display:none}
  #page-lesson .lesson-example:has(.stf-example){padding-left:8px;padding-right:8px}
  #page-lesson .lesson-example div:has(>.stf-example){padding-left:6px!important;padding-right:6px!important}
  .stf-example .stf-ex-q,.stf-example .stf-ex-a{font-size:14px}
  .stf-guide,.stf-msg{font-size:15px}
}
@media (max-width:340px){
  .stf-example .stf-ex-q,.stf-example .stf-ex-a{font-size:13px}
  #page-lesson:has(.stf-example) :is(h1,h2,h3):has(.stf-phrase){font-size:22px!important}
}
/* タイルの図（SVG。線・色は SVG の属性で書く）。回答前の図は1まい22px（せまい画面でも20px以上） */
.stf-fig-wrap{display:flex;flex-direction:column;align-items:center;gap:2px;max-width:100%}
.stf-fig{display:block;line-height:0;max-width:100%}
.stf-tiles{display:block;max-width:100%;height:auto}
.stf-fig-cap{margin:0;font-size:16px;font-weight:800;color:#111827;line-height:1.5}
/* 答えの欄：数の欄の右に、単位を離さずに置く */
.stf-fields{display:flex;justify-content:center;align-items:center;max-width:100%}
.stf-field{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.stf-funit{font-size:1.25rem;font-weight:800;color:#111827}
/* 一覧の選択：たてに4つ。丸つき数字と、行×列の組（組の切れ目でだけ折り返す） */
.stf-choices{display:flex;flex-direction:column;gap:8px;width:100%;max-width:440px}
.stf-choice{position:relative;box-sizing:border-box;width:100%;min-height:52px;padding:8px 34px 8px 10px;border:2px solid #64748b;border-radius:12px;background:#fff;color:#111827;font-family:inherit;font-size:1.1rem;font-weight:800;cursor:pointer;text-align:left;line-height:1.7}
.stf-choice .stf-ctext{display:flex;align-items:flex-start;overflow-wrap:normal;word-break:normal}
.stf-ctext .stf-cm,.stf-list-choice .stf-cm{flex:none}
.stf-ctext .stf-clist{flex:1 1 0;min-width:0}
.stf-ctext .stf-cm-en{margin-right:.35em}
.stf-choice .stf-check{position:absolute;top:50%;right:10px;transform:translateY(-50%);font-size:16px;line-height:1;color:#1d4ed8;visibility:hidden}
.stf-choice.stf-sel{border:4px solid #1d4ed8;background:#dbeafe;padding:6px 32px 6px 8px}
.stf-choice.stf-sel .stf-check{visibility:visible}
.stf-choice:disabled{cursor:default;opacity:1;color:#111827}
.stf-choice.stf-hit{border:4px solid #15803d;background:#dcfce7;padding:6px 32px 6px 8px}
.stf-choice.stf-hit .stf-check{visibility:visible;color:#15803d;font-weight:900}
.stf-choice.stf-miss{border:4px dashed #b91c1c;background:#fff1f2;padding:6px 32px 6px 8px}
.stf-choice.stf-miss .stf-check{visibility:visible;color:#b91c1c;font-weight:900}
.stf-list-choice{display:inline}
/* 回答後の図：行と列のことばは図の外の文字（図をちぢめても文字の大きさはかわらない） */
.stf-post{display:flex;flex-wrap:wrap;gap:12px 18px;align-items:flex-start;margin:8px 0 4px;max-width:100%}
.stf-post-bc{flex-direction:column;gap:10px}
.stf-post-part{display:flex;flex-direction:column;align-items:flex-start;gap:3px;max-width:100%}
.stf-shape{display:flex;flex-direction:column;align-items:flex-start;gap:2px;max-width:100%}
.stf-shape-row{display:flex;align-items:center;gap:6px;max-width:100%}
.stf-shape-row .stf-tiles,.stf-post-part .stf-tiles{flex:0 1 auto;min-width:0}
.stf-lab{font-size:14px;font-weight:800;color:#111827;line-height:1.4;white-space:nowrap}
.stf-lab-row{flex:none;min-width:3.2em;text-align:right}
.stf-lab-col{margin-left:calc(3.2em + 6px)}
@media (max-width:400px){
  .stf-choice{font-size:1rem;padding:8px 30px 8px 8px}
  .stf-choice.stf-sel,.stf-choice.stf-hit,.stf-choice.stf-miss{padding:6px 28px 6px 6px}
  .stf-funit{font-size:1.1rem}
}

/* 印刷（プリント共通仕様書のひな型P・P-標準：A4縦・2列×5行・1ページ。§7・確定表 STK-11） */
.stf-pr-page{width:190mm;height:276mm;box-sizing:border-box;color:#000;background:#fff;font-family:'Atkinson Hyperlegible','BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif;display:flex;flex-direction:column;overflow:hidden}
.stf-pr-headrow{flex:none;display:flex;flex-direction:column;gap:0}
.stf-pr-title{box-sizing:border-box;width:100%;height:9mm;margin:0;padding:0 2mm;border:1.5pt solid #666;background:#ffffcc;font-size:13pt;line-height:calc(9mm - 3pt);text-align:center;font-weight:700;white-space:nowrap;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.stf-pr-headrow .pp-fields{margin:1mm 0 0}
.stf-pr-headrow .pp-field-name .pp-field-line{min-width:40mm}
.stf-pr-headrow hr.pp-fields-solid{flex:none;width:100%;margin:1.5mm 0 1.5mm!important}
.stf-pr-inst{flex:none;font-size:12.5pt;line-height:5.6mm;margin:0 0 1.2mm;padding:0 1mm;overflow-wrap:normal;word-break:normal}
.stf-pr-problems{flex:1 1 0;min-height:0;display:flex;gap:4mm;justify-content:center}
.stf-pr-col{width:93mm;display:flex;flex-direction:column;gap:2mm;min-height:0}
.stf-pr-cell{box-sizing:border-box;width:93mm;flex:1 1 0;min-height:0;padding:0 0.5mm;overflow:hidden;break-inside:avoid;display:flex;flex-direction:column}
.stf-pr-line{flex:none;display:flex;align-items:center;height:9mm;font-size:12.5pt;font-weight:400;line-height:9mm;white-space:nowrap}
.stf-pr-cell-c .stf-pr-line{height:6mm;line-height:6mm}
.stf-pr-no{flex:none;margin-right:1.5mm;font-weight:700}
.stf-pr-lead{flex:none;font-size:12.5pt;margin-right:1mm;white-space:pre}
.stf-pr-paren{font-size:14pt;font-weight:400}
.stf-pr-blank{flex:none;display:inline-block;width:15.4mm;height:8.4mm}
.stf-pr-paren+.stf-pr-lead{margin-left:0.5mm}
.stf-pr-work{flex:1 1 0;min-height:0}
.stf-pr-choice{flex:none;display:flex;align-items:flex-start;margin:0;font-size:12.5pt;line-height:5.5mm;font-weight:400}
.stf-pr-circle{flex:none;box-sizing:border-box;width:4.2mm;height:4.2mm;margin:0.65mm 1.2mm 0 0.5mm;border:2px solid #000;border-radius:50%}
.stf-pr-cm{flex:none;margin-right:1.6mm;font-weight:700}
.stf-pr-list{flex:1 1 0;min-width:0;overflow-wrap:normal;word-break:normal}
.stf-pr-list .stf-pair{margin-right:0.4mm}
.stf-pr-answers{flex:none;margin-top:3mm}
.stf-pr-fold{width:100%;height:0;border-top:2px dotted #333;margin:0 0 1.5mm}
.stf-pr-anshead{font-size:12.5pt;font-weight:700;line-height:6mm}
.stf-pr-acols{display:flex;gap:4mm}
.stf-pr-acol{width:93mm}
.stf-pr-answer{margin:0 0 0.5mm;font-size:10pt;line-height:4.4mm;white-space:nowrap}
#pr-sheet[data-unit="square_tile_factor_pairs3_3"]{width:190mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="square_tile_factor_pairs3_3"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="square_tile_factor_pairs3_3"]>#pr-problems{display:block}
#pr-sheet[data-unit="square_tile_factor_pairs3_3"] .stf-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="square_tile_factor_pairs3_3"]{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="square_tile_factor_pairs3_3"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="square_tile_factor_pairs3_3"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="square_tile_factor_pairs3_3"] .stf-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
.stf-app-pdf-page .stf-pr-page{box-shadow:none;margin:0}
