/* แบบทดสอบความรู้ A4 แนวตั้ง 2 หน้า (หน้า-หลัง) (cvdremission.mshprimary.com/quiz-2027) · ธีมขาว-แดงเดียวกับหน้าขั้นตอนโครงการ
   บนจอ: แถบบน + กระดาษจำลอง · ตอนพิมพ์: เหลือแต่ใบ หน้าละ A4 (210 × 297 มม.) · หน้า 1 ข้อ 1–5 หน้า 2 ข้อ 6–10 ตัวใหญ่ มีช่องกากบาท · ไม่มีเฉลยในใบ */
:root{
  --bg:#f4eff0; --fg:#2a1316; --muted:#6f6264; --line:#ece6e7; --soft:#fff4f5;
  --red:#c8102e; --red-dk:#7a0a1c; --ink:#1d1d1f;
  --f-ui:"Noto Sans Thai",system-ui,sans-serif;
  /* ใบที่ผู้สูงอายุอ่าน: Sarabun ตัวอักษรมีหัว แบบเอกสารราชการที่คุ้นตา อ่านง่ายกว่าตัวไม่มีหัว */
  --f-sheet:"Sarabun","Noto Sans Thai",sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--f-ui);font-size:16px;line-height:1.55}
p{margin:0}

/* ---------- แถบบน (ไม่พิมพ์) ---------- */
/* แถบบนเป็นของ MSH Organize (shell-navbar.js + cvd-shell.js · 17 พ.ย. 2569) · .top = แถบปุ่มของหน้าอยู่ใต้แถบบน ไม่ลอย (body ของชุดแถบเมนูเป็นตัวเลื่อน sticky จะเลื่อนผิดที่) */
.top{background:#fff;border-bottom:1px solid var(--line)}
.top-in{max-width:1100px;margin:0 auto;padding:10px 16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px 16px}
.actions{display:flex;flex-wrap:wrap;gap:8px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:6px 16px;border-radius:999px;background:var(--red);color:#fff;border:2px solid var(--red);font:inherit;font-weight:700;font-size:.92rem;text-decoration:none;cursor:pointer}
.btn:hover{background:var(--red-dk);border-color:var(--red-dk)}
.btn.ghost{background:#fff;color:var(--red)}
.btn.ghost:hover{background:var(--soft)}
.hint{max-width:1100px;margin:0 auto;padding:0 16px 10px;color:var(--muted);font-size:.85rem}
.hint:empty{display:none}
/* คำอธิบายใต้ปุ่มพิมพ์เป็นเช็กลิสต์ ข้อละบรรทัด · ข้อความแจ้งสถานะจาก cvd-quiz.js แทนที่รายการด้วยข้อความธรรมดา */

/* ---------- กระดาษ ---------- */
.paper{padding:20px 16px 48px;overflow-x:auto}
.sheet{
  width:210mm;min-height:297mm;margin:0 auto 20px;padding:7mm 10mm;background:#fff;color:var(--ink);
  box-shadow:0 6px 24px rgba(60,20,25,.14);border-radius:4px;
  display:flex;flex-direction:column;font-family:var(--f-sheet);font-size:9.6pt;line-height:1.28;
  -webkit-print-color-adjust:exact;print-color-adjust:exact;
}
.sh-head{display:flex;align-items:center;gap:3mm;padding-bottom:2mm;border-bottom:.6mm solid var(--red)}
.sh-logo{flex:none;width:13mm;height:13mm;border-radius:50%}
.sh-title{flex:1 1 auto;min-width:0}
.sh-eyebrow{color:var(--red);font-weight:700;font-size:8.5pt;letter-spacing:.02em}
.sh-title h1{margin:0;font-size:13pt;line-height:1.25;color:var(--ink)}
.sh-score{flex:none;display:flex;align-items:flex-end;gap:1.5mm;padding:2mm 3mm;border:.4mm solid var(--red);border-radius:2.5mm;font-weight:700;font-size:11pt;white-space:nowrap}
.sh-score .line{display:inline-block;width:12mm;border-bottom:.3mm solid #333;height:6mm}

/* ข้อมูลส่วนตัว (ผู้สูงอายุเขียนเอง): ซ้าย 3 บรรทัด ตัว 12pt เส้นสูง 7.5 มม. · ขวากล่องเจ้าหน้าที่ · เลขบัตรแถวเต็มกว้าง ช่อง 7.5 × 9 มม. */
.sh-info{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1.5mm 4mm;align-items:stretch;margin-top:2mm}
.fields{display:flex;flex-direction:column;justify-content:space-between;gap:1mm;min-width:0}
.sh-info .row{font-size:12pt;gap:2mm}
.row{display:flex;align-items:flex-end;gap:1.5mm;white-space:nowrap}
.lb{font-weight:600}
.line{display:inline-block;height:5mm;border-bottom:.3mm dotted #555}
.line.grow{flex:1 1 auto;min-width:10mm}
.sh-info .line{height:7.5mm;border-bottom:.35mm dotted #333}
.line.w12{width:12mm}.line.w22{width:22mm}.line.w30{width:30mm}
.cid{grid-column:1 / -1;align-items:center}
.cid-boxes{display:inline-flex;align-items:center;gap:1.5mm}
.cid-boxes .grp{display:inline-flex}
.cid-boxes i{display:inline-block;width:7.5mm;height:9mm;border:.35mm solid #333;margin-left:-.35mm}
.cid-boxes .grp i:first-child{margin-left:0}
.cid-boxes .sep{color:#555;font-weight:700}
/* ใบรายคน (พิมพ์จากหน้าทะเบียนโครงการ): ข้อมูลที่เติมให้ ตัวหนาบนเส้นประ · เลขบัตรในช่อง · QR เฉพาะคน (svg) */
.line.filled{width:auto;min-width:8mm;height:auto;padding:0 1mm;font-weight:700;font-size:12pt;line-height:1.2;overflow:hidden;text-overflow:ellipsis}
.line.grow.filled{min-width:10mm}
.cid-boxes i{font-style:normal;font-weight:700;font-size:14pt;line-height:8.5mm;text-align:center}
.staff{flex:none;display:flex;gap:2.5mm;align-items:center;padding:2mm 2.5mm;border:.35mm dashed #b9a8ab;border-radius:2.5mm}
.qr{width:22mm;height:22mm;flex:none}
.staff-txt{display:flex;flex-direction:column;gap:.3mm;white-space:nowrap;font-size:8pt;line-height:1.25;color:#333}
.staff-txt b{font-size:8.5pt;color:var(--red-dk)}
.chk{display:flex;align-items:center;gap:1.2mm}
.chk i{display:inline-block;width:3mm;height:3mm;border:.3mm solid #555;border-radius:.6mm}

.sh-how{margin:2mm 0 1mm;padding:1.4mm 3mm;background:var(--soft);border-left:1mm solid var(--red);font-size:12pt}
.ex{display:inline-block;width:4.6mm;height:4.6mm;border:.35mm solid #333;border-radius:.8mm;vertical-align:-.6mm}
.sh-how b{color:var(--red-dk);margin-right:1.5mm}

/* คำถาม: ตัวอักษรใหญ่ ตัวเลือกบรรทัดละข้อ มีช่องสี่เหลี่ยมให้กากบาท · ข้อกระจายเต็มความสูงหน้า เว้นระยะเท่า ๆ กัน
   25 ต.ค. 2569 (คุณหมอขอ): ลดตัวอักษร (คำถาม 14 → 13pt · ตัวเลือก 14 → 12.5pt) เว้นระหว่างข้อเพิ่ม + เส้นประบาง ๆ คั่น ให้แยกข้อชัด · หน้า 1 เต็มพอดี ห้ามเพิ่มระยะอีกโดยไม่ลดตัวอักษร */
.qs{list-style:none;margin:0;padding:0;flex:1 1 auto;display:flex;flex-direction:column;justify-content:space-around;gap:2mm}
.q{break-inside:avoid}
.q + .q{padding-top:2mm;border-top:.25mm dashed #d9cdcf}
.q > p{font-weight:700;font-size:13pt;line-height:1.3;padding-left:8mm;text-indent:-8mm}
.qn{display:inline-block;min-width:8mm;text-indent:0;color:var(--red-dk)}
.opts{list-style:none;margin:1.5mm 0 0 8mm;padding:0;display:flex;flex-direction:column;gap:.8mm;font-size:12.5pt;line-height:1.3}
.opts li{display:flex;align-items:flex-start;gap:2.2mm}
.opts li::before{content:"";flex:none;width:5mm;height:5mm;margin-top:.8mm;border:.35mm solid #333;border-radius:.8mm}
.mk{flex:none;min-width:5.5mm;font-weight:700}
/* ตัดคำไทย (taste-skill ตรวจ 25 ต.ค. 2569): ตัวตัดคำของเบราว์เซอร์แยกคำประสมกลางคำ ("หัวใจขาด | เลือด" "อันตรายถึง | ชีวิต" "ให้ | ดี")
   คำประสม/วลีที่ต้องอ่านติดกันใส่ span.kw ไม่ขึ้นบรรทัดกลางวลี
   ไม่ใช้ text-wrap:pretty ในใบ: ทดลองแล้วย้ายจุดตัดไปกลางคำประสมอื่น ("เนื้อ | สมอง" "เสีย | ชีวิต") */
.kw{white-space:nowrap}
.ot{min-width:0}
.sh-foot{margin-top:3mm;padding:2mm 3mm;border-radius:2mm;background:var(--red);color:#fff;text-align:center;font-weight:600;font-size:12pt}
.sh-foot b{font-size:14pt;margin-right:1.5mm}
/* หน้า 1: แถบบอกพลิกหน้าบางกว่าแถบท้ายหน้า 2 ให้ช่องข้อมูลส่วนตัวมีที่ขยาย */
.sh-next{margin-top:2mm;padding:1mm 3mm;background:var(--soft);color:var(--red-dk);border:.35mm solid var(--red)}
.sh-head2 .sh-title{display:grid;gap:2mm}
.sh-head2 .sh-eyebrow{font-size:11pt}
.sh-head2 .row{font-size:11pt}

/* จอแคบกว่ากระดาษ (มือถือ แท็บเล็ต): ย่อกระดาษจำลองทั้งใบให้พอดีความกว้างจอ (cvd-quiz.js ตั้ง --sheet-fit) อ่านได้ทั้งบรรทัดไม่ต้องเลื่อนแนวนอน
   ตอนพิมพ์ใช้ขนาดจริงเสมอ (@media print ด้านล่าง) · taste-skill จัดวาง 23 ต.ค. 2569 สีและเนื้อหาเดิม */
.sheet{zoom:var(--sheet-fit,1)}
@media (max-width:860px){
  .paper{overflow-x:hidden}
}
/* มือถือ: แถบบนไม่ติดจอ (เดิมติดอยู่สูงราว 240px บังใบเกือบครึ่งจอ) · ปุ่มสองปุ่มแรกแถวเดียวกัน ปุ่มพิมพ์เต็มแถว */
@media (max-width:640px){
  .top-in{padding:10px 12px}
  .actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .actions .btn{min-height:44px;padding:6px 8px;font-size:.88rem}
  .actions #printBtn{grid-column:1/-1}
  .hint{padding:0 12px 10px;font-size:.8rem}
  .paper{--cvd-main-px:8px;padding:12px 8px 32px}
}

@media print{
  @page{size:A4 portrait;margin:0}
  body{background:#fff}
  .top{display:none}
  .paper{padding:0;overflow:visible}
  .sheet{width:210mm;height:297mm;min-height:0;margin:0;box-shadow:none;border-radius:0;overflow:hidden;break-after:page;page-break-after:always}
  .sheet:last-child{break-after:auto;page-break-after:auto}
  .paper .sheet{zoom:1!important}
}
