/* ── distribution_exception_adjust3_4（ちがう配り方がまざるときの人数と全体を求めよう、単元仕様書 v1.4）── */
/* 画面：問題文の下に内訳の表、答えの欄、回答案内、テンキー、こたえるボタン（§5-3・§7 画面表示）。 */
.dea-main{display:flex;flex-direction:column;align-items:center;margin:4px 0 6px;max-width:100%}
.dea-table-wrap{max-width:100%}
.dea-table{border-collapse:collapse;background:#fff;color:#0f172a;font-variant-numeric:tabular-nums;margin:0 auto}
.dea-table th,.dea-table td{border:2px solid #334155;padding:5px 9px;font-size:1.02rem;text-align:center}
.dea-table thead th{background:#e2e8f0;font-weight:700}
.dea-table tbody th{background:#f8fafc;font-weight:700;text-align:left}
.dea-table td{font-weight:700;white-space:nowrap}
.dea-table td.dea-unknown{font-size:1.15rem}
/* 全部の行（v1.3）は上の太い線で組の行と分ける。―は数を置かないセル。 */
.dea-table tr.dea-row-total th,.dea-table tr.dea-row-total td{border-top:4px double #334155;background:#fefce8}
.dea-table td.dea-none{color:#475569;font-weight:400}
/* 多く・少なくは行の名前と＋・−の符号で示す。左の線は補助（§7。色だけにたよらない）。 */
.dea-table tr.dea-row-more th{border-left:6px solid #2563eb}
.dea-table tr.dea-row-less th{border-left:6px dashed #c2410c}
.dea-fields{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px;margin:6px auto 2px}
.dea-field-label{font-weight:700;font-size:1.05rem}
.dea-input{width:6em;max-width:50vw;min-height:44px;font-size:1.4rem;padding:4px 8px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:10px;text-align:center;font-family:inherit;box-sizing:border-box}
.dea-input:focus-visible{outline:3px solid #1d4ed8;outline-offset:2px}
.dea-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
.dea-input.dea-input-ok{border:3px solid #15803d;background:#dcfce7}
.dea-input.dea-input-ng{border:3px dashed #b91c1c;background:#fff1f2}
.dea-guide{margin:6px auto 4px;font-weight:700;text-align:center;max-width:32em}
.dea-msg{margin:2px auto 0;color:#b91c1c;font-weight:700;font-size:1rem;text-align:center;max-width:32em;overflow-wrap:anywhere}
.dea-msg:empty{display:none}
.feedback.has-text.dea-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.dea-correct{margin:2px 0 6px;font-weight:700;font-size:1rem}
.dea-expl-text{margin:4px 0 6px;overflow-wrap:anywhere;font-size:1rem;line-height:1.7}
#page-quiz.active:has(.dea-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.dea-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.dea-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.dea-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0;overflow-wrap:anywhere}
/* 幅の狭い画面（320〜560 CSS px）では、表の行を上から順に積むカードの形にし、横スクロールをなくす（§7）。 */
@media (max-width:560px){
  .dea-table-wrap{width:100%}
  .dea-table,.dea-table tbody,.dea-table tr,.dea-table th,.dea-table td{display:block;width:100%;box-sizing:border-box}
  .dea-table thead{display:none}
  .dea-table tr{border:2px solid #334155;border-radius:8px;margin:0 0 6px;background:#fff}
  .dea-table tr.dea-row-more{border-left:6px solid #2563eb}
  .dea-table tr.dea-row-less{border-left:6px dashed #c2410c}
  .dea-table tr.dea-row-total{border:3px double #334155;background:#fefce8}
  .dea-table tr.dea-row-total th,.dea-table tr.dea-row-total td{border-top:0}
  .dea-table tbody th,.dea-table td{border:0;padding:3px 8px;text-align:left;white-space:normal}
  .dea-table tr.dea-row-more th,.dea-table tr.dea-row-less th{border-left:0}
  .dea-table tbody th{background:#f1f5f9;border-radius:6px 6px 0 0}
  .dea-table td{display:flex;justify-content:space-between;gap:8px;font-size:1rem}
  .dea-table td::before{content:attr(data-dea-label);font-weight:400;color:#334155}
}

/* 印刷：A4縦・1列×10問・1ページ（§7。用紙の余白10mm、本文190×277mm、上部21mm、各問22.5mm、答え20mm）。 */
.dea-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}
.dea-pr-head{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:21mm}
.dea-pr-title{box-sizing:border-box;margin:0;height:9mm;font-size:14.3pt;font-weight:700;line-height:7.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}
.dea-pr-problems{display:flex;flex-direction:column;flex:none;height:225mm;margin-top:2mm}
.dea-pr-cell{box-sizing:border-box;height:22.5mm;overflow:hidden;display:grid;grid-template-columns:26mm 162mm;column-gap:2mm}
.dea-pr-num{font-size:12.6pt;font-weight:700;line-height:5.3mm}
.dea-pr-body{width:159mm;height:17.1mm;font-size:12.6pt;line-height:5.3mm}
/* 1・2行目の高さ（2行×5.3mm）の見えない浮動要素の下に、記入欄を右寄せで浮かせ、3行目の右に置く。 */
.dea-pr-spacer{float:right;width:0;height:10.6mm}
.dea-pr-ans-slot{float:right;clear:right;display:flex;align-items:center;gap:1mm;height:6.5mm;margin-left:3mm}
.dea-pr-anslabel{font-size:12.6pt;line-height:6.5mm;white-space:nowrap}
.dea-pr-box{display:inline-block;box-sizing:border-box;width:24mm;height:6.5mm;border:0.35mm solid #000}
.dea-pr-q{margin:0;font-size:12.6pt;line-height:5.3mm}
.dea-pr-answers{flex:none;box-sizing:border-box;margin-top:2mm;height:20mm}
.dea-pr-dashed{box-sizing:content-box;display:block;height:0;margin:0 0 0.5mm;padding:0;border:0;border-top:2pt dashed #aaa}
.dea-pr-answers-title{font-weight:700;font-size:12.6pt;height:6mm;line-height:6mm}
.dea-pr-answer-grid{display:grid;grid-template-columns:repeat(5,36mm);column-gap:1.5mm;font-size:10.2pt;line-height:4.5mm}
.dea-pr-ans{white-space:nowrap}
.dea-app-pdf-page .dea-pr-page{box-shadow:none;margin:0}

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