/* ── profit_inventory_split2_5（売り分けと利益から個数や原価を求めよう、単元仕様書 v1.2）── */
/* 画面：問題文の下に、売り方の表・条件の行、数を入れる1欄と欄の外の単位、案内、数のキー（§5-3・§7 画面表示）。 */
.pis-main{margin:4px 0 6px;max-width:100%;display:flex;flex-direction:column;align-items:center}
.pis-table-wrap{max-width:100%;margin:2px 0 0}
.pis-table{border-collapse:collapse;font-size:15px;line-height:1.35;background:#fff;color:#111827}
.pis-table th,.pis-table td{border:2px solid #475569;padding:4px 7px;text-align:center;vertical-align:middle;white-space:nowrap}
.pis-table thead th{background:#e0f2fe;font-weight:700}
.pis-table .pis-row-label{background:#f8fafc;font-weight:700;text-align:left}
.pis-table .pis-line{display:block}
/* ？のますは太字と点線の下線で示す（色だけにたよらない）。 */
.pis-table .pis-cell-q{font-weight:800;color:#9a3412;background:#fff7ed}
.pis-table .pis-cell-q .pis-line{text-decoration:underline dotted 2px;text-underline-offset:3px}
.pis-cond{margin:6px 0 0;font-size:16px;font-weight:700;text-align:center;line-height:1.4}
.pis-row{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.pis-input-wrap{display:inline-flex;align-items:center;gap:4px}
.pis-input{width:6.2em;min-height:44px;font-size:1.3rem;padding:2px 6px;border:3px solid #1d4ed8;background:#eff6ff;border-radius:8px;text-align:center;font-family:inherit;box-sizing:border-box}
.pis-input:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
.pis-input:disabled{background:#f8fafc;color:#111827;opacity:1;border-color:#94a3b8}
/* 採点後：正しいときは緑の実線、まちがえたときは赤の点線の太い枠（色だけにせず線の形でも区別する）。 */
.pis-input.pis-ok,.pis-input.pis-ok:disabled{border:3px solid #15803d;background:#dcfce7}
.pis-input.pis-ng,.pis-input.pis-ng:disabled{border:3px dashed #b91c1c;background:#fff1f2}
.pis-unit{font-weight:700;font-size:1.15rem;white-space:nowrap}
.pis-guide{margin:4px 0 0;font-size:15px;text-align:center;line-height:1.4}
.pis-msg{min-height:1.4em;margin:4px 0 2px;color:#b45309;font-weight:700;text-align:center;line-height:1.4}
.pis-msg:empty{min-height:0;margin:0}
/* キーはほかの数の問いと同じ共通テンキーの配置（main.css の .numpad・.num-btn：3列、1〜9、最下段に0（2列分）と⌫）。ここでは幅と上の余白だけを変える（2026-11-18 オーナー指摘「テンキーのレイアウトが他と異なります」）。 */
/* 共通テンキーは renderQuestion が max-width:240px を直接指定するので、狭い画面でも同じ幅にそろえる。 */
.pis-keypad{width:100%;max-width:240px;margin-top:10px}
.pis-keypad[hidden]{display:none}
/* キーは操作の部品なので、共通テンキーと同じ UI の字体（--font-ui）にする（デザイン層仕様書 §1-2「UI 字体は非波及」。学習の字体だと 0 に斜線が入り、共通テンキーと字の形が違って見える）。 */
.pis-key{min-height:44px;font-family:var(--font-ui)}
.feedback.has-text.pis-feedback{height:auto;min-height:40px;padding:4px 0;text-align:center;line-height:1.45}
.pis-answer{margin:4px 0;font-weight:700;overflow-wrap:anywhere}
.pis-expl-text{margin:4px 0 6px;overflow-wrap:anywhere}
.pis-example-q{margin:4px 0}
.pis-example-answer{margin:6px 0;font-size:14px;color:#334155}
/* 日本語は文字の間で折り返す（keep-all だと文全体が1語になり、数の途中で折れていた。PIS-IR1-02）。数と式は .pis-nb で折らない。 */
#page-quiz.active:has(.pis-main) #question-text,#page-quiz.active:has(.pis-main) #hint-area .kp-body,#page-quiz.active:has(.pis-main) #feedback,.pis-expl-text,.pis-answer,.pis-cond,.pis-guide,.pis-msg{word-break:normal;overflow-wrap:break-word;line-break:strict}
.pis-nb{white-space:nowrap}
#page-quiz.active:has(.pis-main) #hint-area .kp-card{display:flex;align-items:flex-start;gap:8px}
#page-quiz.active:has(.pis-main) #hint-area .kp-head{margin-bottom:0;flex:none}
#page-quiz.active:has(.pis-main) #hint-area .kp-title:empty{display:none}
#page-quiz.active:has(.pis-main) #hint-area .kp-body{flex:1;min-width:0;padding-left:0}
/* 360 CSS px の幅でも表の列が欠けないように、せまい画面では文字と余白を小さくする（ページ全体の横スクロール0。§7）。 */
@media (max-width:420px){
  .pis-table{font-size:14px}
  .pis-table th,.pis-table td{padding:3px 4px}
}
/* 品質検査466：320 CSS px（小さいスマホ）でも右の列（しゅう入・Revenue）が欠けないように、さらに文字と余白を小さくする。 */
@media (max-width:340px){
  .pis-table{font-size:12.5px}
  .pis-table th,.pis-table td{padding:2px 3px}
}

/* 印刷：A4縦・1ページ（§7。用紙の余白 上下5mm・左右6mm、本文198×287mm。題名と記入欄、共通の問い、2列×5段で1問43mm、答え2行）。 */
.pis-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}
.pis-pr-headblock{display:flex;flex-direction:column;flex:none;box-sizing:border-box;width:190mm;height:19.5mm}
.pis-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}
.pis-pr-page[lang="en"] .pis-pr-title{font-size:14pt}
.pis-pr-fields{display:flex;gap:6mm;align-items:flex-end;height:7mm;margin-top:1mm;font-size:12pt;line-height:6mm;white-space:nowrap}
.pis-pr-group{display:inline-flex;align-items:flex-end;gap:3mm;flex:none}
.pis-pr-field{display:inline-flex;align-items:flex-end;gap:1.5mm;flex:none}
.pis-pr-field-line{display:inline-block;box-sizing:border-box;width:14mm;height:6mm;border-bottom:2px solid #555}
.pis-field-name{flex:1;min-width:0}
.pis-field-name .pis-pr-field-line{flex:1;width:auto;min-width:40mm}
.pis-pr-solid{box-sizing:content-box;display:block;height:0;padding:0;border:0;border-top:1.5pt solid #333;margin:1mm 0 0}
.pis-pr-common{flex:none;box-sizing:border-box;width:187mm;margin:2mm 0 0;height:27mm;font-size:12.5pt;line-height:5.2mm;overflow:hidden;word-break:keep-all;overflow-wrap:anywhere;line-break:strict}
.pis-pr-problems{display:flex;gap:3mm;flex:none;width:187mm;height:210mm}
.pis-pr-col{flex:none;width:92mm;display:flex;flex-direction:column}
.pis-pr-cell{box-sizing:border-box;height:42mm;display:flex;flex-direction:column;align-items:flex-start;padding:1mm 0 0;border-bottom:0.2mm solid transparent;overflow:hidden;font-size:12.5pt}
.pis-pr-top{display:flex;align-items:flex-start;gap:2mm}
.pis-pr-num{flex:none;width:9.2mm;font-weight:700;line-height:5.2mm;white-space:nowrap}
.pis-pr-page[lang="en"] .pis-pr-num{width:7.2mm}
/* 印刷の表は、列の名前の行としゅう入の列を置かず、売り方・単価・個数の3列（§7・BC-01）。線は2px（約0.53mm）。 */
.pis-pr-table{border-collapse:collapse;font-size:12.5pt;line-height:5.4mm}
.pis-pr-table th,.pis-pr-table td{border:2px solid #333;padding:0 1.5mm;text-align:center;vertical-align:middle;white-space:nowrap;font-weight:400}
.pis-pr-table .pis-pr-label{text-align:left;width:17.6mm}
.pis-pr-table td:nth-child(2){min-width:29.2mm}
.pis-pr-table td:nth-child(3){min-width:11.6mm}
.pis-pr-page[lang="en"] .pis-pr-table .pis-pr-label{width:24mm}
.pis-pr-page[lang="en"] .pis-pr-table td:nth-child(2){min-width:31.2mm}
.pis-pr-page[lang="en"] .pis-pr-table td:nth-child(3){min-width:7.2mm}
.pis-pr-table .pis-line{display:block}
/* 2行のます（わりびきの単価と1個の値段）は行の高さを少しつめ、1問43mmにおさめる。 */
.pis-pr-table td:has(.pis-line+.pis-line) .pis-line{line-height:4.6mm}
.pis-pr-table .pis-cell-q{font-weight:700}
.pis-pr-cond{margin:0.6mm 0 0 11.2mm;line-height:5mm;white-space:nowrap}
.pis-pr-page[lang="en"] .pis-pr-cond{margin-left:9.2mm}
.pis-pr-blank{margin:0.6mm 0 0 11.2mm;line-height:6mm;white-space:nowrap;display:flex;align-items:flex-end}
.pis-pr-page[lang="en"] .pis-pr-blank{margin-left:9.2mm}
.pis-pr-blank-box{display:inline-block;width:20mm;height:6mm}
.pis-pr-answers{flex:none;box-sizing:border-box;width:187mm;height:15mm}
.pis-pr-dashed{box-sizing:content-box;display:block;height:0;margin:1.5mm 0 1.5mm;padding:0;border:0;border-top:2pt dashed #aaa}
.pis-pr-ans-grid{display:grid;grid-template-columns:auto 1fr;column-gap:2mm;align-items:end}
.pis-pr-ans-title{font-weight:700;font-size:12.5pt;line-height:5mm;white-space:nowrap}
.pis-pr-ans-row{display:flex;font-size:10pt;line-height:5mm;white-space:nowrap}
.pis-pr-ans{flex:none;width:33mm;overflow:hidden}
.pis-app-pdf-page .pis-pr-page{box-shadow:none;margin:0}

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