/* HVL LMS 1.13 — lớp giao diện hiện đại (PC + mobile), nền tối, chế độ tập trung, in ấn */
.hvl-lms-page{--hvl-lms-radius:18px;--hvl-read-scale:1;--hvl-ease:cubic-bezier(.2,.7,.2,1)}
.hvl-lms-page :where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid rgba(7,94,232,.45);outline-offset:2px;border-radius:8px}
.hvl-lms-page :where(.hvl-lms-button,.hvl-chip,.hvl-course-card,.hvl-dashboard-card,.hvl-chapter){transition:transform .22s var(--hvl-ease),box-shadow .22s var(--hvl-ease),background-color .2s,border-color .2s}

/* ---- Trang khóa học ---- */
.hvl-course-hero{position:relative;overflow:hidden;background:radial-gradient(900px 340px at 92% -10%,rgba(76,155,255,.55),transparent 60%),radial-gradient(600px 300px at -5% 110%,rgba(7,94,232,.5),transparent 60%),linear-gradient(125deg,#05275d,#064da5)}
.hvl-course-hero h1{letter-spacing:-.02em;text-wrap:balance}
.hvl-course-facts{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.hvl-course-facts>span{padding:7px 13px;border-radius:999px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);color:#fff;font-size:13px;font-weight:600;backdrop-filter:blur(6px)}
.hvl-alert{margin:16px 0;padding:14px 18px;border-radius:14px;background:#fff7e0;border:1px solid #f1d98f;color:#6b4b00;font-weight:600}
.hvl-progress{height:9px;border-radius:99px;overflow:hidden;background:#e4ecf8}.hvl-progress>i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#075ee8,#35a0ff);transition:width .6s var(--hvl-ease)}
.hvl-curriculum-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap}
.hvl-curriculum-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hvl-curriculum-tools input[type=search],.hvl-catalog-tools input[type=search]{min-width:220px;padding:10px 14px 10px 38px;border:1px solid var(--hvl-lms-line);border-radius:12px;font-size:14px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23607089' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 12px center no-repeat}
.hvl-chip{padding:9px 14px;border:1px solid var(--hvl-lms-line);border-radius:999px;background:#fff;color:var(--hvl-lms-ink);font-size:13px;font-weight:700;cursor:pointer}.hvl-chip:hover{border-color:#9dc3f7;background:#f4f8ff}
.hvl-empty-search{padding:16px;text-align:center;color:var(--hvl-lms-muted)}
details.hvl-chapter{margin:14px 0;padding:0;overflow:hidden;border:1px solid var(--hvl-lms-line);border-radius:18px;background:#fff;box-shadow:0 1px 2px rgba(16,48,95,.04)}
details.hvl-chapter[open]{box-shadow:var(--hvl-lms-shadow)}
details.hvl-chapter>summary{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 22px;cursor:pointer;list-style:none;background:linear-gradient(180deg,#fbfdff,#f4f8fe)}
details.hvl-chapter>summary::-webkit-details-marker{display:none}
details.hvl-chapter>summary::after{content:"";flex:0 0 10px;width:10px;height:10px;margin-left:4px;border-right:2.5px solid #607089;border-bottom:2.5px solid #607089;transform:rotate(45deg);transition:transform .25s var(--hvl-ease)}
details.hvl-chapter[open]>summary::after{transform:rotate(-135deg)}
details.hvl-chapter>summary>div{flex:1;min-width:0}details.hvl-chapter>summary span{display:block;color:var(--hvl-lms-blue);font-size:11px;font-weight:900;letter-spacing:.1em}details.hvl-chapter>summary h3{margin:3px 0 0;font-size:18px;line-height:1.35}details.hvl-chapter>summary p{margin:4px 0 0;color:var(--hvl-lms-muted);font-size:13px}
details.hvl-chapter>summary small{display:flex;flex-direction:column;align-items:flex-end;gap:6px;color:var(--hvl-lms-muted);font-size:12px;font-weight:700;white-space:nowrap}
.hvl-mini-bar{display:block;width:84px;height:5px;border-radius:9px;background:#dbe6f6;overflow:hidden}.hvl-mini-bar>b{display:block;height:100%;background:#12a66d}
details.hvl-chapter>ol{margin:0;padding:6px 12px 12px;list-style:none}
details.hvl-chapter>ol>li{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:12px;align-items:center;margin:2px 0;padding:11px 12px;border-radius:12px}
details.hvl-chapter>ol>li:hover{background:#f3f8ff}
details.hvl-chapter>ol>li.is-active{background:#e9f2ff;box-shadow:inset 3px 0 0 #075ee8}
details.hvl-chapter>ol>li.is-done .hvl-lesson-no{background:#e3f7ee;color:#0b7a50}
details.hvl-chapter>ol>li.is-locked{opacity:.62}
.hvl-lesson-no{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#eaf1fc;color:#0a4ebf;font-weight:800;font-size:13px}
details.hvl-chapter>ol>li strong{font-size:15px;font-weight:650}details.hvl-chapter>ol>li strong a{color:inherit;text-decoration:none}details.hvl-chapter>ol>li strong a:hover{color:var(--hvl-lms-blue)}
details.hvl-chapter>ol>li small{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:2px;color:var(--hvl-lms-muted);font-size:12px}
.hvl-badges{display:inline-flex;gap:5px}.hvl-badges em{font-style:normal;font-size:12px;opacity:.85}
.hvl-lms-button.is-disabled{opacity:.5;pointer-events:none}

/* ---- Danh mục khóa học ---- */
.hvl-catalog-tools{margin:0 0 18px}.hvl-catalog-tools input[type=search]{width:100%;max-width:420px}
.hvl-grade-filter{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}.hvl-grade-filter a{padding:9px 16px;border-radius:999px;border:1px solid var(--hvl-lms-line);background:#fff;font-weight:700;text-decoration:none}.hvl-grade-filter a.is-active{background:#075ee8;border-color:#075ee8;color:#fff;box-shadow:0 6px 16px rgba(7,94,232,.28)}
.hvl-course-card{overflow:hidden;border-radius:20px}.hvl-course-card:hover{transform:translateY(-4px);box-shadow:0 18px 40px rgba(16,48,95,.16)}
.hvl-course-thumb{position:relative;display:block;overflow:hidden}.hvl-course-thumb img{transition:transform .5s var(--hvl-ease)}.hvl-course-card:hover .hvl-course-thumb img{transform:scale(1.05)}
.hvl-new{position:absolute;top:12px;right:12px;padding:4px 9px;border-radius:99px;background:#ff5a4f;color:#fff;font-size:10px;font-weight:900;letter-spacing:.08em}
.hvl-card-progress{margin:0 0 12px}.hvl-card-progress small{display:block;margin-top:5px;color:var(--hvl-lms-muted);font-size:12px;font-weight:700}

/* ---- Học tập của tôi ---- */
.hvl-activity{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;margin:18px 0;padding:20px 24px;border-radius:20px;background:linear-gradient(120deg,#fff,#f3f8ff);border:1px solid var(--hvl-lms-line)}
.hvl-streak strong{display:block;font-size:42px;line-height:1;color:#ff7a1a}.hvl-streak span{color:var(--hvl-lms-muted);font-weight:700;font-size:13px}
.hvl-week{display:flex;align-items:flex-end;gap:10px;height:92px}.hvl-week>div{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;width:34px;height:100%}.hvl-week i{display:block;width:100%;border-radius:8px 8px 4px 4px;background:#dbe6f6;min-height:6px}.hvl-week i.on{background:linear-gradient(180deg,#35a0ff,#075ee8)}.hvl-week small{font-size:11px;color:var(--hvl-lms-muted);font-weight:700}
.hvl-scores li a strong{flex:1}

/* ---- Huy hiệu, xếp hạng, bài được giao ---- */
.hvl-badges-box,.hvl-leaderboard,.hvl-assignments{margin:20px 0;padding:20px 22px;border:1px solid var(--hvl-lms-line);border-radius:20px;background:#fff}
.hvl-badges-box h2,.hvl-leaderboard h2,.hvl-assignments h2{margin:0 0 14px;font-size:20px}.hvl-badges-box h2 small{color:var(--hvl-lms-muted);font-size:13px}
.hvl-badge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.hvl-badge-card{display:flex;flex-direction:column;align-items:center;gap:3px;padding:14px 8px;border-radius:16px;border:1px dashed var(--hvl-lms-line);text-align:center;filter:grayscale(1);opacity:.5}
.hvl-badge-card.is-on{filter:none;opacity:1;border:1px solid #ffd98a;background:linear-gradient(180deg,#fffaf0,#fff3d6)}
.hvl-badge-card i{font-style:normal;font-size:30px}.hvl-badge-card strong{font-size:14px}.hvl-badge-card small{color:var(--hvl-lms-muted);font-size:11px}
.hvl-leaderboard ol{list-style:none;margin:0;padding:0}.hvl-leaderboard li{display:grid;grid-template-columns:36px 1fr auto 70px;gap:10px;align-items:center;padding:10px 12px;border-radius:12px}
.hvl-leaderboard li:nth-child(odd){background:#f6f9ff}.hvl-leaderboard li.is-me{background:#e3f0ff;box-shadow:inset 3px 0 0 #075ee8;font-weight:700}.hvl-leaderboard li.is-gap{display:block;text-align:center;color:var(--hvl-lms-muted)}
.hvl-leaderboard li b{text-align:center}.hvl-leaderboard li small{color:var(--hvl-lms-muted)}.hvl-leaderboard li strong{text-align:right;color:#075ee8}.hvl-lb-note{margin:10px 0 0;color:var(--hvl-lms-muted);font-size:12px}
.hvl-assignments ul{list-style:none;margin:0;padding:0}.hvl-assignments li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 14px;margin:6px 0;border-radius:12px;background:#f6f9ff;border-left:4px solid #075ee8}
.hvl-assignments li a{display:block;text-decoration:none;color:inherit;min-width:0}.hvl-assignments li small{display:block;color:var(--hvl-lms-muted)}.hvl-assignments li span{font-weight:700;white-space:nowrap;font-size:13px}
.hvl-assignments li.is-done{border-left-color:#12a66d;opacity:.8}.hvl-assignments li.is-late{border-left-color:#d93a2f;background:#fff1f0}
body.hvl-dark :is(.hvl-badges-box,.hvl-leaderboard,.hvl-assignments){background:#111d33;border-color:var(--hvl-lms-line)}
body.hvl-dark .hvl-badge-card.is-on{background:#2b2411;border-color:#6b5415}body.hvl-dark :is(.hvl-leaderboard li:nth-child(odd),.hvl-assignments li){background:#16253f}body.hvl-dark .hvl-leaderboard li.is-me{background:#18305a}body.hvl-dark .hvl-assignments li.is-late{background:#3a1a1f}

/* ---- Trang bài học ---- */
.hvl-reader-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 12px}
.hvl-reader-bar button{padding:7px 12px;border:1px solid var(--hvl-lms-line);border-radius:10px;background:#fff;color:var(--hvl-lms-ink);font-size:13px;font-weight:700;cursor:pointer}.hvl-reader-bar button:hover,.hvl-reader-bar button.is-on{border-color:#075ee8;background:#eaf2ff;color:#0a4ebf}
.hvl-kbd-hint{margin-left:auto;color:var(--hvl-lms-muted);font-size:12px}
.hvl-lesson-content,.hvl-qz .hvl-opt,.hvl-fill-text{font-size:calc(1rem*var(--hvl-read-scale))}.hvl-lesson-content{line-height:1.8;max-width:78ch;margin-left:0;margin-right:auto;color:var(--hvl-lms-ink)}.hvl-lesson-content img{max-width:100%;height:auto;border-radius:12px}
.hvl-lesson-tabs{position:sticky;z-index:20;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:8px;border-radius:16px;background:rgba(255,255,255,.88);backdrop-filter:blur(10px);border:1px solid var(--hvl-lms-line)}.hvl-lesson-tabs::-webkit-scrollbar{display:none}
.hvl-lesson-tabs button{flex:1;white-space:nowrap;padding:11px 18px;border-radius:11px;border:0;background:transparent;font-weight:700;cursor:pointer}.hvl-lesson-tabs button.is-active{background:#075ee8;color:#fff;box-shadow:0 6px 16px rgba(7,94,232,.3)}
.hvl-lesson-panel{animation:hvlFade .28s var(--hvl-ease)}@keyframes hvlFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ---- Chế độ tập trung ---- */
body.hvl-focus .hvl-course-sidebar,body.hvl-focus .hvl-lesson-breadcrumb,body.hvl-focus .hvl-lesson-tools{display:none!important}
body.hvl-focus .hvl-lms-page-grid{display:block!important}body.hvl-focus .hvl-lms-main{max-width:860px;margin:0 auto}

/* ---- Nền tối ---- */
body.hvl-dark{--hvl-lms-bg:#0a1322;--hvl-lms-ink:#e8eef9;--hvl-lms-muted:#9db0cf;--hvl-lms-line:#243652;--hvl-lms-blue:#5aa8ff;--hvl-lms-navy:#cfe0fb;background:#0a1322!important;color:var(--hvl-lms-ink)}
body.hvl-dark :is(.hvl-lms-main,.hvl-lesson-view,.hvl-lms-course,.hvl-lms-wrap){color:var(--hvl-lms-ink)}
body.hvl-dark :is(.hvl-course-card,.hvl-dashboard-card,details.hvl-chapter,.hvl-qz,.hvl-progress-box,.hvl-notes,.hvl-course-description,.hvl-quiz-head,.hvl-tf-row,.hvl-match-row,.hvl-order-row,.hvl-reader-bar button,.hvl-chip,.hvl-activity,.hvl-saved,.hvl-qz .hvl-opt,.hvl-course-sidebar .hvl-course-list,.hvl-outcomes,.hvl-quiz-note){background:#111d33!important;border-color:var(--hvl-lms-line)!important;color:var(--hvl-lms-ink)}
body.hvl-dark details.hvl-chapter>summary{background:#16253f}body.hvl-dark details.hvl-chapter>ol>li:hover{background:#17294a}body.hvl-dark details.hvl-chapter>ol>li.is-active{background:#18305a}
body.hvl-dark :is(.hvl-lesson-tabs){background:rgba(17,29,51,.9);border-color:var(--hvl-lms-line)}body.hvl-dark .hvl-lesson-tabs button{color:var(--hvl-lms-ink)}body.hvl-dark .hvl-lesson-tabs button.is-active{color:#fff}
body.hvl-dark :is(.hvl-lesson-content,.hvl-lesson-content p,.hvl-lesson-content li,.hvl-lesson-content h1,.hvl-lesson-content h2,.hvl-lesson-content h3,.hvl-lesson-content h4){color:var(--hvl-lms-ink)!important}
body.hvl-dark :is(input,select,textarea){background:#0e1a2e;color:var(--hvl-lms-ink);border-color:var(--hvl-lms-line)}
body.hvl-dark .hvl-qz-img,body.hvl-dark .hvl-lesson-content img{background:#fff}
body.hvl-dark .hvl-qz.is-correct{background:#0f2a22!important}body.hvl-dark .hvl-qz.is-wrong{background:#2c1519!important}body.hvl-dark .hvl-qz.is-partial{background:#2b2411!important}
body.hvl-dark .hvl-qz .hvl-opt.is-answer,body.hvl-dark .is-ok{background:#12372c!important}body.hvl-dark .hvl-qz .hvl-opt.is-bad,body.hvl-dark .is-bad{background:#3a1a1f!important}
body.hvl-dark :is(.hvl-practice-bar,.hvl-quiz-start){background:#2b2411;border-color:#6b5415;color:#ffe29a}body.hvl-dark .hvl-lms-button.hvl-outline{background:#111d33;color:#cfe0fb;border-color:#2c4468}body.hvl-dark .hvl-lesson-actions{background:rgba(10,19,34,.94)}body.hvl-dark .hvl-alert{background:#2b2411;border-color:#6b5415;color:#ffe29a}

/* ---- Mobile ---- */
@media(max-width:820px){
  .hvl-course-hero{padding:24px 18px!important}.hvl-course-hero h1{font-size:26px!important}
  .hvl-curriculum-tools{width:100%}.hvl-curriculum-tools input[type=search]{flex:1;min-width:0}
  details.hvl-chapter>summary{padding:14px 16px}details.hvl-chapter>summary h3{font-size:16px}.hvl-mini-bar{width:60px}
  details.hvl-chapter>ol>li{grid-template-columns:30px minmax(0,1fr) auto;gap:10px;padding:12px 8px}
  .hvl-lms-button,.hvl-reader-bar button,.hvl-chip{min-height:44px}
  .hvl-kbd-hint{display:none}
  .hvl-activity{padding:16px}.hvl-week{width:100%;justify-content:space-between}
  .hvl-lesson-tabs{margin:0 -4px}
  .hvl-lesson-actions{padding-bottom:calc(9px + env(safe-area-inset-bottom))}
}
@media(max-width:520px){.hvl-reader-bar{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none;margin-right:-14px;padding-right:14px}.hvl-reader-bar button{flex:0 0 auto}.hvl-course-grid{grid-template-columns:1fr!important}}
@media(prefers-reduced-motion:reduce){.hvl-lms-page *{animation:none!important;transition:none!important}}

/* ---- In bài ---- */
@media print{
  .hvl-course-sidebar,.hvl-lesson-tabs,.hvl-lesson-actions,.hvl-reader-bar,.hvl-lesson-tools,.hvl-lesson-breadcrumb,.hvl-notes,.hvl-reading-progress,[data-hvl-panel="test"],header.site-header,footer{display:none!important}
  .hvl-lms-page-grid{display:block!important}[data-hvl-panel="theory"],[data-hvl-panel="exercises"]{display:block!important}
  body,body.hvl-dark{background:#fff!important;color:#000!important}.hvl-lesson-content{max-width:none;color:#000!important}
}

/* ---- Tránh menu cố định của theme (JS đặt --hvl-sticky-top) ---- */
.hvl-lesson-view .hvl-lesson-tabs{top:var(--hvl-sticky-top,82px)!important;z-index:30}
.hvl-quiz-timer{top:calc(var(--hvl-sticky-top,8px) + 64px)}
.hvl-lesson-view :target,.hvl-lesson-content h2,.hvl-lesson-content h3{scroll-margin-top:calc(var(--hvl-sticky-top,82px) + 70px)}
.hvl-qz .hvl-opt input[type=radio],.hvl-qz .hvl-opt input[type=checkbox]{flex:0 0 auto;align-self:center;margin:0;position:static;float:none}
@media(max-width:820px){.hvl-quiz-timer{top:calc(var(--hvl-sticky-top,8px) + 60px)}}
