/* ── square_border_inner_inverse3_4（正方形の内外こ数から一辺を求めよう、単元仕様書 v1.3）── */
/* 画面：問題文、図の決まり、マスの図と見分け方の説明、図の代替文、答えの欄（B群は内側・外わくの2欄）、共通のテンキー（§5-3・§7 画面表示）。 */
#question-text .sbi-q{display:block}
#question-text .sbi-def{display:block;font-size:.8em;font-weight:600;line-height:1.5;margin:6px 0 0;padding:6px 8px;background:#f1f5f9;border-left:4px solid #64748b;border-radius:4px;text-align:left}
.sbi-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.sbi-figure{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 14px;margin:2px auto 2px}
.sbi-figbox{width:min(220px,62vw);aspect-ratio:1/1;flex:none}
.sbi-figbox .sbi-svg{display:block;width:100%;height:100%}
.sbi-svg .sbi-hint-inner,.sbi-svg .sbi-hint-border{display:none;vector-effect:non-scaling-stroke}
.sbi-figure:not([data-sbi-stage="0"]) .sbi-hint-inner{display:inline;stroke:#1d4ed8;stroke-width:4px}
.sbi-figure:not([data-sbi-stage="0"]) .sbi-hint-border{display:inline;stroke:#c2410c;stroke-width:4px;stroke-dasharray:9 6}
.sbi-legend{display:flex;flex-direction:column;gap:6px;font-size:15px;font-weight:700}
.sbi-legend-item{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.sbi-swatch{width:22px;height:22px;flex:none}
.sbi-fig-note{margin:4px 0 0;font-size:14px;font-weight:700;color:#334155;text-align:center}
.sbi-fig-aria{margin:4px 0 2px;font-size:13px;color:#475569;text-align:center;line-height:1.45;max-width:520px}
.sbi-row-input{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 18px;margin-top:6px;max-width:100%}
.sbi-field{display:grid;grid-template-columns:auto auto;align-items:center;column-gap:6px}
.sbi-label{font-size:1.05rem;font-weight:800;min-width:3.6em;text-align:right}
.sbi-input{width:4.6em;min-height:44px;font-size:1.3rem;padding:2px 6px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:8px;text-align:center;font-family:inherit;box-sizing:border-box}
.sbi-input.ufk-input-active{box-shadow:0 0 0 3px #f59e0b}
.sbi-input:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.sbi-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
/* 採点後：正しいときは緑の実線、まちがえたときは赤の点線の太い枠（色だけにせず線の形でも区別する）。 */
.sbi-input.sbi-ok,.sbi-input.sbi-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.sbi-input.sbi-ng,.sbi-input.sbi-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.sbi-fmsg{grid-column:1/-1;margin:2px 0 0;max-width:15em;color:#b45309;font-size:14px;font-weight:700;text-align:center;line-height:1.35}
.sbi-fmsg:empty{display:none}
.sbi-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.sbi-msg:empty{min-height:0;margin:0}
.sbi-main .ufk-keypad{margin-top:6px}
/* スマホ幅でも B群の2欄を左に内側・右に外わくと横にならべる（v1.3 CF-16。独立検査 SBI-IR1-02）。 */
@media (max-width:480px){.sbi-row-input{flex-wrap:nowrap;gap:4px 8px}.sbi-main[data-sbi-group="B"] .sbi-label{min-width:0;font-size:1rem}.sbi-main[data-sbi-group="B"] .sbi-input{width:3.4em}.sbi-main[data-sbi-group="B"] .sbi-field{column-gap:4px}.sbi-fmsg{max-width:9em}}

.feedback.has-text.sbi-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.sbi-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.sbi-example-q{font-weight:700;margin:2px 0 6px}
.sbi-example-fig{width:min(200px,60vw);margin:4px auto}
.sbi-example-fig .sbi-svg{display:block;width:100%;height:auto}
.sbi-example-answer{margin:2px 0 6px;word-break:normal;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.sbi-main) #question-text{word-break:normal;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.sbi-main) #hint-area .kp-body,#page-quiz.active:has(.sbi-main) #feedback,.sbi-expl-text,.sbi-msg,.sbi-fmsg,.sbi-fig-aria{word-break:normal;overflow-wrap:break-word;line-break:strict}
#page-quiz.active:has(.sbi-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.sbi-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.sbi-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.sbi-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}

/* 印刷：A4縦・1ページ（§7。用紙の余白10mm、本文190×277mm。題名の枠と記入欄、共通の案内、2列×5段で1問92×41.4mm、破線、答え2列×5行）。 */
.sbi-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}
.sbi-pr-headblock{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:19.5mm}
.sbi-pr-title{box-sizing:border-box;margin:0;height:9mm;font-size:15pt;font-weight:700;line-height: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}
.sbi-pr-page[lang="en"] .sbi-pr-title{font-size:14pt}
.sbi-pr-hfields{display:flex;gap:5mm;align-items:flex-end;height:7mm;margin-top:1mm;font-size:12.5pt;line-height:6mm;white-space:nowrap}
.sbi-pr-hgroup{display:inline-flex;align-items:flex-end;gap:3mm;flex:none}
.sbi-pr-hfield{display:inline-flex;align-items:flex-end;gap:1.5mm;flex:none}
.sbi-pr-hfield-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:2px solid #555}
.sbi-hfield-name{flex:1;min-width:0}
.sbi-hfield-name .sbi-pr-hfield-line{flex:1;width:auto;min-width:30mm}
.sbi-pr-solid{box-sizing:content-box;display:block;height:0;padding:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.sbi-pr-rule{flex:none;box-sizing:border-box;width:190mm;height:10.6mm;margin:1.2mm 0 0;padding:0 2mm;font-size:12.5pt;line-height:5.3mm;overflow:hidden;word-break:normal;overflow-wrap:anywhere;line-break:strict}
.sbi-pr-problems{flex:none;display:grid;grid-template-columns:92mm 92mm;column-gap:6mm;width:190mm;height:207mm;margin:0.6mm 0 0}
.sbi-pr-col{display:grid;grid-template-rows:repeat(5,41.4mm)}
.sbi-pr-cell{box-sizing:border-box;width:92mm;height:41.4mm;display:flex;gap:3mm;overflow:hidden;padding:0;border-top:0.3mm solid transparent}
.sbi-pr-left{flex:none;width:28mm;display:flex;flex-direction:column;gap:1mm}
.sbi-pr-fig{width:28mm;height:28mm}
.sbi-pr-fig .sbi-svg{display:block;width:28mm;height:28mm}
.sbi-pr-fig .sbi-hint-inner,.sbi-pr-fig .sbi-hint-border{display:none}
.sbi-pr-right{flex:1;min-width:0;display:flex;flex-direction:column;gap:1mm;padding-right:4mm}
.sbi-pr-q{margin:0;font-size:12.5pt;line-height:5.3mm;max-height:26.5mm;overflow:hidden;word-break:normal;overflow-wrap:anywhere;line-break:strict}
.sbi-pr-num{font-weight:700}
.sbi-pr-ansrow{display:flex;align-items:center;gap:3mm;height:7mm;flex:none}
.sbi-pr-field{display:inline-flex;align-items:center;gap:1mm;flex:none}
.sbi-pr-anslabel{font-size:9pt;line-height:7mm;flex:none}
.sbi-pr-ansbox{display:inline-block;box-sizing:border-box;width:12mm;height:7mm;border:0.4mm solid #333}
.sbi-pr-answers{flex:none;box-sizing:border-box;width:190mm;height:31mm}
.sbi-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0.8mm 0 0.6mm;padding:0;border:0;border-top:2pt dashed #aaa}
.sbi-pr-answers-title{font-weight:700;font-size:12.5pt;line-height:5.5mm;height:5.5mm}
.sbi-pr-anscols{display:grid;grid-template-columns:92mm 92mm;column-gap:6mm}
.sbi-pr-ans{height:4.5mm;line-height:4.5mm;font-size:10pt;white-space:nowrap;overflow:hidden}
.sbi-app-pdf-page .sbi-pr-page{box-shadow:none;margin:0}

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

/* 単元専用テンキー(ufk)を共通テンキーと同じ幅240px・UI字体にそろえる（品質検査 #2972 の形。この単元の画面だけに限る）。 */
#page-quiz:has(#question-text[data-unit="square_border_inner_inverse3_4"]) .ufk-keypad{max-width:240px;width:100%}
#page-quiz:has(#question-text[data-unit="square_border_inner_inverse3_4"]) .ufk-keypad .num-btn{font-family:var(--font-ui)}
