/* คู่มือหลักสูตร — หน้าจอ + พิมพ์ A4 */
.hb-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:20px 0}
.hb{max-width:900px;margin:0 auto 60px;padding:0 16px;font-size:15.5px}
.hb-cover{min-height:70vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;
  background:linear-gradient(160deg,#0f2a5c,#173a7a 60%,#2453b3);color:#fff;border-radius:20px;padding:48px 28px;margin-bottom:28px}
.hb-logo{width:150px;height:150px;border-radius:50%;background:#fff;object-fit:contain;margin-bottom:12px}
.hb-kicker{color:var(--gold-2);font-weight:600;letter-spacing:.04em;margin:0}
.hb-cover h1{font-size:clamp(1.6rem,4vw,2.4rem);margin:0}
.hb-en{opacity:.85;margin:0}.hb-ver{font-family:var(--head);font-size:1.15rem;color:var(--gold-2);margin:8px 0}
.hb-stripes{display:flex;gap:6px;margin:10px 0}.hb-stripes i{width:44px;height:8px;border-radius:4px;display:block}
.hb-org{margin:6px 0 0}.hb-note{font-size:.8rem;opacity:.7;max-width:520px;margin-top:18px}
.hb-sec{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:28px;margin-bottom:22px}
.hb-sec h2{display:flex;align-items:center;gap:12px;font-size:1.45rem;border-bottom:3px solid var(--gold);padding-bottom:10px;margin-bottom:16px}
.hb-no{background:var(--navy);color:var(--gold-2);width:38px;height:38px;border-radius:10px;display:grid;place-items:center;font-size:1.1rem;flex:none}
.hb-sec h3{font-size:1.1rem;margin:18px 0 8px;color:var(--navy)}
:root[data-theme="dark"] .hb-sec h3{color:var(--gold-2)}
.hb-toc ol{columns:2;column-gap:32px;margin:0;padding-left:22px}.hb-toc li{margin:4px 0;break-inside:avoid}
.hb-quote{border-left:4px solid var(--gold);padding:8px 14px;background:var(--surface-2);border-radius:8px}
.hb-tbl{width:100%;border-collapse:collapse;font-size:.92rem;margin:6px 0 10px}
.hb-tbl th,.hb-tbl td{border:1px solid var(--line);padding:6px 10px;text-align:left;vertical-align:top}
.hb-tbl thead th{background:var(--navy);color:#fff;font-weight:600}
.hb-tbl caption{text-align:left;font-weight:600;padding:4px 0;color:var(--blue)}
.hb-tbl .r{text-align:right;white-space:nowrap}.hb-tbl .code{white-space:nowrap;font-variant-numeric:tabular-nums}
.hb-tbl tr.grp td{font-weight:600;background:var(--surface-2)}.hb-tbl td.ind{padding-left:28px}
.hb-tbl tr.tot td{font-weight:700;background:rgba(242,183,5,.18)}
.hb-tbl.kv th{width:28%;background:var(--surface-2);color:var(--text)}
.hb-plos{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hb-plo{border:1px solid var(--line);border-radius:10px;padding:10px 12px;break-inside:avoid}
.hb-plo b{color:var(--blue);font-family:var(--head);margin-right:8px}.hb-plo p{margin:6px 0 0}
.hb-terms{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.hb-year{break-inside:avoid}
.hb-mods{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.hb-mod{border:1px solid var(--line);border-radius:10px;padding:10px 14px;break-inside:avoid}.hb-mod h3{margin-top:4px}
.hb-cg{border-left:5px solid var(--navy);padding-left:10px;margin-top:22px!important}
.hb-course{padding:10px 0;border-bottom:1px dashed var(--line);break-inside:avoid}
.hb-ch{display:flex;gap:10px;align-items:baseline}.hb-ch .code{font-weight:600;color:var(--blue);min-width:74px}.hb-ch .r{margin-left:auto;white-space:nowrap;color:var(--muted)}
.hb-cen{color:var(--muted);font-size:.88rem;margin-left:84px}
.hb-pre{font-size:.85rem;color:#9b1c13;margin-left:84px}
.hb-course p{margin:4px 0 0 84px}.hb-den{color:var(--muted);font-size:.86rem;font-style:italic}
.hb-agencies{display:grid;grid-template-columns:1fr 1fr;gap:12px}.hb-agencies ul{padding-left:18px;margin:0}.hb-agencies li{margin:4px 0}
.hb-small{font-size:.85rem;color:var(--muted)}.hb-link{word-break:break-all}
@media (max-width:700px){.hb-plos,.hb-terms,.hb-mods,.hb-agencies{grid-template-columns:1fr}.hb-toc ol{columns:1}.hb-cen,.hb-pre,.hb-course p{margin-left:0}.hb-sec{padding:18px}}

@page{size:A4;margin:16mm 14mm}
@media print{
  :root{--surface:#fff;--surface-2:#f2f4f9;--text:#111;--muted:#555;--line:#cfd5e2}
  body{background:#fff!important;font-size:12.5px}
  .site-header,.site-footer,.no-print,.demo-bar,.skip,#toasts{display:none!important}
  .hb{max-width:none;padding:0;margin:0}
  .hb-cover{min-height:255mm;border-radius:0;margin:0;break-after:page;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .hb-sec{border:0;padding:0;margin:0 0 8mm;border-radius:0}
  .hb-toc{break-after:page}
  #plan,#courses,#faculty{break-before:page}
  .hb-tbl thead th,.hb-no,.hb-tbl tr.tot td,.hb-tbl tr.grp td,.hb-stripes i{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  a{color:inherit;text-decoration:none}
  .hb-sec h2,.hb-sec h3,.hb-cg{break-after:avoid;page-break-after:avoid}
  .hb-sec>p:first-of-type{break-before:avoid}
  .hb-plos,.hb-terms,.hb-mods{gap:6px}
}
@media print{
  .hb-year{break-inside:auto}
  .hb-year:not(:first-of-type){break-before:page}
  .hb-year h3{margin-top:0;padding-top:4mm;line-height:1.5;break-after:auto}
  .hb-sec h2{padding-top:3mm}
  .hb-terms{display:grid;grid-template-columns:1fr 1fr;gap:4mm}
}
