:root {
  --ink: #06292D;          /* nền nhận diện Fanpage */
  --ink-2: #0C3A3F;
  --teal: #0B9DAA;
  --green: #3FBF8C;
  --lime: #86DB4E;
  --grad: linear-gradient(90deg, #0B9DAA, #3FBF8C, #86DB4E);
  --paper: #F7F9F6;
  --text: #17302F;
  --muted: #5E7472;
  --line: #E1E8E4;
  --side-w: 320px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  background: var(--paper);
  color: var(--text);
  line-height: 1.65;
}
a { color: inherit; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--ink); color: #DCEBE7;
  display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 20px 16px; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: .2px; }
.brand-course { font-size: 13px; color: #9FC4BD; }

.progress-box { padding: 0 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #9FC4BD; margin-bottom: 6px; }
.progress-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .3s; }

.toc { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.chapter { margin: 6px 0; }
.chapter summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #fff;
}
.chapter summary::-webkit-details-marker { display: none; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.1); color: #BFE3D6; }

.toc-item {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start;
  padding: 9px 10px; border-radius: 10px; text-decoration: none; font-size: 14px; line-height: 1.45;
}
.toc-item:hover { background: rgba(255,255,255,.05); }
.toc-item.active { background: rgba(63,191,140,.16); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.toc-item .check { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px solid #5E8A84; }
.toc-item.done .check { background: var(--green); border-color: var(--green); position: relative; }
.toc-item.done .check::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.toc-item.important .toc-text::after { content: " ★"; color: var(--lime); font-size: 12px; }
.toc-time { font-size: 12px; color: #8FB2AC; font-variant-numeric: tabular-nums; }
.sidebar-foot { padding: 12px 20px; font-size: 11px; color: #7FA39D; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- Main ---------- */
.main { margin-left: var(--side-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(247,249,246,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); opacity: .7; }
.menu-btn { display: none; border: 0; background: var(--ink); color: #fff; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; cursor: pointer; }
.topbar-title { flex: 1; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-pos { font-size: 13px; color: var(--muted); white-space: nowrap; }

.lesson { max-width: 760px; margin: 0 auto; padding: 32px 28px 64px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: #E8F1EE; color: #2D5D57; }
.tag-hot { background: var(--ink); color: var(--lime); }
h1 { font-size: 32px; line-height: 1.25; margin: 0 0 12px; color: var(--ink); letter-spacing: -.3px; }
.lead { font-size: 18px; color: #2F4B49; margin: 0 0 24px; padding-left: 14px; border-left: 3px solid var(--green); }

.video {
  position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; margin-bottom: 28px;
  background: radial-gradient(120% 120% at 0% 0%, #0E4A50 0%, var(--ink) 60%);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; color: #CFE6E0;
}
.video::before { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--grad); }
.video-play { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.12); position: relative; }
.video-play::after { content: ""; position: absolute; left: 26px; top: 20px; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; }
.video-cap { text-align: center; font-size: 14px; font-weight: 600; }
.video-cap small { font-weight: 400; color: #8FB2AC; }

.prose h2 { font-size: 21px; color: var(--ink); margin: 28px 0 8px; }
.prose p, .prose li { font-size: 16.5px; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 16px 0; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; background: #fff; border-radius: 12px; overflow: hidden; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--ink); color: #fff; font-weight: 600; }

.block { margin-top: 32px; }
.block-title { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 12px; }

.mindmap { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.mm-center {
  width: fit-content; margin: 0 auto 18px; padding: 10px 22px; border-radius: 99px;
  background: var(--ink); color: #fff; font-weight: 700;
}
.mm-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.mm-branch { border-top: 3px solid var(--teal); background: #F2F7F5; border-radius: 10px; padding: 10px 12px; }
.mm-branch:nth-child(2) { border-color: var(--green); }
.mm-branch:nth-child(3) { border-color: var(--lime); }
.mm-label { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.mm-branch ul { margin: 0; padding-left: 18px; font-size: 14px; color: #3C5856; }

.info { background: var(--ink); color: #fff; border-radius: 16px; padding: 22px; }
.info-title { font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.info-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.info-steps li { background: rgba(255,255,255,.07); border-radius: 12px; padding: 12px; font-weight: 600; font-size: 15px; }
.info-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: var(--ink); font-weight: 800; margin-right: 8px; }

.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs li { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.doc-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #E8F1EE; color: var(--teal); font-weight: 800; }
.doc-name { flex: 1; font-weight: 500; font-size: 15px; }
.doc-size { font-size: 13px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }

.nav-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.nav-row > :last-child { justify-self: end; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; border-radius: 12px; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: 0; }
.btn-ghost { color: var(--ink); background: #E8F1EE; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-done { background: var(--green); color: var(--ink); }

.scrim { display: none; }

/* ---------- Điện thoại ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: min(86vw, 340px); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6,41,45,.45); z-index: 20; }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 10px 16px; }
  .lesson { padding: 22px 16px 48px; }
  h1 { font-size: 25px; }
  .lead { font-size: 16.5px; }
  .video { border-radius: 12px; margin-left: -4px; margin-right: -4px; }
  .nav-row { grid-template-columns: 1fr 1fr; }
  .nav-row #doneBtn { grid-column: 1 / -1; grid-row: 1; }
}

/* =========================================================
   LeNewEdu site — bổ sung cho trang chủ và khóa thật
   ========================================================= */
.brand { text-decoration: none; }
.sidebar-foot a { color: #BFE3D6; text-decoration: none; font-size: 13px; }
.sidebar-foot a:hover { color: #fff; }

/* Hướng học A/B */
.huong-box { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.huong-title { font-size: 12px; color: #9FC4BD; margin-bottom: 6px; }
.huong-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.huong-opts button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 6px 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.18);
  background: transparent; color: #DCEBE7;
}
.huong-opts button.on { background: var(--green); border-color: var(--green); color: var(--ink); }
body[data-huong="A"] [data-huong="B"],
body[data-huong="B"] [data-huong="A"] { display: none !important; }
.huong-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; vertical-align: 2px; }
.hb-a { background: #DDF1F3; color: #08707A; }
.hb-b { background: #EAF6DD; color: #3F7A17; }
.hb-c { background: #ECEFEE; color: #4E6461; }

/* Nội dung bài */
.prose h2.sec { font-size: 20px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.prose h2.sec:first-child { border-top: 0; padding-top: 0; margin-top: 8px; }
.prose .sub { margin: 14px 0; }
.prose .sub h3 { font-size: 16.5px; margin: 18px 0 6px; color: var(--ink); }
.prose details.sub { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.prose details.sub summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: var(--ink); }
.prose details.sub[open] { padding-bottom: 8px; }
.prose code { background: #E8F1EE; padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.prose a { color: #08707A; }
.src { font-size: 12.5px !important; color: var(--muted); margin: 4px 0 8px; font-style: italic; }
.callout { background: #EEF6F2; border-left: 3px solid var(--green); border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 15px; }
.todo { background: #FFF8E6; border: 1px dashed #E2B44B; border-radius: 10px; padding: 10px 14px; margin: 14px 0; font-size: 14.5px; color: #6B5214; }
.todo strong { color: #8A6410; margin-right: 6px; }

.prompt { background: var(--ink); border-radius: 14px; margin: 14px 0; overflow: hidden; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: #fff; font-weight: 600; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.copy-btn { flex-shrink: 0; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; border: 0; border-radius: 8px; padding: 7px 12px; background: var(--grad); color: var(--ink); }
.prompt pre { margin: 0; padding: 14px; color: #D9ECE7; font-family: inherit; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }

.checklist { list-style: none; padding: 0; display: grid; gap: 8px; }
.checklist li label { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.checklist input { width: 18px; height: 18px; margin-top: 3px; accent-color: #3FBF8C; flex-shrink: 0; }

.mm-compact { margin-bottom: 26px; padding: 18px; }
.mm-compact .mm-branches { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.mm-compact .mm-branch { padding: 10px 12px; }
.mm-compact .mm-label { font-weight: 600; font-size: 14.5px; margin: 4px 0 0; }

.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; margin-bottom: 26px; background: var(--ink); }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.toc-item.soan { opacity: .62; }
.toc-item.soan .toc-time { font-size: 11px; }
.tag-soan { background: #FFF1D6; color: #8A6410; }
.intro-p { font-size: 16px; }
.outline { padding-left: 22px; margin: 18px 0; }
.outline li { margin: 6px 0; }
.outline a { color: var(--ink); font-weight: 500; }
.nav-intro { border-top: 0; margin-top: 24px; }

/* Trang chủ */
body.home { background: var(--paper); }
.home-inner { max-width: 980px; margin: 0 auto; padding: 0 24px; }
.home-hero { background: var(--ink); color: #DCEBE7; padding: 28px 0 48px; position: relative; }
.home-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--grad); }
.home-hero .brand { padding: 0; }
.home-title { color: #fff; font-size: 38px; line-height: 1.2; max-width: 680px; margin: 36px 0 12px; letter-spacing: -.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-sub { font-size: 17px; color: #A9CBC4; margin: 0; }
.home-h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 36px 0 14px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.course-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(6,41,45,.08); }
.course-card h3 { margin: 12px 0 2px; font-size: 22px; color: var(--ink); }
.card-sub { color: #08707A; font-weight: 600; font-size: 14px; }
.course-card p { color: #3C5856; font-size: 15px; margin: 10px 0 16px; flex: 1; }
.card-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.card-progress .progress-bar { flex: 1; background: #E8F1EE; }
.card-cta { font-weight: 700; color: var(--ink); }
.home-note { font-size: 13px; color: var(--muted); margin: 22px 0 0; }
.home-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 40px 16px 28px; }

@media (max-width: 900px) {
  .home-inner { padding: 0 16px; }
  .home-title { font-size: 28px; margin-top: 26px; }
  .home-sub { font-size: 15.5px; }
  .prompt-head { flex-wrap: wrap; }
}
