/* ── set_overlap_from_totals3_4（二つのじょうけんの重なり人数を求めよう、単元仕様書 v1.4）── */
/* 画面：問題文、4つの部分の図（円の名前と部分の名前だけ。人数は書かない）、回答欄（数の欄・単位）、案内、共通のテンキー。回答後は正誤・正しい答え・解説（§5-3・§7） */
#question-text .sot-q{display:block;overflow-wrap:normal}
.sot-nb{white-space:nowrap}
.sot-phrase-group{display:inline;min-width:0}
.sot-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center;gap:8px}
.sot-cap{margin:0;font-size:15px;font-weight:800;color:#334155;line-height:1.5}
/* 図：長方形の中に2つの円。名前は図の上に重ねた文字（色だけに頼らない） */
.sot-fig{position:relative;width:min(300px,100%);aspect-ratio:300/152;color:#111827;font-weight:700;flex:none}
.sot-svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.sot-fl{position:absolute;transform:translate(-50%,-50%);font-size:14px;line-height:1.2;white-space:nowrap}
.sot-fl-n1{left:10%;top:13%;font-size:17px;font-weight:800}
.sot-fl-n2{left:90%;top:13%;font-size:17px;font-weight:800}
.sot-fl-left{left:33%;top:40.8%}
.sot-fl-both{left:50%;top:40.8%}
.sot-fl-right{left:67%;top:40.8%}
.sot-fl-neither{left:50%;top:90.5%}
/* 第4段階のヒント：求める部分を太いわくでかこむ */
.sot-hl{display:none}
.sot-fig.sot-hl-on[data-sot-hl="both"] .sot-hl-both{display:inline}
.sot-fig.sot-hl-on[data-sot-hl="neither"] .sot-hl-neither{display:inline}
.sot-fig.sot-hl-on[data-sot-hl="left"] .sot-hl-left{display:inline}
.sot-fig.sot-hl-on[data-sot-hl="right"] .sot-hl-right{display:inline}
.sot-field{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.sot-unit{font-size:1.2rem;font-weight:800;color:#111827}
.sot-input{width:4em;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}
.sot-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.sot-input.sot-ok,.sot-input.sot-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.sot-input.sot-ng,.sot-input.sot-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.sot-input.sot-bad{border:3px dashed #b45309;background:#fffbeb}
.sot-guide{margin:2px 0 0;font-size:16px;font-weight:700;text-align:center;max-width:560px;line-height:1.7}
.sot-guide[hidden]{display:none}
.sot-msg{min-height:1.4em;margin:2px 0;color:#b45309;font-weight:700;text-align:center;line-height:1.6;max-width:560px}
.sot-msg:empty{min-height:0;margin:0}
.sot-msg-line{display:block}
.sot-main .ufk-keypad{margin-top:4px}
.feedback.has-text.sot-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.sot-correct{margin:4px 0 6px;font-weight:800;font-size:17px;line-height:1.9}
.sot-expl-text{margin:4px 0 8px;line-height:2;overflow-wrap:normal;word-break:normal;line-break:strict}
.sot-example{display:flex;flex-direction:column;align-items:center}
.sot-example .sot-ex-q{margin:6px 0 6px;font-weight:700;line-height:2;align-self:stretch}
.sot-example .sot-ex-a{margin:8px 0 8px;line-height:2;align-self:stretch}
.sot-learning-focus{word-break:normal;line-break:strict}
.sot-user-val{white-space:nowrap}
.sot-user-val.sot-user-long{white-space:normal;overflow-wrap:anywhere;word-break:break-all}
#page-quiz.active:has(.sot-main) #question-text{word-break:normal;overflow-wrap:normal;line-break:strict;font-size:17px;line-height:2}
#page-quiz.active:has(.sot-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.sot-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.sot-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.sot-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
#page-quiz:has(#question-text[data-unit="set_overlap_from_totals3_4"]) .ufk-keypad{max-width:240px;width:100%}
#page-quiz:has(#question-text[data-unit="set_overlap_from_totals3_4"]) .ufk-keypad .num-btn{font-family:var(--font-ui)}
/* 結果画面の単元名：狭い幅でも省略せず、文節で折り返す */
.result-unit-badge.sot-badge{max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;height:auto;border-radius:14px;line-height:1.5}
.result-unit-badge.sot-badge .rub-name{white-space:normal;overflow:visible;text-overflow:clip}
@media (max-width:400px){
  #page-lesson:has(.sot-example) .lesson-point,#page-lesson:has(.sot-example) .lesson-point *{font-size:15px}
  #page-lesson:has(.sot-example) .lesson-point{padding-left:10px;padding-right:10px;gap:6px}
  #page-lesson:has(.sot-example) .lesson-point .pt-icon{display:none}
  #page-lesson .lesson-example:has(.sot-example){padding-left:8px;padding-right:8px}
  #page-lesson .lesson-example div:has(>.sot-example){padding-left:6px!important;padding-right:6px!important}
  .sot-example .sot-ex-q,.sot-example .sot-ex-a{font-size:14px}
  .sot-guide,.sot-msg{font-size:15px}
  .sot-fl{font-size:13px}
  .sot-fl-n1,.sot-fl-n2{font-size:15px}
  .result-unit-badge.sot-badge,.result-unit-badge.sot-badge .rub-name,.result-unit-badge.sot-badge .sot-phrase{font-size:12px}
}
@media (max-width:340px){
  .sot-example .sot-ex-q,.sot-example .sot-ex-a{font-size:13px}
  #page-lesson:has(.sot-example) :is(h1,h2,h3):has(.sot-phrase){font-size:20px!important}
  .sot-fl{font-size:12px}
  .sot-example .sot-fl{font-size:12px;letter-spacing:-0.3px}
  #page-lesson .lesson-card:has(.sot-example){padding-left:12px;padding-right:12px}
  #page-lesson .lesson-example:has(.sot-example){padding-left:4px;padding-right:4px}
  #page-lesson .lesson-example div:has(>.sot-example){padding-left:2px!important;padding-right:2px!important}
}

/* 印刷（プリント共通仕様書のひな型P・P-標準：A4縦・2列×5行・1ページ。§7・確定表 SOT-07） */
.sot-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}
.sot-pr-headrow{flex:none;display:flex;flex-direction:column;gap:0}
.sot-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}
.sot-pr-headrow .pp-fields{margin:1mm 0 0}
.sot-pr-headrow .pp-field-name .pp-field-line{min-width:40mm}
.sot-pr-headrow hr.pp-fields-solid{flex:none;width:100%;margin:1.5mm 0 1.5mm!important}
.sot-pr-common{flex:none;display:flex;align-items:center;gap:4mm;margin:0 0 1.5mm;padding:0 1mm}
.sot-pr-inst{flex:1 1 0;min-width:0;font-size:12.5pt;line-height:5.4mm;margin:0;overflow-wrap:normal;word-break:normal}
.sot-fig.sot-fig-print{width:58mm;font-weight:400;color:#000}
.sot-fig-print .sot-fl{font-size:9pt}
.sot-fig-print .sot-fl-n1,.sot-fig-print .sot-fl-n2{font-size:11pt;font-weight:700}
.sot-pr-problems{flex:1 1 0;min-height:0;display:flex;gap:4mm;justify-content:center}
.sot-pr-col{width:93mm;display:flex;flex-direction:column;gap:1mm;min-height:0}
.sot-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}
.sot-pr-q{flex:none;display:flex;align-items:flex-start;margin:0;font-size:12.5pt;line-height:5.4mm;overflow-wrap:normal;word-break:normal}
.sot-pr-no{flex:none;margin-right:1.6mm;font-weight:700;min-width:7.5mm;white-space:nowrap}
.sot-pr-qtext{flex:1 1 0;min-width:0}
.sot-pr-work{flex:1 1 0;min-height:5mm}
.sot-pr-ansrow{flex:none;display:flex;align-items:center;justify-content:flex-end;height:8.6mm;font-size:12.5pt;line-height:8.6mm;white-space:nowrap}
.sot-pr-lead{flex:none;font-size:12.5pt;white-space:pre}
.sot-pr-paren{font-size:14pt;font-weight:400}
.sot-pr-blank{flex:none;display:inline-block;width:12.4mm;height:8.2mm}
.sot-pr-paren+.sot-pr-lead{margin-left:0.4mm}
.sot-pr-lead+.sot-pr-paren{margin-left:1.2mm}
.sot-pr-lead-en+.sot-pr-paren{margin-left:.3em}
.sot-pr-paren+.sot-pr-lead-en{margin-left:.25em}
.sot-pr-answers{flex:none;margin-top:1.5mm}
.sot-pr-fold{width:100%;height:0;border-top:2px dotted #333;margin:0 0 1.2mm}
.sot-pr-anshead{font-size:12.5pt;font-weight:700;line-height:6mm}
.sot-pr-acols{display:flex;gap:4mm}
.sot-pr-acol{width:93mm}
.sot-pr-answer{margin:0 0 0.5mm;font-size:10pt;line-height:4.4mm;white-space:nowrap}
#pr-sheet[data-unit="set_overlap_from_totals3_4"]{width:190mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="set_overlap_from_totals3_4"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="set_overlap_from_totals3_4"]>#pr-problems{display:block}
#pr-sheet[data-unit="set_overlap_from_totals3_4"] .sot-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="set_overlap_from_totals3_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="set_overlap_from_totals3_4"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="set_overlap_from_totals3_4"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="set_overlap_from_totals3_4"] .sot-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
.sot-app-pdf-page .sot-pr-page{box-shadow:none;margin:0}
