/* MAROTA · Trang bài học đi kèm video
   Màu theo MAROTA Brand-Color v1.1 (tokens/marota-tokens.json):
   nền sáng, navy là chữ, đỏ chỉ là nét mảnh, vàng đồng là điểm nhấn. */

:root {
  --bg: #F8F7F6;
  --card: #FFFFFF;
  --soft: #EFEDEB;
  --line: #DBD9D6;
  --text: #262626;
  --muted: #545454;
  --navy: #1A1743;
  --navy-50: #F3F3F7;
  --navy-100: #E1E0EB;
  --red: #990001;
  --red-50: #F9F0F0;
  --gold: #C9942E;
  --gold-300: #D7C298;
  --gold-text: #85621E;
  --gold-bg: #FBF6E8;
  --green: #2F7A55;
  --green-bg: #F1F8F4;
  --green-line: #CFE4D8;
  --hl: rgba(215, 194, 152, .55);
  --code-bg: #1A1743;
  --code-text: #EDEBF5;
  --btn: #1A1743;
  --btn-text: #FFFFFF;
  --shadow: 0 1px 2px rgba(26, 23, 67, .05), 0 8px 24px -12px rgba(26, 23, 67, .18);
  --radius: 14px;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --side-w: 280px;
  color-scheme: light;
}

