/* ── sequential_takeaway_trace2_1（とるたびに のこりを きろくしよう、単元仕様書 v1.7）── */
/* 画面：問題文の下に、はじめの箱→各かいめの箱（取る数の札・見出し・のこりの欄）、テンキー（§5-3・§7 画面表示）。 */
.stt-main{margin:4px 0 6px;max-width:100%}
.stt-boxes{display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;gap:6px 4px}
.stt-box{box-sizing:border-box;border:2px solid #475569;border-radius:10px;background:#fff;padding:4px 8px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:92px}
.stt-box-start{background:#f1f5f9;align-self:flex-end}
.stt-box-head{font-weight:700;font-size:14px;line-height:1.3;white-space:nowrap}
.stt-box-start-num{font-size:1.6rem;font-weight:700;line-height:44px;min-height:44px}
.stt-step{display:flex;align-items:flex-end;gap:4px}
.stt-step>.stt-box{flex:none}
.stt-step{flex-wrap:wrap;justify-content:center}
.stt-arrow{font-size:1.2rem;line-height:44px;color:#475569;align-self:flex-end;padding-bottom:6px}
.stt-take{flex-basis:100%;order:-1;text-align:center;font-weight:700;font-size:14px;line-height:1.3;white-space:nowrap;color:#1e3a8a}
.stt-field{display:flex;align-items:center;gap:6px;white-space:nowrap}
.stt-field-name{font-size:14px;font-weight:700}
.stt-input{width:3em;min-height:44px;font-size:1.4rem;padding:2px 4px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:8px;text-align:center;font-family:inherit;box-sizing:border-box}
.stt-input:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
/* えらんでいる欄（テンキーの書きこみ先）だけに太い枠を出す。 */
.stt-input.ufk-input-active,.stt-input.ufk-input-active:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.stt-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
/* 採点後：正しい欄は緑の実線、まちがえた欄は赤の点線の太い枠（色だけにせず線の形でも区別する。§5-3）。 */
.stt-input.stt-ok,.stt-input.stt-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.stt-input.stt-ng,.stt-input.stt-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.stt-filled{display:inline-block;min-width:2em;text-align:center;font-size:1.3rem;font-weight:700;border-bottom:2px solid #475569}
.stt-example-answer{margin:6px 0 0;font-weight:700}
.lesson-card .stt-boxes-example{margin:4px 0;justify-content:flex-start}
#stt-keypad-anchor + .ufk-keypad .ufk-key-switch{grid-column:1/-1;font-size:1rem;white-space:nowrap}
.feedback.has-text.stt-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.feedback.has-text.stt-error{color:#b45309}
.stt-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
#page-quiz.active:has(.stt-main) #question-text,#page-quiz.active:has(.stt-main) #hint-area .kp-body,#page-quiz.active:has(.stt-main) #feedback,.stt-expl-text{word-break:keep-all;overflow-wrap:anywhere;line-break:strict}
#page-quiz.active:has(.stt-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.stt-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.stt-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.stt-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
/* 幅のせまい画面（320px など）：はじめ→1かいめ→2かいめ→3かいめを上から下へならべる。 */
@media (max-width:480px){
  .stt-boxes{flex-direction:column;align-items:center}
  .stt-box-start{align-self:center}
  .stt-arrow{transform:rotate(90deg);padding-bottom:0;line-height:24px;align-self:center}
  .stt-step{flex-direction:column;align-items:center;gap:2px}
  .stt-take{order:0;flex-basis:auto}
}

/* 印刷：A4縦・1ページ（§7。用紙の余白 上下5mm・左右6mm、本文198×287mm、1列10行、1行22.5mm、記入枠14.3×10.3mm＝PDFの丸めでも14×10mm以上）。 */
.stt-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}
.stt-pr-headblock{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:19mm}
.stt-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}
.stt-pr-fields{display:flex;gap:6mm;align-items:flex-end;height:7mm;margin-top:1mm;font-size:12pt;line-height:6mm;white-space:nowrap}
.stt-pr-group{display:inline-flex;align-items:flex-end;gap:3mm;flex:none}
.stt-pr-field{display:inline-flex;align-items:flex-end;gap:1.5mm;flex:none}
.stt-pr-field-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:1pt solid #555}
.stt-field-name{flex:1;min-width:0}
.stt-field-name .stt-pr-field-line{flex:1;width:auto;min-width:40mm}
.stt-pr-solid{box-sizing:content-box;display:block;height:0;padding:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.stt-pr-common{flex:none;margin:0;height:8mm;line-height:8mm;font-size:13pt;font-weight:700;white-space:nowrap}
.stt-pr-problems{display:flex;flex-direction:column;flex:none;height:225mm}
.stt-pr-row{box-sizing:border-box;height:22.5mm;display:flex;align-items:flex-end;padding-bottom:0.9mm;border-bottom:0.2mm solid transparent}
.stt-pr-no{flex:none;width:8mm;font-size:12.5pt;font-weight:700;line-height:16mm;height:16.2mm}
.stt-pr-start{flex:none;width:22mm;display:flex;flex-direction:column}
.stt-pr-step{flex:none;display:flex;align-items:flex-end}
.stt-pr-row-3 .stt-pr-step{width:52mm}
.stt-pr-row-2 .stt-pr-step{width:78mm}
.stt-pr-arrow{flex:none;width:6mm;height:16.2mm;line-height:16.2mm;text-align:center;font-size:11pt}
.stt-pr-row-2 .stt-pr-arrow{width:8mm}
.stt-pr-stepbody{flex:1;min-width:0;display:flex;flex-direction:column}
.stt-pr-take{height:5.3mm;line-height:5.3mm;font-size:12.5pt;font-weight:700;white-space:nowrap;overflow:hidden}
.stt-pr-box{box-sizing:border-box;height:16.2mm;border:0.35mm solid #333;border-radius:1mm;padding:0.2mm 1.5mm;display:flex;flex-direction:column}
.stt-pr-box-start{background:#f3f4f6;print-color-adjust:exact;-webkit-print-color-adjust:exact;align-items:center}
.stt-pr-head{height:4.8mm;line-height:4.8mm;font-size:11pt;font-weight:700;white-space:nowrap}
.stt-pr-startnum{height:10.4mm;line-height:10.4mm;font-size:16pt;font-weight:700}
.stt-pr-fieldrow{display:flex;align-items:center;gap:1.5mm;height:10.4mm}
.stt-pr-name{font-size:11pt;white-space:nowrap}
.stt-pr-write{display:inline-block;box-sizing:border-box;width:14.3mm;height:10.3mm;border:0.35mm solid #333;background:#fff}
.stt-pr-answers{flex:none;box-sizing:border-box;height:24mm}
.stt-pr-dashed{box-sizing:content-box;display:block;height:0;margin:1.5mm 0 1mm;padding:0;border:0;border-top:2pt dashed #aaa}
.stt-pr-answers-title{font-weight:700;font-size:12.5pt;line-height:5.5mm;height:5.5mm}
.stt-pr-ans-line{display:flex;height:6.5mm;line-height:6.5mm}
.stt-pr-ans{flex:none;width:38mm;font-size:12.5pt;white-space:nowrap;overflow:hidden}
.stt-app-pdf-page .stt-pr-page{box-shadow:none;margin:0}

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

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