/* แบบพิมพ์ A4 แนวตั้ง ใช้ทั้งตอนดูตัวอย่างและตอนพิมพ์จริง */
.sheet {
  width: 210mm; height: 297mm; background: #fff; color: #000; position: relative; overflow: hidden;
  padding: 10mm 5mm 8mm 20mm; font-family: Sarabun, 'TH Sarabun New', sans-serif; font-size: 10pt; line-height: 1.3;
  margin: 0 auto 12px; box-shadow: 0 1px 6px rgba(0,0,0,.25); break-after: page; page-break-after: always;
}
.sheet h2 { font-size: 11pt; text-align: center; margin: 0 0 1mm; font-weight: 700; }
.sheet .sub { text-align: center; font-size: 9.5pt; margin-bottom: 1.5mm; }
.sheet table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.sheet th, .sheet td { border: .25mm solid #000; padding: 0 .5mm; text-align: center; overflow: hidden; font-weight: 400; }
.sheet th { font-weight: 700; font-size: 8pt; line-height: 1.15; }
.sheet .form td, .sheet .form th { height: 6.7mm; font-size: 8.5pt; white-space: nowrap; }
.sheet .form.tight td { height: 6.3mm; }
.sheet .form td.name { text-align: left; padding-left: 1mm; }
.sheet .form td.name.long { font-size: 7.5pt; }
.sheet .form .hd td, .sheet .form .hd th { height: auto; }
.sheet .v { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; white-space: nowrap; font-weight: 400; font-size: 7.5pt; }
.sheet .thick-l { border-left: .5mm solid #000; }
.sheet td.hol { background: #d4d6da; padding: 0; vertical-align: middle; }
.sheet td.hol .v { font-size: 7pt; }
.sheet td.we { background: #f2f3f4; }
.sheet th.narrow, .sheet td.narrow { font-size: 7pt; padding: 0; }
.sheet .foot { position: absolute; left: 20mm; right: 5mm; bottom: 3mm; font-size: 7pt; color: #555; display: flex; justify-content: space-between; }

/* ปก */
.cover { text-align: center; font-size: 11.5pt; }
.cover img { width: 24mm; display: block; margin: 0 auto 2mm; }
.cover h1 { font-size: 15pt; margin: 0 0 .5mm; }
.cover .line { margin: .5mm 0; }
.cover .row { display: flex; justify-content: space-between; text-align: left; margin: .5mm 0; }
.cover table { margin: 2.5mm 0; font-size: 10.5pt; }
.cover th, .cover td { height: 6.5mm; font-size: 10pt; font-weight: 400; }
.cover th { font-weight: 700; }
.sign { margin: 1mm 0; text-align: center; }
.sign .who { min-height: 5mm; }
.box { border: .25mm solid #000; padding: 2mm 3mm; text-align: center; }

/* ปกใน ตัวชี้วัด ปกหลัง */
.long-text { font-size: 10.5pt; text-indent: 12mm; white-space: pre-wrap; min-height: 80mm; border-bottom: .25mm dotted #000; margin-bottom: 4mm; line-height: 1.5; }
.ind td { text-align: left; font-size: 9pt; padding: .7mm 1mm; line-height: 1.25; white-space: normal; }
.ind td.c { text-align: center; }
.ind th { font-size: 8.5pt; }
.ind tr.gr td { font-weight: 700; }
.back { font-size: 10pt; }
.back .items { display: grid; grid-template-columns: 1fr 1fr; gap: .5mm 4mm; margin: 2mm 0 4mm; font-size: 9.5pt; }
.back table { margin-bottom: 4mm; }
.back td, .back th { font-size: 9pt; height: 6.5mm; }
.back h3 { font-size: 11pt; text-align: center; margin: 3mm 0 1.5mm; }

.letter { font-size: 13pt; line-height: 1.6; padding: 20mm 10mm 0; }
.letter p { text-indent: 12mm; margin: 0 0 3mm; }
.letter .no-indent { text-indent: 0; }
.letter ol { margin: 0 0 4mm; }
.letter .end { text-align: right; margin-top: 16mm; }

/* ตารางสอน */
.tt-block { margin-bottom: 9mm; }
.tt-head { display: flex; align-items: center; gap: 3mm; font-size: 10.5pt; margin-bottom: 1.5mm; }
.tt-head img { width: 13mm; height: auto; }
.sheet .tt-print { font-size: 8pt; line-height: 1.15; }
.sheet .tt-print th, .sheet .tt-print td { height: 15mm; font-size: 8pt; padding: .5mm; vertical-align: middle; white-space: normal; }
.sheet .tt-print tr:nth-child(-n+2) th { height: 6mm; }
.sheet .tt-print .tt-time { font-size: 6.5pt; font-weight: 400; }
.tt-sign { text-align: center; font-size: 9pt; margin-top: 2mm; }

#print-root { display: none; }

@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { background: #fff !important; height: auto; }
  #app, #toasts, .dialog-back { display: none !important; }
  #print-root { display: block !important; }
  .sheet { margin: 0; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