/* Chế độ tối: nền navy sâu, chữ sáng, vàng đồng làm điểm nhấn */
  :root[data-theme="dark"] {
    --bg: #100E2A; --card: #18163A; --soft: #1F1D45; --line: #2E2C5A;
    --text: #EDEBF5; --muted: #B4B1CC; --navy: #E9E7F7; --navy-50: #1D1B42; --navy-100: #2B2960;
    --red: #E07A7B; --red-50: #2A1830; --gold: #D7AE5C; --gold-300: #8C7440; --gold-text: #E6C27A; --gold-bg: #2A2433;
    --green: #6CC596; --green-bg: #15282A; --green-line: #24493E;
    --hl: rgba(201, 148, 46, .38); --code-bg: #0B0A1F; --code-text: #EDEBF5;
    --btn: #E9E7F7; --btn-text: #1A1743;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
:root[data-theme="dark"] {
  --bg: #100E2A; --card: #18163A; --soft: #1F1D45; --line: #2E2C5A;
  --text: #EDEBF5; --muted: #B4B1CC; --navy: #E9E7F7; --navy-50: #1D1B42; --navy-100: #2B2960;
  --red: #E07A7B; --red-50: #2A1830; --gold: #D7AE5C; --gold-300: #8C7440; --gold-text: #E6C27A; --gold-bg: #2A2433;
  --green: #6CC596; --green-bg: #15282A; --green-line: #24493E;
  --hl: rgba(201, 148, 46, .38); --code-bg: #0B0A1F; --code-text: #EDEBF5;
  --btn: #E9E7F7; --btn-text: #1A1743;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
strong, b { font-weight: 700; color: var(--navy); }
code { font: 500 .88em var(--mono); background: var(--navy-50); border: 1px solid var(--navy-100); padding: .08em .4em; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* Highlight kiểu bút dạ quang, quét màu khi xuất hiện */
.nhan {
  background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%) no-repeat;
  background-size: 100% 100%; padding: 0 .1em;
}
.reveal .nhan, .stage .beat-in .nhan { background-size: 0% 100%; }
.reveal.in .nhan, .stage .beat-in.pop .nhan, .stage .beat-in .nhan { animation: sweep .9s var(--ease) .25s both; }
@keyframes sweep { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

/* ---------- Thanh trên cùng ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.brand .wm { font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand .wm i { font-style: normal; color: var(--red); }
.brand .sub { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sp { flex: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--navy); cursor: pointer;
}
.icon-btn:hover { border-color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; }
.side-toggle { display: none; }
.read-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--red); transition: width .15s linear; }

/* ---------- Khung trang ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.side {
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
  padding: 28px 18px 40px 20px; border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.side h2 { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.side .part { margin: 22px 0 6px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.side ol { list-style: none; padding: 0; margin: 0; }
.side a {
  display: grid; grid-template-columns: 26px 1fr 16px; align-items: start; gap: 6px;
  padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 14px; line-height: 1.45;
}
.side a .n { font: 600 12px/1.9 var(--mono); color: var(--muted); }
.side a .ck { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--line); }
.side a.done .ck { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 2px var(--card); }
.side a:hover { background: var(--soft); }
.side a.active { background: var(--navy-50); color: var(--navy); font-weight: 600; box-shadow: inset 2px 0 0 var(--red); }
.side .side-meta { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.side .side-meta .bar { height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; margin: 8px 0 4px; }
.side .side-meta .bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .4s var(--ease); }

main { min-width: 0; padding: 0 clamp(16px, 4vw, 56px) 120px; }
.wrap { max-width: 760px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 28px; }
.eyebrow { font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin: 0 0 14px; }
.hero h1 {
  font-weight: 800; font-size: clamp(36px, 6vw, 60px); line-height: 1.06; letter-spacing: -.025em;
  color: var(--navy); margin: 0 0 18px;
}
.hero .lead { font-size: 19px; color: var(--muted); margin: 0 0 22px; max-width: 640px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font: 500 13px var(--sans); color: var(--muted);
}
.chip svg { width: 14px; height: 14px; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  font: 600 15px var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s var(--ease), box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:hover { box-shadow: 0 8px 22px -10px rgba(26,23,67,.6); }
.btn-ghost { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Video và chương ---------- */
.video-block { margin: 8px 0 12px; }
.video-slot { position: relative; aspect-ratio: 16 / 9; }
.video-frame {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; background: #0B0A1F;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.video-frame iframe, .video-frame #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame.floating {
  position: fixed; inset: auto 20px 20px auto; width: min(400px, calc(100vw - 32px)); aspect-ratio: 16/9;
  z-index: 60; animation: floatIn .35s var(--ease);
}
@keyframes floatIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.float-close {
  display: none; position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 16px; line-height: 30px;
}
.video-frame.floating .float-close { display: block; }
.video-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #EDEBF5;
  background: radial-gradient(120% 120% at 20% 10%, #2B2960 0%, #1A1743 50%, #0B0A1F 100%);
}
.video-fallback .play {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px;
  background: #fff; color: #1A1743; box-shadow: 0 0 0 10px rgba(255,255,255,.12);
}
.video-fallback h3 { margin: 0 0 6px; font-size: 20px; color: #fff; }
.video-fallback p { margin: 0 0 14px; color: #B4B1CC; font-size: 14px; }
.video-fallback .btn { background: #fff; color: #1A1743; }
.video-fallback[hidden] { display: none; }
.video-note { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }

.chapters { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.chapters summary {
  list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--navy);
}
.chapters summary::-webkit-details-marker { display: none; }
.chapters summary .cnt { font: 500 12px var(--mono); color: var(--muted); }
.chapters summary .chev { margin-left: auto; transition: transform .25s var(--ease); }
.chapters[open] summary .chev { transform: rotate(180deg); }
.chapters ol { list-style: none; margin: 0; padding: 0 8px 10px; max-height: 360px; overflow-y: auto; }
.chapters li button {
  width: 100%; display: grid; grid-template-columns: 70px 1fr; gap: 8px; text-align: left;
  padding: 7px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: 400 14px/1.5 var(--sans); color: var(--text);
}
.chapters li button:hover { background: var(--soft); }
.chapters li button .t { font: 600 12px/1.9 var(--mono); color: var(--red); }
.chapters li.now button { background: var(--navy-50); font-weight: 600; color: var(--navy); }

/* ---------- Bài (lesson) ---------- */
.part-head { margin: 76px 0 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.part-head .eyebrow { margin-bottom: 4px; }
.part-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }

.lesson { padding: 34px 0 10px; }
.lesson-head { margin-bottom: 18px; }
.lesson-head .lab { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.lesson-head .num { font: 600 12px var(--mono); letter-spacing: .1em; color: var(--red); text-transform: uppercase; }
.lesson-head .mins { font: 500 12px var(--mono); color: var(--muted); }
.lesson h2.lt {
  font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.02em; color: var(--navy); margin: 0 0 10px;
}
.lesson .summary { font-size: 18px; color: var(--muted); margin: 0; }

.ts {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px;
  border: 1px solid var(--red); color: var(--red); background: transparent;
  font: 600 12px var(--mono); text-decoration: none; cursor: pointer; vertical-align: middle;
  transition: background .15s, color .15s;
}
.ts svg { width: 11px; height: 11px; }
.ts:hover { background: var(--red); color: #fff; }

.slide { margin: 26px 0 0; }
.slide > h3 { font-size: 22px; line-height: 1.3; font-weight: 700; color: var(--navy); margin: 0 0 10px; letter-spacing: -.01em; }
.slide p { margin: 0 0 14px; }
.slide ul, .slide ol { padding-left: 22px; margin: 0 0 14px; }
.slide li { margin: 4px 0; }
.slide li::marker { color: var(--gold); }

.quote {
  margin: 18px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--red);
  font-size: 20px; line-height: 1.55; font-weight: 600; color: var(--navy);
}
.quote cite { display: block; margin-top: 6px; font: 500 13px var(--mono); color: var(--muted); font-style: normal; }

/* Danh sách đánh số kiểu checklist (giống "Cài đặt nên bật") */
.klist { list-style: none; padding: 0 !important; margin: 4px 0 16px !important; counter-reset: k; }
.klist > li {
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0 !important;
}
.klist > li:last-child { border-bottom: 0; }
.klist > li::before {
  counter-increment: k; content: counter(k); grid-row: span 2;
  font: 600 15px/1.6 var(--mono); color: var(--red);
}
.klist .k-t { font-weight: 600; color: var(--navy); }
.klist .k-s { color: var(--muted); font-size: 15px; }

/* Khối prompt có nút chép */
.prompt {
  position: relative; margin: 18px 0 20px; border-radius: var(--radius); background: var(--code-bg); color: var(--code-text);
  box-shadow: var(--shadow); overflow: hidden;
}
.prompt-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08); font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #D7C298;
}
.prompt-head .ma-p { color: #8D89B8; }
.prompt-head .sp { flex: 1; }
.copy {
  font: 600 12px var(--sans); letter-spacing: 0; text-transform: none;
  padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.copy:hover { background: rgba(255,255,255,.14); }
.copy.done { background: #2F7A55; border-color: #2F7A55; }
.prompt pre {
  margin: 0; padding: 16px 18px 18px; white-space: pre-wrap; word-break: break-word;
  font: 400 14px/1.75 var(--mono); color: var(--code-text);
}
.prompt pre .ph { color: #E6C27A; }
.prompt .after { padding: 0 18px 14px; font: 400 13px var(--sans); color: #B4B1CC; }

/* Thẻ, lưới */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card h4 { margin: 0 0 6px; font-size: 17px; color: var(--navy); }
.card p { margin: 0; font-size: 15px; color: var(--muted); }
.card .tag { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; display: block; }

/* Sản phẩm STEAMGO */
.product { position: relative; overflow: hidden; }
.product .price { font: 700 30px/1 var(--sans); color: var(--navy); margin: 8px 0 12px; letter-spacing: -.02em; }
.product .price small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.product dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.product dt { color: var(--muted); }
.product dd { margin: 0; font-weight: 600; color: var(--text); }
.product .bar { position: absolute; left: 0; top: 0; height: 3px; background: var(--gold); }
.lot { margin: 6px 0 18px; }
.lot .lot-bar { display: flex; height: 38px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.lot .lot-bar span { flex: 1; display: grid; place-items: center; font: 600 13px var(--mono); color: var(--navy); border-right: 1px solid var(--line); background: var(--navy-50); }
.lot .lot-bar span:nth-child(2) { background: var(--navy-100); }
.lot .lot-bar span:nth-child(3) { background: var(--gold-bg); border-right: 0; }
.lot .lot-cap { display: flex; justify-content: space-between; font: 500 12px var(--mono); color: var(--muted); margin-top: 6px; }

/* Ba cấp độ dùng AI: bậc thang */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin: 18px 0 20px; }
.level {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.level:nth-child(1) { min-height: 190px; }
.level:nth-child(2) { min-height: 240px; }
.level:nth-child(3) { min-height: 290px; border-color: var(--gold); background: linear-gradient(180deg, var(--gold-bg), var(--card) 60%); }
.level .lv { font: 600 11px var(--mono); letter-spacing: .12em; color: var(--red); text-transform: uppercase; }
.level h4 { margin: 0; font-size: 18px; line-height: 1.3; color: var(--navy); }
.level p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.level .ex { margin-top: auto; font: 400 12.5px/1.5 var(--mono); color: var(--text); background: var(--soft); border-radius: 8px; padding: 8px 10px; }

/* RGCCF */
.rgccf { display: grid; gap: 8px; margin: 16px 0 20px; }
.rg {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.rg .L {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font: 800 22px var(--sans); color: var(--navy); background: var(--navy-50); border: 1px solid var(--navy-100);
}
.rg h4 { margin: 0 0 2px; font-size: 16px; color: var(--navy); }
.rg h4 span { font-weight: 500; color: var(--muted); font-size: 14px; }
.rg p { margin: 0; font-size: 15px; color: var(--muted); }

/* Công thức 3 vế */
.formula { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 20px; counter-reset: f; }
.formula > div {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 16px;
}
.formula > div::before { counter-increment: f; content: counter(f); font: 600 12px var(--mono); color: var(--red); display: block; margin-bottom: 4px; }
.formula b { display: block; font-size: 16px; }
.formula span { font-size: 14px; color: var(--muted); }
.formula > div:last-child { background: var(--navy-50); border-color: var(--navy-100); }

/* Hội thoại mô phỏng Claude hỏi lại */
.chat {
  margin: 18px 0 20px; padding: 18px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.chat-head { display: flex; align-items: center; gap: 10px; font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chat-head .sp { flex: 1; }
.replay { font: 600 12px var(--sans); text-transform: none; letter-spacing: 0; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--navy); cursor: pointer; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.55; }
.msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ai .who { display: block; font: 600 11px var(--mono); letter-spacing: .08em; color: var(--gold-text); margin-bottom: 2px; }
.msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
:root[data-theme="dark"] .msg.me { color: #1A1743; }

.msg.note { align-self: center; max-width: 100%; background: transparent; font: 500 12px var(--mono); color: var(--muted); padding: 2px; }
.chat.playing .msg { opacity: 0; transform: translateY(8px); }
.chat .msg.shown { opacity: 1; transform: none; transition: opacity .4s var(--ease), transform .4s var(--ease); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Hộp lưu ý theo ý nghĩa màu */
.callout {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin: 16px 0 18px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid; font-size: 15.5px;
}
.callout svg { width: 20px; height: 20px; margin-top: 2px; }
.callout p { margin: 0; }
.callout .ct { font-weight: 700; display: block; margin-bottom: 2px; }
.callout.warn { background: var(--gold-bg); border-color: var(--gold); color: var(--text); }
.callout.warn svg, .callout.warn .ct { color: var(--gold-text); }
.callout.ok { background: var(--green-bg); border-color: var(--green-line); }
.callout.ok svg, .callout.ok .ct { color: var(--green); }
.callout.no { background: var(--red-50); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.callout.no svg, .callout.no .ct { color: var(--red); }
.callout.info { background: var(--navy-50); border-color: var(--navy-100); }
.callout.info svg, .callout.info .ct { color: var(--navy); }

/* Các bước có số */
.steps { list-style: none; padding: 0 !important; margin: 14px 0 18px !important; counter-reset: s; }
.steps > li {
  position: relative; padding: 0 0 16px 46px; margin: 0 !important;
}
.steps > li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 600 13px var(--mono); color: var(--navy); background: var(--card); border: 1.5px solid var(--navy-100);
}
.steps > li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }

/* Bảng */
.table-wrap { overflow-x: auto; margin: 14px 0 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--soft); }
tr:last-child td { border-bottom: 0; }

/* Thẻ chia sẻ nhóm */
.rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 16px 0 18px; }
.room { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.room .tag { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.room ul { padding-left: 18px; margin: 8px 0 0; font-size: 14.5px; }

/* Hỏi đáp: accordion */
.qa { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin: 10px 0; }
.qa summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 10px; font-weight: 600; color: var(--navy); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font: 400 22px/1 var(--sans); color: var(--muted); transition: transform .2s; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa .qa-body { padding: 0 16px 14px; font-size: 15.5px; }
.qa .qa-body ul { padding-left: 20px; }

/* Bài tập có ô tích */
.todo { list-style: none; padding: 0 !important; margin: 14px 0 !important; }
.todo li { margin: 0 0 8px !important; }
.todo label {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; transition: border-color .2s, background .2s;
}
.todo input { appearance: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); margin: 1px 0 0; display: grid; place-items: center; cursor: pointer; background: var(--card); }
.todo input:checked { background: var(--green); border-color: var(--green); }
.todo input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.todo label:has(input:checked) { background: var(--green-bg); border-color: var(--green-line); }
.todo label:has(input:checked) .td-t { text-decoration: line-through; text-decoration-color: var(--green); }
.todo .td-t { font-weight: 600; color: var(--navy); display: block; }
.todo .td-s { font-size: 14.5px; color: var(--muted); }
.todo .due { display: inline-block; margin-top: 4px; font: 600 11px var(--mono); color: var(--gold-text); letter-spacing: .04em; }

/* Ôn nhanh: thẻ lật */
.flash-top { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; font: 500 13px var(--mono); color: var(--muted); }
.flash-top .bar { flex: 1; height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.flash-top .bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .4s var(--ease); }
.flash { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.fc {
  text-align: left; cursor: pointer; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font: 400 15px/1.5 var(--sans); color: var(--text); min-height: 120px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.fc:hover { border-color: var(--gold); transform: translateY(-2px); }
.fc .q { font-weight: 600; color: var(--navy); }
.fc .a { display: none; color: var(--muted); font-size: 14.5px; border-top: 1px dashed var(--line); padding-top: 8px; }
.fc .hint { margin-top: auto; font: 500 11px var(--mono); color: var(--gold-text); letter-spacing: .06em; }
.fc.open { background: var(--gold-bg); border-color: var(--gold); }
.fc.open .a { display: block; }
.fc.open .hint { display: none; }

/* Đăng ký và tác giả */
.signup {
  margin: 56px 0 0; padding: 28px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.signup::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--red), var(--gold)); }
.signup h3 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; letter-spacing: -.015em; color: var(--navy); }
.signup p { margin: 0 0 16px; color: var(--muted); }
.author { display: flex; gap: 14px; align-items: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author b { display: block; }
.author span { font-size: 14px; color: var(--muted); }
footer.foot { text-align: center; padding: 30px 16px 50px; font: 500 12px var(--mono); color: var(--muted); }

/* Hiện dần khi cuộn */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .nhan { background-size: 100% 100% !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Toast */
.thong-bao {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 120;
  background: var(--navy); color: var(--bg); padding: 10px 16px; border-radius: 10px; font: 600 14px var(--sans); transition: .3s var(--ease);
}
.thong-bao.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Chế độ trình chiếu ---------- */
body.presenting { overflow: hidden; }
.present { display: none; position: fixed; inset: 0; z-index: 100; background: #0B0A1F; }
body.presenting .present { display: block; }
.stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; transform-origin: 0 0;
  background: var(--bg); color: var(--text); overflow: hidden; border-radius: 6px;
  padding: 72px 110px 90px;
  display: flex; flex-direction: column;
}
.stage-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; transform-origin: top left; }
.stage .s-eyebrow { font: 600 18px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 18px; }
.stage .slide { margin: 0; font-size: 30px; line-height: 1.5; }
.stage .slide > h3 { font-size: 56px; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; margin-bottom: 30px; }
.stage .slide p { margin-bottom: 22px; }
.stage .slide.title-slide > h3 { font-size: 84px; }
.stage .quote { font-size: 40px; padding-left: 30px; border-left-width: 3px; }
.stage .quote cite { font-size: 18px; }
.stage .klist > li { grid-template-columns: 64px 1fr; padding: 16px 0; }
.stage .klist > li::before { font-size: 24px; }
.stage .klist .k-s { font-size: 24px; }
.stage .prompt pre { font-size: 23px; line-height: 1.6; padding: 24px 30px 28px; }
.stage .prompt-head { font-size: 15px; padding: 14px 20px 14px 30px; }
.stage .copy { font-size: 15px; }
.stage .card h4, .stage .level h4, .stage .rg h4 { font-size: 28px; }
.stage .card p, .stage .level p, .stage .rg p { font-size: 22px; }
.stage .level { padding: 26px; }
.stage .level:nth-child(1) { min-height: 300px; } .stage .level:nth-child(2) { min-height: 380px; } .stage .level:nth-child(3) { min-height: 460px; }
.stage .level .ex { font-size: 18px; }
.stage .level .lv, .stage .card .tag, .stage .room .tag { font-size: 15px; }
.stage .product .price { font-size: 48px; }
.stage .product dl { font-size: 21px; }
.stage .rg { grid-template-columns: 80px 1fr; padding: 18px 22px; }
.stage .rg .L { width: 62px; height: 62px; font-size: 32px; }
.stage .formula b { font-size: 26px; } .stage .formula span { font-size: 21px; } .stage .formula > div { padding: 22px; }
.stage .msg { font-size: 23px; } .stage .msg.ai .who { font-size: 14px; }
.stage .chat { gap: 8px; padding: 22px 26px; }
.stage-body > .slide { width: 100%; }
.stage .callout { font-size: 25px; grid-template-columns: 36px 1fr; padding: 20px 24px; }
.stage .callout svg { width: 28px; height: 28px; }
.stage .steps > li { padding-left: 64px; padding-bottom: 20px; }
.stage .steps > li::before { width: 42px; height: 42px; font-size: 18px; }
.stage .steps > li::after { left: 21px; top: 48px; }
.stage .room ul { font-size: 21px; }
.stage table { font-size: 22px; } .stage th { font-size: 15px; }
.stage .ts, .stage [data-page-only], .stage .replay { display: none !important; }
.stage .lot .lot-bar { height: 60px; } .stage .lot .lot-bar span { font-size: 20px; } .stage .lot .lot-cap { font-size: 16px; }
.stage .beat-hidden { visibility: hidden; }
.stage .pop { animation: pop .55s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.stage-foot {
  position: absolute; left: 110px; right: 110px; bottom: 30px; display: flex; align-items: center; gap: 12px;
  font: 500 15px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.stage-foot img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.stage-foot .sp { flex: 1; }
.stage-progress { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--red); transition: width .4s var(--ease); }
.face-zone {
  display: none; position: absolute; left: 0; bottom: 0; width: 420px; height: 360px; z-index: 5;
  border: 3px dashed var(--gold); border-left: 0; border-bottom: 0; border-top-right-radius: 26px; background: rgba(201,148,46,.08);
}
.face-zone span { position: absolute; left: 20px; top: 16px; font: 600 14px var(--mono); color: var(--gold-text); letter-spacing: .1em; }
.stage.show-face .face-zone { display: block; }
.stage.show-face .stage-foot { left: 450px; }
.blank { display: none; position: absolute; inset: 0; z-index: 6; background: var(--bg); }
.blank.on { display: block; }
.present-exit {
  position: fixed; top: 14px; right: 14px; z-index: 110; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08); color: #fff; font: 600 13px var(--sans); cursor: pointer; opacity: .25; transition: opacity .2s;
}
.present-exit:hover { opacity: 1; }
.bang-phim {
  display: none; position: fixed; inset: 0; z-index: 130; place-items: center; background: rgba(11,10,31,.6);
}
.bang-phim.on { display: grid; }
.bang-phim .bang-phim-o { background: var(--card); color: var(--text); border-radius: 16px; padding: 24px 28px; max-width: 460px; font-size: 15px; line-height: 2; box-shadow: var(--shadow); }
.bang-phim b { display: block; font-size: 18px; margin-bottom: 6px; }
kbd { font: 600 12px var(--mono); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--soft); color: var(--navy); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-toggle { display: inline-grid; }
  .side {
    position: fixed; top: 64px; left: 0; bottom: 0; height: auto; width: min(320px, 86vw); z-index: 50;
    background: var(--bg); box-shadow: var(--shadow); transform: translateX(-102%); transition: transform .3s var(--ease);
  }
  body.side-open .side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 64px 0 0; background: rgba(11,10,31,.35); z-index: 45; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand .sub { display: none; }
  .hero { padding-top: 36px; }
  .hero .lead { font-size: 17px; }
  .levels { grid-template-columns: 1fr; }
  .level:nth-child(n) { min-height: 0; }
  .formula { grid-template-columns: 1fr 1fr; }
  .msg { max-width: 94%; }
  .signup { padding: 22px 18px; }
  .video-frame.floating { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .chapters li button { grid-template-columns: 62px 1fr; }
  .present-btn-label { display: none; }
}

/* ---------- Khối bổ sung từ Buổi 2 ---------- */
/* Luồng: một đầu vào ra nhiều đầu ra */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1.4fr); align-items: center; gap: 8px; margin: 18px 0 20px; }
.flow-src { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
:root[data-theme="dark"] .flow-src { color: #1A1743; }

.flow-src .tag { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-300); display: block; margin-bottom: 6px; }
.flow-src b { color: inherit; font-size: 18px; display: block; }
.flow-src span { font-size: 14px; opacity: .8; }
.flow-arrow { display: grid; place-items: center; color: var(--red); font: 600 24px var(--sans); }
.flow-outs { display: grid; gap: 8px; }
.flow-outs > div { background: var(--card); border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.flow-outs > div b { display: block; font-size: 15.5px; }
.flow-outs > div span { color: var(--muted); font-size: 14px; }

/* So sánh trước và sau */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); align-items: stretch; gap: 8px; margin: 18px 0 20px; }
.compare > .card:first-child { background: var(--soft); box-shadow: none; }
.compare > .card:last-child { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-bg), var(--card) 70%); }
.compare .flow-arrow { align-self: center; }

/* Lưới 2 cột cố định */
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stage .flow-src b { font-size: 30px; } .stage .flow-src span { font-size: 22px; } .stage .flow-src .tag { font-size: 15px; }
.stage .flow-outs > div { font-size: 22px; padding: 14px 20px; } .stage .flow-outs > div b { font-size: 24px; } .stage .flow-outs > div span { font-size: 20px; }
.stage .flow-arrow { font-size: 40px; }

@media (max-width: 640px) {
  .flow, .compare { grid-template-columns: minmax(0, 1fr); }
  .flow-arrow, .compare .flow-arrow { transform: rotate(90deg); height: 24px; }
  .cards.two { grid-template-columns: minmax(0, 1fr); }
}
.formula.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 640px) { .formula.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Chuyển nhanh giữa các buổi ---------- */
.buoi-switch { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.buoi-btn { padding: 8px 14px; font: 600 14px var(--sans); line-height: 1; white-space: nowrap; }
.buoi-btn:hover { border-color: var(--gold); }
.buoi-btn[aria-current="page"] { cursor: default; border-color: transparent; }
.buoi-btn.is-soon { opacity: .45; cursor: default; pointer-events: none; }
.side .buoi-switch-side { display: none; margin: 0 0 18px; flex-wrap: wrap; }
.side .buoi-switch .buoi-btn { display: inline-flex; padding: 8px 14px; font-size: 14px; }
@media (max-width: 1020px) {
  .buoi-switch-top { display: none; }
  .side .buoi-switch-side { display: flex; }
}
