/* ── two_type_count_cost_inverse3_3（二しゅるいのこ数を合計と代金からもとめよう、単元仕様書 v1.4）── */
/* 画面：問題文の下に、ねだんの表、ちがいの長方形の図、回答らんと単位を上から順に置く（§7 画面表示）。 */
.ttc-main{display:flex;flex-direction:column;align-items:center;gap:10px;margin:4px auto 6px;max-width:560px;width:100%;box-sizing:border-box}
.ttc-figure{display:flex;flex-direction:column;align-items:stretch;gap:10px;width:100%;min-width:0}
.ttc-table{border-collapse:collapse;margin:0 auto;background:#fff;font-size:1.05rem}
.ttc-table th,.ttc-table td{border:2px solid #64748b;padding:5px 12px;text-align:center}
.ttc-table thead th{background:#f1f5f9;font-weight:800;color:#1f2937}
.ttc-table tbody th{font-weight:800;color:#111827;white-space:nowrap}
.ttc-table td{font-weight:800;color:#111827;font-size:1.1rem;white-space:nowrap}
/* ちがいの長方形の図：下の長方形（全部が安いほう）と、その上の右がわにのせた長方形（ねだんのちがい）。右にかっこと合計。 */
.ttc-diagram{display:grid;grid-template-columns:minmax(0,1fr) 14px auto;align-items:stretch;gap:0 6px;width:100%;max-width:520px;margin:0 auto;box-sizing:border-box}
.ttc-diag-rects{display:flex;flex-direction:column;align-items:flex-end;min-width:0}
.ttc-diag-extra{width:48%;box-sizing:border-box;border:2px solid #b45309;border-bottom:0;background:#fef3c7;padding:4px 6px;font-size:.92rem;font-weight:700;text-align:center;line-height:1.35;overflow-wrap:anywhere}
.ttc-diag-base{width:100%;box-sizing:border-box;border:2px solid #1d4ed8;background:#dbeafe;padding:8px 6px;font-size:.95rem;font-weight:700;text-align:center;line-height:1.35;overflow-wrap:anywhere}
.ttc-diag-rects-c1{flex-direction:row;align-items:stretch;justify-content:stretch;width:100%}
.ttc-diag-c1-extra{flex:0 0 36%;box-sizing:border-box;border:2px solid #b45309;background:#fef3c7;padding:8px 6px;font-size:.92rem;font-weight:700;text-align:center;line-height:1.35;overflow-wrap:anywhere;display:flex;align-items:center;justify-content:center}
.ttc-diag-c1-pair{flex:1 1 auto;min-width:0;box-sizing:border-box;border:2px solid #1d4ed8;background:#dbeafe;padding:8px 6px;font-size:.92rem;font-weight:700;text-align:center;line-height:1.35;overflow-wrap:anywhere;display:flex;align-items:center;justify-content:center}
.ttc-diag-c1-extra+.ttc-diag-c1-pair{border-left:0}
.ttc-diag-brace{border:2px solid #334155;border-left:0;border-radius:0 10px 10px 0}
.ttc-diag-total{align-self:center;font-weight:800;font-size:.98rem;white-space:nowrap}
.ttc-answer{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;min-width:0}
.ttc-field{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:nowrap}
.ttc-input{width:7.5em;min-height:46px;font-size:1.35rem;font-weight:800;text-align:center;border:2px solid #64748b;border-radius:10px;box-sizing:border-box;padding:4px 8px}
.ttc-input.ttc-input-ok{border-color:#15803d;background:#dcfce7}
.ttc-input.ttc-input-ng{border-color:#b91c1c;background:#fff1f2}
.ttc-unit{font-size:1.2rem;font-weight:800;white-space:nowrap}
.ttc-guide{margin:0;font-weight:700;text-align:center}
.ttc-msg{margin:0;min-height:1.2em;color:#9a3412;font-weight:700;text-align:center;overflow-wrap:anywhere}
.feedback.has-text.ttc-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.ttc-correct{margin:4px 0 2px;font-weight:700;overflow-wrap:anywhere}
.ttc-expl-text{margin:2px 0 6px;overflow-wrap:anywhere}
#page-quiz.active:has(.ttc-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.ttc-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.ttc-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.ttc-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
@media (max-width:560px){
  .ttc-table{font-size:.95rem}
  .ttc-table th,.ttc-table td{padding:4px 7px}
  .ttc-table td{font-size:1rem}
  .ttc-diagram{grid-template-columns:minmax(0,1fr) 10px auto;gap:0 4px}
  .ttc-diag-extra,.ttc-diag-base,.ttc-diag-c1-extra,.ttc-diag-c1-pair{font-size:.82rem;padding:4px 4px}
  .ttc-diag-total{font-size:.85rem;white-space:normal;max-width:5.5em;overflow-wrap:anywhere}
}

/* 印刷：A4縦・2列・1ページ（§7。用紙の余白10mm、本文190×277mm）。アプリのPDFでは等幅数字を指定しない。 */
.ttc-print-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;font-size:12.5pt}
/* 共通の領域（32mm）：題名の枠7mm、月・日・年・組・名前の記入欄7mmと実線、共通の案内（2行11mm）、余り5mm以上（§7）。 */
.ttc-print-head{display:flex;flex-direction:column;height:32mm;flex:none;box-sizing:border-box;font-size:12.5pt}
.ttc-print-title{box-sizing:border-box;margin:0;height:7mm;font-size:14pt;font-weight:700;line-height:5.9mm;text-align:center;white-space:nowrap;padding:0;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.ttc-print-head .pp-fields{margin:0;height:7mm;line-height:6mm!important}
.ttc-print-head hr.pp-fields-solid{margin:0.5mm 0!important}
.ttc-print-instruction{margin:0;max-height:11mm;line-height:5.5mm;overflow:hidden;overflow-wrap:break-word;word-break:normal;line-break:strict}
/* 問題：2列（各92mm、列の間6mm）×5段（各32mm）。各問は、問いの文（3行まで）、表と答えらんの行。 */
.ttc-print-problems{display:grid;grid-template-columns:92mm 92mm;column-gap:6mm;flex:none;height:160mm}
.ttc-print-col{display:grid;grid-template-rows:repeat(5,32mm)}
.ttc-print-cell{display:flex;flex-direction:column;height:32mm;overflow:hidden;box-sizing:border-box;padding-right:3mm}
.ttc-print-q{line-height:5.6mm;max-height:16.8mm;overflow:hidden;overflow-wrap:break-word;word-break:normal;line-break:strict}
.ttc-print-bottom{display:flex;align-items:center;gap:2mm;margin-top:1mm}
.ttc-print-table{border-collapse:collapse;font-size:9pt;flex:none}
.ttc-print-table th,.ttc-print-table td{border:0.3mm solid #000;height:4.4mm;padding:0 1.2mm;line-height:4mm;text-align:center;white-space:nowrap;box-sizing:border-box}
.ttc-print-table th{font-weight:700}
.ttc-print-row{display:inline-flex;align-items:center;white-space:nowrap}
.ttc-print-box{display:inline-block;width:17.6mm;height:8mm;box-sizing:border-box}
.ttc-print-unit{margin-left:1mm}
.ttc-print-answers{flex:none;box-sizing:border-box;margin-top:3mm}
.ttc-print-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 1mm;padding:0;border:0;border-top:2pt dashed #aaa}
.ttc-print-answers-title{height:6mm;line-height:6mm;font-weight:700}
.ttc-print-answers-grid{display:grid;grid-template-columns:92mm 92mm;column-gap:6mm}
.ttc-print-ans-col{display:grid;grid-template-rows:repeat(5,13mm)}
.ttc-print-ans{font-size:10pt;line-height:4.3mm;max-height:12.9mm;overflow:hidden;overflow-wrap:anywhere}
.ttc-app-pdf-page .ttc-print-page{box-shadow:none;margin:0}

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