/* Soạn bài trình chiếu (/cong-cu/trinh-chieu, /chieu). Tệp nạp ở mọi trang → mọi lớp có tiền tố tch-. */
.chinh:has(> .tch) { max-width: 1440px; }
.tch-an { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tch-dau { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.tch-dau h1 { margin: 0; }
.tch-dau .phu { margin: 2px 0 0; max-width: 640px; }
.tch-dau__phai { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.tch-chon { min-width: 220px; }
.tch-thanh { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.tch-ten { flex: 1 1 260px; }
.tch-thanh__nut { margin-left: auto; }
.tch-khung { display: grid; gap: 14px; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .tch-khung { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } .tch-xem { position: sticky; top: 72px; } }
.tch-nhan { font-weight: 700; display: block; margin-bottom: 6px; }
#tch-chu { width: 100%; min-height: 60vh; padding: 12px 14px; border: 1px solid #cfd6d1; border-radius: var(--r-nho); font: .95rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; resize: vertical; }
#tch-chu:focus { border-color: var(--c); outline: 3px solid var(--c-nhat); }
.tch-soan__chan { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 10px; }
.tch-hd { margin-top: 10px; }
.tch-hd summary { cursor: pointer; font-weight: 700; color: var(--c-dam); }
.tch-hd ul { margin: 6px 0 0; padding-left: 1.2em; }
.tch-hd li { margin-bottom: 4px; }
.tch-xem__dau { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tch-xem__dau .tch-nhan { margin: 0; }
.tch-so { font-weight: 700; color: var(--phu); min-width: 84px; text-align: center; }
.tch-khung-slide { position: relative; width: 100%; overflow: hidden; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); background: #fff; }
.tch-man--xem { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; }
.tch-man--xem .tch-slide { width: 1280px; height: 720px; padding: 40px 64px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.tch-ghi { margin: 8px 0 0; white-space: pre-line; }
.tch-ghi:empty { display: none; }

/* ── Chủ đề màu (dùng chung cho xem trước và reveal.js) ── */
.tch-chu-de--vien-sang { --tch-nen: #ffffff; --tch-chu: #1d2a2c; --tch-de: #093166; --tch-nhan: #c99434; --tch-lk: #1d4f91; --tch-o: #e8eff9; }
.tch-chu-de--vien-toi { --tch-nen: #093166; --tch-chu: #eef3fa; --tch-de: #ffffff; --tch-nhan: #f0be58; --tch-lk: #f0be58; --tch-o: rgba(255,255,255,.1); }
.tch-chu-de--tuong-phan { --tch-nen: #ffffff; --tch-chu: #000000; --tch-de: #000000; --tch-nhan: #000000; --tch-lk: #0000cc; --tch-o: #eeeeee; }
.tch-man--xem, .tch-reveal { background: var(--tch-nen); color: var(--tch-chu); }
.tch-chu-de--vien-toi.tch-man--xem, .tch-chu-de--vien-toi.tch-reveal { background: linear-gradient(160deg, #093166 0%, #031d42 100%); }
.tch-slide { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 34px; line-height: 1.4; text-align: left; color: var(--tch-chu); }
.tch-slide h1, .tch-slide h2, .tch-slide h3 { color: var(--tch-de); font-weight: 800; line-height: 1.15; margin: 0 0 .5em; text-transform: none; letter-spacing: 0; font-family: inherit; text-shadow: none; }
.tch-slide h1 { font-size: 72px; }
.tch-slide h2 { font-size: 52px; padding-bottom: 14px; border-bottom: 5px solid var(--tch-nhan); display: inline-block; }
.tch-slide h3 { font-size: 40px; }
.tch-slide p { margin: 0 0 .6em; }
.tch-slide ul, .tch-slide ol { margin: 0 0 .6em 1.1em; padding: 0; display: block; }
.tch-slide li { margin-bottom: .35em; }
.tch-slide li::marker { color: var(--tch-nhan); font-weight: 700; }
.tch-slide a { color: var(--tch-lk); }
.tch-slide strong { color: var(--tch-de); }
.tch-slide table { border-collapse: collapse; margin: .4em 0 .8em; font-size: .85em; }
.tch-slide th, .tch-slide td { border: 2px solid var(--tch-o); padding: 8px 18px; text-align: left; }
.tch-slide th { background: var(--tch-o); color: var(--tch-de); }
.tch-slide code { background: var(--tch-o); border-radius: 6px; padding: 2px 8px; font-size: .85em; }
.tch-slide pre { background: var(--tch-o); border-radius: 10px; padding: 16px 20px; font-size: .7em; overflow: auto; margin: 0 0 .6em; box-shadow: none; width: auto; }
.tch-slide pre code { background: none; padding: 0; max-height: none; }
.tch-slide blockquote { margin: 0 0 .6em; padding: 10px 24px; border-left: 8px solid var(--tch-nhan); background: var(--tch-o); width: auto; box-shadow: none; font-style: normal; }
.tch-slide img { max-width: 100%; max-height: 480px; }
.tch-slide .katex-display { margin: .4em 0; align-self: stretch; }
.tch-slide table, .tch-slide pre, .tch-slide blockquote { align-self: flex-start; }
.tch-slide p, .tch-slide ul, .tch-slide ol { align-self: stretch; }
.tch-slide.tch-bia { text-align: center; align-items: center; }
.tch-slide.tch-bia h1 { font-size: 80px; padding-bottom: 24px; border-bottom: 6px solid var(--tch-nhan); }
.tch-slide.tch-bia p { font-size: 38px; opacity: .9; }

/* ── Trang chiếu (che_do chieu) ── */
.chinh:has(> .tch-chieu) { padding: 0 !important; max-width: none; }
body:has(.tch-chieu) { margin: 0; overflow: hidden; background: #031d42; }
body:has(.tch-chieu) .skip { display: none; }
.tch-chieu { position: fixed; inset: 0; }
.tch-reveal { width: 100%; height: 100%; }
.tch-reveal .slides section.tch-slide { padding: 20px 40px; box-sizing: border-box; }
.tch-reveal .slides section.tch-slide.tch-bia h1 { display: inline-block; }
.tch-reveal.reveal .slide-number { background: transparent; color: var(--tch-chu); font-size: 16px; }
.tch-reveal.reveal .controls { color: var(--tch-nhan); }
.tch-reveal.reveal .progress { color: var(--tch-nhan); }
.tch-thoat { position: fixed; top: 10px; left: 12px; z-index: 40; font-size: .8125rem; color: #fff !important; background: rgba(3,29,66,.55); padding: 6px 12px;
  border-radius: 999px; text-decoration: none; opacity: .2; transition: opacity .2s; }
.tch-thoat:hover, .tch-thoat:focus { opacity: 1; }
.tch-khong { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; color: #fff; }
.tch-khong[hidden] { display: none; }
.tch-khong p { max-width: 560px; }
@media print { .tch-thoat { display: none !important; } body:has(.tch-chieu) { overflow: visible; background: #fff; } .tch-chieu { position: static; } }

@media (max-width: 640px) {
  .tch-dau__phai { width: 100%; }
  .tch-chon { flex: 1 1 100%; min-width: 0; }
  .tch-thanh__nut { margin-left: 0; }
  #tch-chu { min-height: 45vh; }
}
