/* ===== Giao diện "Sổ tay coach" (chốt 14/11/2026). Phần đầu: bỏ các chi tiết nhận diện cũ ===== */

/* Nhãn: chữ thường đậm + một nét đỏ mảnh, không viết hoa giãn chữ, không phông máy chữ */
.eyebrow, .lesson-head .num, .side h2, .side .part, .s-eyebrow {
  font-family: var(--sans) !important; text-transform: none !important; letter-spacing: 0 !important;
}
.eyebrow { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--red); }
.lesson-head .num { font-size: 14px; font-weight: 700; }
.lesson-head .mins, .chapters summary .cnt, .quote cite, .brand .sub { font-family: var(--sans) !important; letter-spacing: 0; }
.side h2 { font-size: 13px; font-weight: 700; }
.side .part { font-size: 13px; font-weight: 700; }

/* Từ khóa: giữ vệt mờ dưới chữ như bản gốc (Donnie chọn, 14/11/2026) */

/* Prompt: thẻ sáng, viền vàng bên trái, chữ prompt vẫn dùng phông mono */
.prompt {
  background: var(--card); color: var(--text); box-shadow: none;
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0;
}
.prompt-head {
  font: 700 14px var(--sans); letter-spacing: 0; text-transform: none; color: var(--navy);
  border-bottom: 1px solid var(--line); background: var(--gold-bg);
}
.prompt-head .ma-p { color: var(--gold-text); font-weight: 600; }
.prompt pre { color: var(--text); }
.prompt pre .ph { color: var(--red); background: var(--red-50); border-radius: 3px; padding: 0 2px; }
.prompt .after { color: var(--muted); }
.copy { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.copy:hover { background: var(--btn); opacity: .9; }
.copy.done { background: var(--green); color: #fff; }

/* Mốc thời gian: nhãn vuông nền đỏ nhạt thay cho viên thuốc viền đỏ */
.ts { border-radius: 4px; border: 0; background: var(--red-50); font-family: var(--sans); font-weight: 700; padding: 3px 8px 3px 6px; }

/* Thẻ: phẳng, góc nhỏ hơn, không bóng mờ */
.card, .chapters, .video-frame { box-shadow: none; }
:root { --radius: 8px; }
.btn { border-radius: 8px; }
.chip { border-radius: 6px; }

/* ===== Phương án B · Sổ tay coach ===== */
:root { --bg: #EFEDEB; --side-w: 256px; }
:root[data-theme="dark"] { --bg: #0B0A1F; }

/* Cột lộ trình bên trái, thu gọn được */
.pa-b .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1360px; transition: grid-template-columns .3s var(--ease); }
.pa-b .side { background: var(--bg); padding: 18px 14px 32px 18px; font-size: 14px; }
.pa-b .side .part { margin: 16px 0 4px; font-size: 12px; }
.pa-b .side a { font-size: 13.5px; line-height: 1.4; }
.pa-b main { padding-top: 24px; }
.side-collapse {
  margin-left: auto; width: 28px; height: 28px; border-radius: 6px; flex: none;
  display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.side-collapse:hover { background: var(--soft); color: var(--navy); }
.side-expand:hover { border-color: var(--gold); }
.side-collapse svg { width: 16px; height: 16px; }
.side-expand svg { width: 16px; height: 16px; }
.pa-b .side { position: sticky; }
.side-head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sh-title { font: 700 14px var(--sans); color: var(--navy); }
.side-expand {
  display: none; position: fixed; top: 80px; left: 12px; z-index: 39; height: 38px; padding: 0 12px 0 8px; gap: 6px;
  align-items: center; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--navy);
  font: 700 13px var(--sans); cursor: pointer;
}
body.pa-b.side-collapsed .shell { grid-template-columns: 0 minmax(0, 1fr); }
body.pa-b.side-collapsed .side { visibility: hidden; padding-left: 0; padding-right: 0; border: 0; }
body.pa-b.side-collapsed .side-expand { display: inline-flex; }
body.pa-b.side-collapsed .video-frame.floating { inset: auto auto 20px 20px; width: min(360px, calc(100vw - 32px)); }
body.presenting .side-expand { display: none !important; }

/* Vòng tiến độ */
.ring-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ring { width: 18px; height: 18px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 6; }
.r-bg { stroke: var(--soft); }
.r-fg { stroke: var(--green); stroke-dasharray: 0 100; stroke-linecap: round; transition: stroke-dasharray .5s; }
.pa-b .side .side-meta .bar, .pa-b #readCount { display: none; }
.side-video { width: 100%; }
body.docked .side-video { aspect-ratio: 16 / 9; margin-bottom: 14px; }

/* Lộ trình bậc thang: một đường dọc, mỗi bài là một nấc */
.pa-b .side ol { position: relative; margin-left: 6px; }
.pa-b .side ol::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.pa-b .side a { grid-template-columns: 16px 22px 1fr; padding: 6px 8px 6px 0; border-radius: 0; }
.pa-b .side a .ck { grid-column: 1; grid-row: 1; position: relative; z-index: 1; margin-top: 5px; background: var(--bg); border-width: 2px; }
.pa-b .side a .n { grid-column: 2; grid-row: 1; font-family: var(--sans); font-weight: 700; }
.pa-b .side a > span:nth-child(2) { grid-column: 3; grid-row: 1; }
.pa-b .side a:hover { background: none; color: var(--navy); }
.pa-b .side a.active { background: none; box-shadow: none; }
.pa-b .side a.active .ck { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 3px var(--bg); }
.pa-b .side a.done .ck { box-shadow: inset 0 0 0 2px var(--bg); }

/* Mỗi bài là một trang sổ */
.pa-b .wrap { max-width: 880px; }
.pa-b .lesson {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 40px clamp(20px, 5vw, 56px) 32px; margin: 18px 0;
}
.pa-b .lesson-head { position: relative; padding-left: 136px; min-height: 76px; }
.pa-b .lesson-head::before {
  content: attr(data-n); position: absolute; left: 0; top: 0; width: 108px; padding-right: 18px;
  border-right: 1.5px solid var(--gold-300); text-align: left;
  font: 800 60px/1 var(--sans); letter-spacing: -.03em; color: transparent; -webkit-text-stroke: 1.5px var(--gold);
}
.pa-b .lesson-head .num { color: var(--muted); }

/* Đầu phần: dải ngang navy */
.pa-b .part-head {
  margin: 56px 0 0; padding: 18px 24px; border: 0; border-radius: 4px; background: var(--navy); color: #fff;
  display: flex; align-items: baseline; gap: 14px;
}
.pa-b .part-head::before { content: attr(data-n); font: 800 34px/1 var(--sans); color: var(--gold); }
.pa-b .part-head .eyebrow { color: var(--gold-300); margin: 0; }
.pa-b .part-head .eyebrow::before { background: var(--gold-300); }
.pa-b .part-head h2 { color: #fff; font-size: 22px; font-weight: 800; }
:root[data-theme="dark"] .pa-b .part-head { background: #1F1D45; }

/* Câu hỏi coach và ô Tự vấn */
.coach-q { border-left: 0 !important; padding: 18px 20px !important; background: var(--navy-50); border-radius: 4px; }
.coach-q::before { content: "Câu hỏi cho bạn"; display: block; font: 700 13px var(--sans); color: var(--red); margin-bottom: 6px; }
.note-box { margin: 14px 0 4px; border: 1px dashed var(--gold); border-radius: 4px; background: var(--gold-bg); }
.note-box summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.note-box summary::-webkit-details-marker { display: none; }
.nb-tag { font: 700 12px var(--sans); color: #fff; background: var(--gold-text); padding: 2px 8px; border-radius: 3px; flex: none; }
.nb-q { font-weight: 600; color: var(--navy); font-size: 15px; }
.note-box textarea {
  display: block; width: calc(100% - 28px); margin: 0 14px 6px; padding: 10px 12px; resize: vertical;
  font: 400 16px/1.6 var(--sans); color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  background-image: repeating-linear-gradient(transparent, transparent 25px, var(--line) 25px, var(--line) 26px); background-attachment: local; line-height: 26px;
}
.note-box textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.nb-saved { display: block; font-size: 12px; color: var(--green); padding: 0 14px 10px; min-height: 18px; }

/* Video về nằm trên đầu cột phải */
.pa-b .video-frame.floating { position: fixed; inset: auto; height: auto; aspect-ratio: 16 / 9; border-radius: 4px; animation: none; z-index: 45; }
.pa-b .video-frame.floating .float-close { top: 4px; right: 4px; width: 24px; height: 24px; line-height: 24px; font-size: 14px; }
@media (max-width: 1020px) {
  .pa-b .shell { grid-template-columns: minmax(0, 1fr); }
  .side-collapse, .side-expand { display: none !important; }
  .pa-b .video-frame.floating { inset: auto 12px 12px auto; width: min(360px, calc(100vw - 24px)); }
  .pa-b .lesson-head { padding-left: 0; padding-top: 64px; }
  .pa-b .lesson-head::before { font-size: 46px; width: auto; border-right: 0; padding-right: 0; }
}

/* Cột trái gọn hơn (14/11/2026) */
.pa-b .side .side-meta { display: none; }
.pa-b .side a { padding: 5px 6px 5px 0; }
.side-expand { height: 32px; padding: 0 10px 0 6px; font-size: 12px; color: var(--muted); background: var(--bg); }
.side-expand:hover { color: var(--navy); }

/* Điện thoại: video thành dải dính ngay dưới thanh trên cùng, không nổi ở góc */
@media (max-width: 1020px) {
  .pa-b .video-frame.floating {
    position: fixed; inset: 64px 0 auto 0; width: 100vw; height: auto; aspect-ratio: 16 / 9;
    border-radius: 0; border: 0; border-bottom: 2px solid var(--gold); z-index: 42; animation: none;
  }
  .pa-b .video-frame.floating .float-close { top: 6px; right: 6px; }
}
.side-collapse svg { width: 18px; height: 18px; }


/* Vệt mờ dáng riêng: nghiêng nhẹ, hai đầu bo tròn, vẫn quét màu khi hiện ra (14/11/2026) */
.nhan {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M10 14 C4 14 2 17 3 21 L5 31 C6 35 8 37 13 37 L191 33 C197 33 199 30 198 26 L196 16 C195 12 193 10 188 10 Z' fill='rgba%28215%2C194%2C152%2C0.62%29'/%3E%3C/svg%3E") !important;
  background-position: 0 100% !important; background-repeat: no-repeat !important;
  padding: 0 .14em; margin: 0 -.04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.nhan, .reveal.in .nhan { background-size: 100% 62%; }
.reveal .nhan, .stage .beat-in .nhan { background-size: 0% 62%; }
@keyframes sweep { from { background-size: 0% 62%; } to { background-size: 100% 62%; } }
:root[data-theme="dark"] .nhan { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M10 14 C4 14 2 17 3 21 L5 31 C6 35 8 37 13 37 L191 33 C197 33 199 30 198 26 L196 16 C195 12 193 10 188 10 Z' fill='rgba%28201%2C148%2C46%2C0.42%29'/%3E%3C/svg%3E") !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nhan { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M10 14 C4 14 2 17 3 21 L5 31 C6 35 8 37 13 37 L191 33 C197 33 199 30 198 26 L196 16 C195 12 193 10 188 10 Z' fill='rgba%28201%2C148%2C46%2C0.42%29'/%3E%3C/svg%3E") !important; } }
@media (prefers-reduced-motion: reduce) { .nhan { background-size: 100% 62% !important; } }

/* Chữ trong prompt: Courier New, cỡ nhỏ cho đỡ thô (14/11/2026) */
.prompt pre { font-family: "Courier New", Courier, monospace; font-size: 13.5px; line-height: 1.7; }
.stage .prompt pre { font-family: "Courier New", Courier, monospace; font-size: 21px; }
code { font-family: "Courier New", Courier, monospace; font-size: .9em; }

/* Điện thoại: nút mở lộ trình ở góc dưới bên phải, vừa tầm ngón cái */
.side-fab { display: none; }
@media (max-width: 1020px) {
  .pa-b .side-toggle { display: none !important; }
  .side-fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 52;
    align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 12px; border: 0; border-radius: 23px;
    background: var(--navy); color: #fff; font: 700 14px var(--sans); cursor: pointer;
    box-shadow: 0 10px 24px -12px rgba(11,10,31,.6);
  }
  :root[data-theme="dark"] .side-fab { color: #1A1743; }
  .side-fab svg { width: 18px; height: 18px; }
  .side-fab .fab-n { font-weight: 500; opacity: .75; }
  body.side-open .side-fab { background: var(--red); }
  .pa-b .side { position: fixed; top: auto; bottom: 0; height: min(78vh, 640px); padding-bottom: 80px; border-radius: 0 12px 0 0; }
}
body.presenting .side-fab { display: none !important; }

/* Prompt: chữ Courier New đậm, nền vàng rất nhạt, nhạt hơn dải tiêu đề prompt (14/11/2026) */
:root { --prompt-bg: #FDFAF2; }
:root[data-theme="dark"] { --prompt-bg: #1F1B36; }
.prompt { background: var(--prompt-bg); }
.prompt pre { font-weight: 700; }

/* Phông tiêu đề riêng: Bricolage Grotesque (Donnie chọn 14/11/2026). Thân bài giữ Be Vietnam Pro theo nhận diện MAROTA */
:root { --display: "Bricolage Grotesque", "Be Vietnam Pro", system-ui, sans-serif; }
.pa-b .hero h1, .pa-b .lesson h2.lt, .pa-b .part-head h2, .pa-b .lesson h3, .pa-b .sh-title {
  font-family: var(--display); letter-spacing: -.012em;
}
.pa-b .hero h1, .pa-b .lesson h2.lt { font-weight: 800; }
.pa-b .lesson h3 { font-weight: 700; }
.pa-b .lesson-head::before, .pa-b .part-head::before { font-family: var(--display); letter-spacing: -.02em; }

/* Nhãn thẻ, cấp độ, phòng: chữ thường phông thân bài, bỏ kiểu chữ hoa mono (14/11/2026) */
.pa-b .card .tag, .pa-b .level .lv, .pa-b .room .tag {
  font: 700 12.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--red);
}
.pa-b .fc .hint { font: 600 12.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--gold-text); }
/* Dòng kẻ ô Tự vấn: dời xuống đúng bằng lề trên để chữ nằm trên dòng, không bị gạch ngang (14/11/2026) */
.note-box textarea { background-position: 0 10px; }
/* Số thứ tự công thức, nhãn thanh lô hàng: bỏ phông mono (14/11/2026) */
.pa-b .formula > div::before { font: 700 13px var(--sans); }
.pa-b .lot .lot-bar span, .pa-b .lot .lot-cap { font-family: var(--sans); }

/* ---------- Thời hạn xem khóa (dung_trang.py thêm khi thong-tin.json có "het_han") ---------- */
.han-xem { display: block; position: sticky; top: 64px; z-index: 39;
  padding: 6px 16px; background: var(--gold-bg); border-bottom: 1px solid var(--line);
  font: 500 13px/1.5 var(--sans); color: var(--gold-text); text-align: center; }
.han-xem svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }
.han-xem b { font-weight: 700; color: var(--navy); }
.han-xem .han-con:empty { display: none; }
/* Đếm ngược nhẹ nhàng: chữ nhỏ cùng dòng, số khẽ lật khi đổi */
.han-con { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.han-con::before { content: "·"; margin: 0 6px; color: var(--gold); }
.han-con span { display: inline-block; }
.han-con .lat { animation: dh-mo .6s ease-out; }
@keyframes dh-mo { from { opacity: .15; } to { opacity: 1; } }
/* Dải dính ngay dưới thanh trên cùng khi cuộn: đẩy cột Lộ trình và chỗ dừng khi bấm mục lục xuống theo chiều cao dải (--han-h do JS đo) */
html:has(.han-xem) { scroll-padding-top: calc(84px + var(--han-h, 33px)); }
@media (min-width: 1021px) {
  body:has(.han-xem) .side { top: calc(64px + var(--han-h, 33px)); height: calc(100vh - 64px - var(--han-h, 33px)); }
}
body:has(.han-xem) .side-expand { top: calc(80px + var(--han-h, 33px)); }
@media (prefers-reduced-motion: reduce) { .han-con .lat { animation: none; } }
.han-ngan { display: none; }
.buoi-switch:empty { display: none !important; }
.han-xem .han-ngay { color: var(--navy); font-weight: 800; padding: 0 2px;
  background: linear-gradient(transparent 55%, rgba(201, 148, 46, .38) 55%, rgba(201, 148, 46, .38) 92%, transparent 92%); }
:root[data-theme="dark"] .han-xem .han-ngay { background: linear-gradient(transparent 55%, rgba(215, 174, 92, .35) 55%, rgba(215, 174, 92, .35) 92%, transparent 92%); }
@media (max-width: 560px) { .han-xem { font-size: 12.5px; padding: 5px 12px; } .han-dai { display: none; } .han-ngan { display: inline; } }
.het-han-man { display: none; }
html[data-het-han] body > :not(.het-han-man) { display: none !important; }
html[data-het-han] .het-han-man { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg); }
.het-han-o { max-width: 600px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: 4px; padding: 36px 40px 30px; box-shadow: var(--shadow); }
.het-han-o img { width: 120px; height: auto; margin: 0 0 6px -8px; display: block; }
@media (max-width: 560px) { .het-han-o { padding: 28px 22px 22px; } }
.het-han-o h1 { font: 800 clamp(28px, 5vw, 40px)/1.15 "Bricolage Grotesque", var(--sans); color: var(--navy); margin: 10px 0 14px; letter-spacing: -.01em; }
.het-han-o p { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0 0 14px; }
.het-han-o p b { color: var(--navy); }
.het-han-o .het-han-ky { margin: 18px 0 0; color: var(--navy); font-weight: 600; }
.het-han-o .het-han-nhan { color: var(--navy); font-weight: 700; font-size: 17px; }
.het-han-o .het-han-hoi { margin-top: 22px; padding: 16px 18px; background: var(--navy-50); border-radius: 4px; color: var(--navy); font-weight: 600; text-align: left; }
.het-han-o .het-han-hoi::before { content: "Câu hỏi cho bạn"; display: block; font: 700 13px var(--sans); color: var(--red); margin-bottom: 4px; }

/* ---------- Khối mời sang khóa trả phí (dung_trang.py thêm khi thong-tin.json có "cta") ---------- */
.cta-khoa { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 8px 24px; align-items: end;
  margin: 28px 0 8px; padding: 30px 32px 0; background: var(--navy); color: #fff; border-radius: 6px; overflow: hidden; }
.cta-khoa::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gold); }
.cta-chu { padding-bottom: 30px; }
.cta-khoa .eyebrow { color: var(--gold-300); margin: 0 0 10px; }
.cta-khoa .eyebrow::before { background: var(--gold-300); }
.cta-khoa h3 { margin: 0 0 10px; font: 800 28px/1.18 "Bricolage Grotesque", var(--sans); color: #fff; letter-spacing: -.01em; text-wrap: balance; }
.cta-khoa h3 .nhan { color: #fff; }
.cta-khoa p { margin: 0 0 14px; color: #D9D7EA; font-size: 16px; line-height: 1.6; }
.cta-ct { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cta-ct li { font: 600 13.5px var(--sans); color: #fff; padding: 5px 11px; border: 1px solid rgba(215, 194, 152, .45); border-radius: 99px; }
.cta-nut { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: #1A1743; border: 0; font-weight: 700; }
.cta-nut span { transition: transform .2s var(--ease); }
.cta-nut:hover { background: #D7AE5C; color: #1A1743; }
.cta-nut:hover span { transform: translateX(4px); }
.cta-hinh { width: 200px; height: auto; align-self: end; display: block; }
:root[data-theme="dark"] .cta-khoa { background: #22205A; }
@media (max-width: 640px) {
  .cta-khoa { display: block; padding: 24px 18px 0; }
  .cta-chu { padding-bottom: 22px; }
  .cta-khoa h3 { font-size: 23px; }
  .cta-nut { max-width: calc(100% - 84px); }
  .cta-hinh { position: absolute; right: 4px; bottom: 0; width: 84px; }
}

/* Logo Coach Donnie (thay logo MAROTA và ảnh đại diện, 14/11/2026) */
.logo-cd { display: inline-flex; flex-direction: column; line-height: 1; font-family: var(--sans); font-size: 19px; letter-spacing: .02em; color: var(--navy); white-space: nowrap; }
.logo-cd .logo-main span { font-weight: 300; opacity: .72; }
.logo-cd .logo-main b { font-weight: 800; }
.logo-cd small { font-size: 10.5px; font-weight: 300; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.stage-foot .logo-cd { font-size: 16px; color: inherit; }
@media (max-width: 420px) { .logo-cd { font-size: 16px; } }
.brand .brand-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
