/* two_part_partition_complete3_1（単元仕様書 v1.8 §7） */
/* 画面：全体の数の表示と、四つの二列の表（ひだり・みぎ）。各表がそのまま選択肢のボタン（44px以上）。色に頼らず、文字で読める。 */
.tpp-main{display:flex;flex-direction:column;align-items:center;gap:10px;width:100%;box-sizing:border-box;padding:4px 0}
.tpp-q{word-break:keep-all;overflow-wrap:anywhere}
.tpp-whole{margin:0;padding:4px 14px;border:2px solid #334155;border-radius:10px;font-size:20px;font-weight:800;background:#fff;word-break:keep-all}
.tpp-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;max-width:520px}
.tpp-choice{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;min-height:48px;min-width:44px;padding:6px;border:2px solid #94a3b8;border-radius:12px;background:#fff;cursor:pointer;box-sizing:border-box;font:inherit;color:inherit}
.tpp-choice:focus-visible{outline:3px solid #f59e0b;outline-offset:2px}
.tpp-label{font-weight:800;font-size:15px;color:#1e293b}
.tpp-table{border-collapse:collapse;font-size:16px;font-family:Arial,'BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.tpp-table th,.tpp-table td{border:1px solid #64748b;padding:2px 10px;text-align:center;min-width:2.4em}
.tpp-table th{font-size:13px;font-weight:700;background:#f1f5f9;font-family:'BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
/* ヒント2（§6 v1.7）：各表の最初の行と最後の行に色をつける（始まりと終わりを確かめる）。 */
.tpp-endrow td{background:#fcd34d}
.tpp-selected{border-color:#1d4ed8;border-width:4px;box-shadow:0 0 0 2px #bfdbfe;padding:4px}
/* 採点後の印：字体によらず同じ形になるよう、○と×は図（SVG）で描く。 */
.tpp-correct{border-color:#15803d;border-width:4px;padding:4px}
.tpp-correct::after{content:'';position:absolute;top:-10px;right:-6px;width:24px;height:24px;border-radius:50%;box-sizing:border-box;border:0;box-shadow:0 0 0 1px #cbd5e1;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7.5' fill='none' stroke='%2315803d' stroke-width='2.8'/%3E%3C/svg%3E") center/20px 20px no-repeat}
.tpp-wrong{border-color:#b91c1c;border-style:dashed}
.tpp-wrong::after{content:'';position:absolute;top:-10px;right:-6px;width:24px;height:24px;border-radius:50%;box-sizing:border-box;border:0;box-shadow:0 0 0 1px #cbd5e1;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cline x1='5' y1='5' x2='15' y2='15' stroke='%23b91c1c' stroke-width='2.8' stroke-linecap='round'/%3E%3Cline x1='15' y1='5' x2='5' y2='15' stroke='%23b91c1c' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E") center/20px 20px no-repeat}
.tpp-hl{box-shadow:0 0 0 4px #f59e0b}
.tpp-checks{display:flex;gap:6px;margin-top:2px}
.tpp-checks span{display:block;width:16px;height:16px;border:2px solid #475569;border-radius:3px;background:#fff}
.tpp-msg{min-height:1.4em;margin:0;font-weight:700;color:#b45309;text-align:center;word-break:keep-all}
.feedback.has-text.tpp-feedback{height:auto;min-height:46px;padding:4px 0;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;word-break:keep-all;overflow-wrap:anywhere;line-height:1.45}
.tpp-anshead{margin:4px 0;word-break:keep-all}
.tpp-ans-table{display:inline-block;margin:2px 0 4px}
.tpp-expl-text{margin:0;word-break:keep-all;overflow-wrap:anywhere;font-family:Arial,'BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.tpp-ex-formula,.tpp-ex{word-break:keep-all;overflow-wrap:anywhere}
.tpp-ex-fig{display:flex;flex-direction:column;align-items:center;gap:4px;margin:6px 0}
.tpp-ex-whole{margin:0;font-weight:800}
#page-lesson:has(.tpp-ex-fig){word-break:keep-all;overflow-wrap:anywhere}
#page-quiz.active:has(.tpp-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.tpp-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.tpp-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.tpp-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0;text-align:left;word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty}
@media (max-width:360px){.tpp-table th,.tpp-table td{padding:2px 6px}.tpp-choices{gap:8px}}
/* 結果の画面の一覧（§5-3）：答えは問いの下の行に置き、日本語は語の途中で折り返さない。 */
#result-details .result-row-top:has(.tpp-history-prompt){flex-wrap:wrap;gap:6px 8px;align-items:flex-start}
#result-details .result-row-top:has(.tpp-history-prompt)>.q-text,#result-details .result-row-top:has(.tpp-history-prompt)>span:last-child{flex:1 1 100%;min-width:0;word-break:keep-all;overflow-wrap:anywhere;line-break:strict}
#result-details .result-row-top:has(.tpp-history-prompt)>span:last-child>span{white-space:nowrap}
#result-details .result-row:has(.tpp-history-prompt) .expl-body{word-break:keep-all;overflow-wrap:anywhere}

/* 印刷：A4横・1ページ（§7。v1.4）。使える領域287×200mm。題名の枠と記入らん（CP-08a・CP-08b）、共通の指示と群の問い、5列×2段、区切り線、こたえ。 */
.tpp-pr-page{width:277mm;height:190mm;box-sizing:border-box;display:flex;flex-direction:column;padding:0;margin:0 auto 8mm;overflow:hidden;background:#fff;color:#000;font-family:Arial,'BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.tpp-pr-page[lang=ja] .tpp-pr-inst,.tpp-pr-page[lang=ja] .tpp-pr-gq,.tpp-pr-page[lang=ja] .tpp-pr-h{font-family:'BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.tpp-pr-top{flex:none}
.tpp-pr-title{box-sizing:border-box;width:100%;margin:0;height:8mm;padding:0 2mm;font-size:13pt;font-weight:700;line-height:calc(8mm - 3pt);white-space:nowrap;text-align:center;border:1.5pt solid #666;background:#ffffcc;print-color-adjust:exact;-webkit-print-color-adjust:exact;font-family:'BIZ UDPGothic','Yu Gothic','Meiryo',sans-serif}
.tpp-pr-top .pp-fields{margin-top:1mm}
.tpp-pr-inst{margin:0;height:5mm;line-height:5mm;font-size:12.5pt;font-weight:700;white-space:nowrap}
.tpp-pr-gq{margin:0;height:4.6mm;line-height:4.6mm;font-size:12.5pt;white-space:nowrap}
.tpp-pr-problems{flex:none;margin-top:0.3mm;display:flex;flex-direction:column;gap:0.4mm}
.tpp-pr-rowcells{display:flex;gap:2.375mm}
.tpp-pr-cell{box-sizing:border-box;width:53.5mm;height:59.6mm;display:flex;flex-direction:column}
.tpp-pr-head{display:flex;align-items:center;gap:2mm;height:8mm}
.tpp-pr-num{font-size:12.5pt}
.tpp-pr-whole{font-size:12.5pt;font-weight:700;white-space:nowrap}
.tpp-pr-box{display:block;margin-left:auto;width:10mm;height:7.5mm;border:0.35mm solid #000}
.tpp-pr-grid{display:grid;grid-template-columns:repeat(2,26mm);grid-auto-rows:25.4mm;column-gap:1.5mm;row-gap:0.5mm}
.tpp-pr-tbox{display:flex;align-items:flex-start;gap:0.6mm}
.tpp-pr-letter{flex:none;width:3.4mm;font-size:10pt;line-height:3.8mm;text-align:center}
/* アプリPDF（html2canvas）が border-collapse を二重の線に描くため、線は表の上・左と各セルの右・下の1本ずつで描く（v1.5、独立検査r1）。 */
.tpp-pr-table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:21.8mm;border-top:0.25mm solid #333;border-left:0.25mm solid #333}
.tpp-pr-table th,.tpp-pr-table td{border:0;border-right:0.25mm solid #333;border-bottom:0.25mm solid #333;height:3.5mm;padding:0 0 0.15mm;text-align:center;vertical-align:middle;font-size:9pt;line-height:3.1mm;box-sizing:border-box}
.tpp-pr-table th{height:4mm;padding-bottom:0.5mm;line-height:3.2mm;font-weight:700;background:#f1f5f9;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.tpp-pr-answers{flex:none;margin-top:0.6mm}
.tpp-pr-border{margin:0 0 0.5mm;border:0;border-top:2pt dashed #aaa}
.tpp-pr-anshead{margin:0;height:4.6mm;line-height:4.6mm;font-size:12.5pt;font-weight:700}
.tpp-pr-anscols{display:flex;gap:6mm}
.tpp-pr-anscol{display:flex;flex-direction:column;width:135.5mm}
.tpp-pr-answer{height:4.6mm;line-height:4.6mm;font-size:12.5pt;white-space:nowrap}
#pr-sheet[data-unit="two_part_partition_complete3_1"]{width:277mm;max-width:none;padding:0;margin:calc(12px + 10mm) auto;background:transparent;box-shadow:none}
#pr-sheet[data-unit="two_part_partition_complete3_1"]>:not(#pr-problems){display:none!important}
#pr-sheet[data-unit="two_part_partition_complete3_1"]>#pr-problems{display:block}
#pr-sheet[data-unit="two_part_partition_complete3_1"] .tpp-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="two_part_partition_complete3_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="two_part_partition_complete3_1"]>:not(#pr-problems){display:none!important}
  #page-print #pr-sheet[data-unit="two_part_partition_complete3_1"]>#pr-problems{display:block!important}
  #page-print #pr-sheet[data-unit="two_part_partition_complete3_1"] .tpp-pr-page{display:flex!important;margin:0!important;box-shadow:none!important;break-after:auto;page-break-after:auto}
}
