/* =========================================================
   EdTech Việt Nam · Học liệu số — Giao diện
   Màu theo logo: xanh hoàng gia + đỏ thương hiệu
   ========================================================= */
:root {
  --primary: #1F2537;
  --primary-600: #181D2C;
  --primary-700: #111521;
  --primary-50: #F1F3F7;
  --primary-100: #DFE3EB;
  --copper: #B4703E;
  --copper-600: #93562C;
  --copper-50: #FBF4EE;
  --copper-grad: linear-gradient(135deg, #D6A06F 0%, #B8743F 52%, #93562C 100%);
  --red: #D0372D;
  --red-600: #AE2B22;
  --red-50: #FDEDEC;
  --ink: #171B26;
  --ink-2: #353B48;
  --muted: #5D6575;
  --muted-2: #98A0AE;
  --line: #E4E7EC;
  --line-2: #EFF1F4;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --green: #1E7B52;
  --green-50: #E6F4EC;
  --amber: #9A5A06;
  --amber-50: #FFF4E0;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .06), 0 12px 24px -6px rgba(16, 24, 40, .10);
  --shadow-lg: 0 8px 16px -4px rgba(16, 24, 40, .08), 0 28px 48px -12px rgba(16, 24, 40, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar: 264px;
  font-family: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(37, 42, 61, .35); outline-offset: 2px; border-radius: 8px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Hiệu ứng xuất hiện ---------- */
html.js [data-anim] { opacity: 0; transform: translateY(16px); }
html.js [data-anim].in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-12px) rotate(var(--r, 0deg)); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(178, 107, 61, .45); } 100% { box-shadow: 0 0 0 10px rgba(178, 107, 61, 0); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(3deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes slide-in { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Nút ---------- */
.btn { --bg: var(--card); --fg: var(--ink); --bd: var(--line);
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--bd); background: var(--bg); background-origin: border-box; color: var(--fg);
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s; }
.btn:hover { color: var(--fg); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { --bg: var(--primary); --fg: #fff; --bd: var(--primary); }
.btn-primary:hover { --bg: var(--primary-600); }
.btn-red { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn-red:hover { --bg: var(--red-600); }
.btn-dark { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn-outline { --bg: transparent; --fg: var(--primary); --bd: var(--primary-100); }
.btn-outline:hover { --bd: var(--primary); background: var(--primary-50); }
.btn-ghost { --bg: transparent; --bd: transparent; --fg: var(--muted); }
.btn-ghost:hover { background: var(--primary-50); --fg: var(--primary); box-shadow: none; }
.btn-danger { --bg: var(--card); --fg: var(--red-600); --bd: #F3C7C9; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn[disabled], .btn.loading { opacity: .65; pointer-events: none; }
.btn.loading::after { content: ''; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .18; animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; transition: background .2s, transform .15s; }
.icon-btn:hover { background: var(--primary-50); color: var(--primary); }
.dot-badge { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red);
  color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; animation: pop .5s var(--ease), pulse-ring 1.8s 1s 2; }

/* ---------- Khung ứng dụng ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--card); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; z-index: 40; }
.brand { display: block; padding: 4px 8px; }
.brand img { height: 46px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px; color: var(--ink-2); font-weight: 500;
  transition: background .2s, color .2s, transform .2s var(--ease); }
.nav-item:hover { background: var(--primary-50); color: var(--primary); transform: translateX(2px); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 10px 22px -10px rgba(37, 42, 61, .7); }
.nav-item.active:hover { transform: none; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.side-card { margin-top: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--primary-50); font-size: 13px; color: var(--muted); }
.side-card b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.side-card-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.streak-card { background: var(--amber-50); }
.streak-flame { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--muted-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.streak-flame.lit { color: #E8590C; }
.streak-flame.lit .ic { fill: #FFB347; animation: flicker 1.6s ease-in-out infinite; }
.sidebar-backdrop { display: none; }
.main-wrap { min-width: 0; display: flex; flex-direction: column; position: relative; }
.main-wrap::before { content: ''; position: absolute; inset: 0 0 auto auto; width: 520px; height: 420px; pointer-events: none; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='420' fill='none' stroke='%231D3B9A' stroke-opacity='.08' stroke-width='1.5'%3E%3Cpath d='M520 60H380l-30 30H250M520 120H420l-40 40H300M520 200H460l-30-30H330M520 260H440l-20 20H360'/%3E%3Ccircle cx='250' cy='90' r='5'/%3E%3Ccircle cx='300' cy='160' r='5'/%3E%3Ccircle cx='330' cy='170' r='5'/%3E%3Ccircle cx='360' cy='280' r='5'/%3E%3C/svg%3E") no-repeat right top; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 32px;
  background: rgba(244, 246, 251, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 18px -16px rgba(16, 24, 40, .5); }
.topbar-title { font-weight: 600; color: var(--muted); font-size: 14px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: box-shadow .2s; }
.user-btn:hover { box-shadow: var(--shadow-md); }
.user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-meta b { font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 12px; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
[data-dropdown].open .chev { transform: rotate(180deg); }
.content { position: relative; padding: 8px 32px 32px; flex: 1; width: 100%; max-width: 1440px; }
.app-foot { padding: 18px 32px 26px; color: var(--muted-2); font-size: 13px; }
.only-mobile { display: none; }

/* ---------- Menu thả xuống ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .18s, transform .22s var(--ease), visibility .18s; z-index: 50; }
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu > a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--ink-2); font-size: 14px; cursor: pointer; text-align: left; }
.dropdown-menu > a:hover, .dropdown-menu button:hover { background: var(--primary-50); color: var(--primary); }
.dropdown-menu form { margin: 0; }
.notif-menu { width: 380px; padding: 6px; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 8px; }
.dropdown-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted-2); padding: 26px 12px; font-size: 14px; }
.dropdown-empty .ic { width: 28px; height: 28px; }
.dropdown-foot { justify-content: center; font-weight: 600; color: var(--primary) !important; border-top: 1px solid var(--line-2); border-radius: 0 0 10px 10px !important; margin-top: 4px; }
.notif { display: flex !important; gap: 12px !important; align-items: flex-start !important; padding: 10px !important; }
.notif.unread { background: var(--primary-50); }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.notif.unread .notif-ic { background: #fff; }
.notif-ic .ic { width: 17px; height: 17px; }
.notif-ic.k-success { background: var(--green-50); color: var(--green); }
.notif-ic.k-warn { background: var(--amber-50); color: var(--amber); }
.notif-ic.k-lesson { background: var(--red-50); color: var(--red); }
.notif-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.notif-body b { font-size: 14px; color: var(--ink); font-weight: 600; }
.notif-body small { color: var(--muted); font-size: 13px; }
.notif-body em { font-style: normal; color: var(--muted-2); font-size: 12px; margin-top: 2px; }

/* ---------- Thẻ & lưới ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card.hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-100); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-title { font-size: 17px; font-weight: 700; }
.card-body { padding: 18px 22px; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 24px; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.crumbs .ic { width: 14px; height: 14px; color: var(--muted-2); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--ink-2); font-weight: 500; }

/* Ô số liệu */
.stat { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat-ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.stat-ic.red { background: var(--red-50); color: var(--red); }
.stat-ic.green { background: var(--green-50); color: var(--green); }
.stat-ic.amber { background: var(--amber-50); color: #C2410C; }
.stat-label { color: var(--muted); font-size: 14px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 500; }

/* Nhãn */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge .ic { width: 14px; height: 14px; }
.b-green { background: var(--green-50); color: var(--green); }
.b-blue { background: var(--primary-50); color: var(--primary); }
.b-red { background: var(--red-50); color: var(--red-600); }
.b-amber { background: var(--amber-50); color: var(--amber); }
.b-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.subject-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.subject-tile { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.subject-tile .ic { width: 24px; height: 24px; }
.subject-tile.lg { width: 60px; height: 60px; border-radius: 18px; }
.subject-tile.lg .ic { width: 30px; height: 30px; }
.subject-tile.sm { width: 36px; height: 36px; border-radius: 10px; }
.subject-tile.sm .ic { width: 18px; height: 18px; }

/* Ảnh đại diện chữ */
.avatar { --av: var(--primary); width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--av); background: color-mix(in srgb, var(--av) 14%, white); flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }

/* Thanh tiến độ */
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--primary); transition: width 1.1s var(--ease); }
.progress.done span { background: var(--green); }
.progress.lg { height: 12px; }
html.js .progress:not(.in) span { width: 0; }

/* Vòng điểm */
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--line-2); }
.ring .bar { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 28px; font-weight: 700; line-height: 1; }
.ring-label small { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 12px 16px; background: #F8F9FB; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #FFFFFF; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: block; font-weight: 600; font-size: 14.5px; }
.person small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Biểu mẫu ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: 13px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field input[type=search], .field input[type=tel], .field input[type=date], .field input[type=time], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  transition: border-color .2s, box-shadow .2s; outline: none; }
.field textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23586174' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 42, 61, .12); }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.error-text { color: var(--red-600); font-size: 13px; }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; pointer-events: none; }
.input-icon input { padding-left: 42px !important; }
.input-icon .toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.input-icon .toggle-pass:hover { background: var(--primary-50); color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .25s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(37, 42, 61, .35); outline-offset: 2px; }
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); background: #FFFFFF; transition: border-color .2s, background .2s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .ic { width: 30px; height: 30px; margin: 0 auto 8px; }
.dropzone b { color: var(--ink); display: block; }
.dropzone .file-chosen { margin-top: 8px; font-weight: 600; color: var(--primary); }
.segmented { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--line-2); border-radius: 12px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.segmented span .ic { width: 17px; height: 17px; }
.segmented input:checked + span { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 3px solid rgba(37, 42, 61, .35); }

/* ---------- Thanh tab ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted); font-weight: 600; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); }
.tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); animation: fade-up .3s var(--ease); }
.tab .badge { height: 22px; }
.tab-panel[hidden] { display: none; }
.tab-panel { animation: fade-up .35s var(--ease); }

/* ---------- Hộp thoại ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .3s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 6px; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 14px 24px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; }

/* ---------- Thông báo nổi ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); animation: slide-in .45s var(--ease); font-size: 14.5px; }
.toast .ic { width: 20px; height: 20px; margin-top: 1px; }
.toast.success .ic { color: #6EE7A8; }
.toast.error .ic { color: #FF8A8F; }
.toast.info .ic { color: #9DB4FF; }
.toast.hide { transition: opacity .3s, transform .3s; opacity: 0; transform: translateX(40px); }

/* ---------- Trạng thái trống ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.empty-icon .ic { width: 34px; height: 34px; }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

/* ---------- Biểu ngữ gợi ý ---------- */
.banner { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius); background: var(--primary-50); border: 1px solid var(--primary-100); position: relative; overflow: hidden; }
.banner-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--card); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.banner-ic .ic { width: 24px; height: 24px; }
.banner b { display: block; font-size: 16px; }
.banner p { color: var(--muted); font-size: 14px; }
.banner.dark { background: var(--primary); border-color: var(--primary); color: #fff; }
.banner.dark b { color: #fff; }
.banner.dark p { color: #C9D1DE; }
.banner.dark::after { content: ''; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .06); }

/* ---------- Danh sách ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); color: var(--ink); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: #FFFFFF; color: var(--ink); }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta b { display: block; font-weight: 600; font-size: 14.5px; }
.list-item .meta small { display: block; color: var(--muted); font-size: 13px; }
.dot-item { position: relative; padding-left: 16px; }
.dot-item::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 4px; border-radius: 4px; background: var(--c, var(--primary)); }

/* ---------- Thẻ lớp, khóa học ---------- */
.class-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; color: var(--ink); height: 100%; }
.class-card:hover { color: var(--ink); }
.class-card h3 { font-size: 17px; font-weight: 700; }
.class-card .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.class-card .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.class-card .pct-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.class-card .pct-row b { color: var(--ink); }
.code-box { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--primary-50); border: 1px dashed var(--primary-100); }
.code-box code { font: 700 18px/1 ui-monospace, 'Cascadia Code', Consolas, monospace; letter-spacing: .14em; color: var(--primary); }

/* ---------- Khóa học: mục lục ---------- */
.chapter { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.chapter + .chapter { margin-top: 14px; }
.chapter-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #F8F9FB; border-bottom: 1px solid var(--line-2); }
.chapter-head h3 { font-size: 15.5px; font-weight: 700; }
.chapter-head .count { color: var(--muted); font-size: 13px; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink); background: var(--card); transition: background .15s, box-shadow .2s, transform .2s; }
.lesson-row:last-child { border-bottom: 0; }
a.lesson-row:hover { background: #FFFFFF; color: var(--ink); }
.lesson-row .type { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lesson-row .type .ic { width: 18px; height: 18px; }
.lesson-row .t-video { background: var(--red-50); color: var(--red); }
.lesson-row .t-slide { background: var(--amber-50); color: #C2410C; }
.lesson-row .t-document { background: var(--green-50); color: var(--green); }
.lesson-row .title { flex: 1; min-width: 0; font-weight: 500; }
.lesson-row .title small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.lesson-row .done-ic { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--green); flex-shrink: 0; }
.lesson-row .done-ic .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.lesson-row .todo-ic { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.lesson-row.current { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
.drag-handle { cursor: grab; color: var(--muted-2); display: flex; padding: 4px; border-radius: 6px; }
.drag-handle:hover { background: var(--line-2); color: var(--ink); }
.lesson-row.dragging { opacity: .55; box-shadow: var(--shadow-md); transform: scale(1.01); }
.lesson-row.drop-target { box-shadow: inset 0 3px 0 var(--primary); }

/* ---------- Trình phát bài học ---------- */
.player { position: relative; border-radius: 18px; overflow: hidden; background: #1B1E2B; aspect-ratio: 16 / 9; box-shadow: var(--shadow-md); }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #1B1E2B; }
.player.doc { aspect-ratio: auto; height: min(78vh, 760px); background: #ECEEF2; }
.player-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #CDD2DB; text-align: center; padding: 24px;
  background: radial-gradient(circle at 30% 20%, rgba(37, 42, 61, .55), transparent 55%), #1B1E2B; }
.player-empty .big-play { width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; color: #fff; }
.player-empty .big-play .ic { width: 34px; height: 34px; }
.skeleton { background: linear-gradient(90deg, #ECEEF2 0, #F5F6F8 120px, #ECEEF2 240px); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; }
.reading { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; word-break: break-word; max-width: 100%; overflow-x: hidden; }
.reading h3 { font-size: 19px; margin: 22px 0 8px; color: var(--ink); line-height: 1.35; }
.reading p { margin: 0 0 14px; }
.reading ul, .reading ol { margin: 0 0 14px; padding-left: 22px; }
.reading ol li { margin-bottom: 6px; }
.reading li { margin: 4px 0; }
.reading code { background: #F1F5F9; padding: 2px 6px; border-radius: 6px; font-size: .9em; word-break: break-word; }
.reading pre.calc { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; padding: 14px 16px; border-radius: 12px; background: #F8FAFC; border: 1px solid #E2E8F0; font-size: 14px; line-height: 1.6; }
.reading img.q-img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 12px 0; border: 1px solid #E2E8F0; }
.reading .doc-dl { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 9px 14px; margin: 4px 0; border-radius: 12px; background: #EEF4FF; border: 1px solid #C7DAFF; color: #1D4ED8; font-weight: 700; font-size: 14.5px; line-height: 1.4; text-decoration: none; word-break: break-word; }
.reading .doc-dl:hover { background: #DBEAFE; border-color: #93C5FD; }
@media (max-width: 640px) {
  .card-pad, .reading.card-pad { padding: 16px 16px; }
  .reading { font-size: 15.5px; line-height: 1.72; }
  .reading h3 { font-size: 17.5px; }
  .reading ul, .reading ol { padding-left: 20px; }
}
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.complete-btn.done { --bg: var(--green); --bd: var(--green); --fg: #fff; }
.confetti { position: fixed; pointer-events: none; z-index: 300; width: 9px; height: 14px; border-radius: 2px; }

/* ---------- Biểu đồ ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .area { fill: url(#chartFill); }
.chart .line { fill: none; stroke: var(--copper); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; }
.chart.in .line { animation: draw 1.8s var(--ease) forwards; }
.chart .dot { fill: #fff; stroke: var(--copper); stroke-width: 2.5; }
.chart text { fill: var(--muted-2); font-size: 11px; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: 12px; font-size: 14px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Bộ lọc ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .field { flex-direction: row; }
.search-box { position: relative; flex: 1 1 260px; max-width: 380px; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; }
.search-box input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); outline: none; transition: border-color .2s, box-shadow .2s; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 42, 61, .12); }
.select-sm { height: 44px; padding: 0 38px 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23586174' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; outline: none; }
.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.pager .on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* =========================================================
   Trang công khai
   ========================================================= */
.public { background: #FFFFFF; }
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(251, 252, 254, .85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s; }
.site-nav.scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgba(16, 24, 40, .5); }
.site-nav .inner { max-width: 1240px; margin: 0 auto; height: 80px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.site-nav .logo img { height: 48px; width: auto; }
.site-links { display: flex; gap: 6px; }
.site-links a { padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 15px; transition: background .2s, color .2s; }
.site-links a:hover { background: var(--primary-50); color: var(--primary); }
.site-nav .cta { margin-left: auto; display: flex; gap: 10px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--primary); font-size: 13.5px; font-weight: 600; }
.eyebrow .ic { width: 16px; height: 16px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; margin-top: 14px; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 17px; margin-top: 12px; }

.hero { position: relative; overflow: hidden; padding: 56px 0 40px; }
.hero::before { content: ''; position: absolute; width: 640px; height: 640px; right: -140px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(37, 42, 61, .14), transparent 65%); pointer-events: none; }
.hero::after { content: ''; position: absolute; width: 420px; height: 420px; left: -160px; bottom: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(178, 107, 61, .08), transparent 65%); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin: 18px 0 18px; }
.hero h1 .hl { color: var(--primary); position: relative; white-space: nowrap; }
.hero h1 .hl svg { position: absolute; left: 0; bottom: -10px; width: 100%; height: 14px; }
.hero h1 .hl path { stroke: var(--red); stroke-width: 4; fill: none; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.4s .6s var(--ease) forwards; }
.hero .lead { font-size: 18.5px; color: var(--muted); max-width: 560px; }
.hero .actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.trust { display: flex; gap: 32px; margin-top: 38px; flex-wrap: wrap; }
.trust div b { display: block; font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.trust div span { color: var(--muted); font-size: 14px; }
.hero-visual { position: relative; height: 500px; }
.hv-card { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 18px; animation: float 6s ease-in-out infinite; }
.hv-main { left: 6%; top: 40px; width: 74%; padding: 0; overflow: hidden; --r: -2deg; animation-delay: -1s; }
.hv-main .bar { display: flex; gap: 6px; padding: 12px 16px; background: #10172B; }
.hv-main .bar i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.hv-main .bar i:nth-child(2) { background: #FEBC2E; }
.hv-main .bar i:nth-child(3) { background: #28C840; }
.hv-main .body { background: #141C33; color: #fff; padding: 26px 24px 30px; }
.hv-main .q { font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.hv-main .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.hv-main .opts span { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .07); font-size: 14px; color: #CDD2DB; }
.hv-main .opts span.ok { background: rgba(28, 124, 84, .35); color: #fff; box-shadow: inset 0 0 0 1.5px #3DBE85; }
.hv-score { right: 0; top: 120px; width: 190px; text-align: center; --r: 3deg; animation-delay: -3s; }
.hv-score .ring { margin: 4px auto 8px; width: 110px; height: 110px; }
.hv-progress { left: 0; bottom: 70px; width: 290px; --r: 1.5deg; animation-delay: -2s; }
.hv-progress .row-between { font-size: 14px; margin-bottom: 10px; }
.hv-toast { right: 4%; bottom: 20px; width: 300px; display: flex; gap: 12px; align-items: center; --r: -1.5deg; animation-delay: -4s; }
.hv-toast .ic-wrap { width: 40px; height: 40px; border-radius: 12px; background: var(--green-50); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hv-toast b { display: block; font-size: 14px; }
.hv-toast small { color: var(--muted); font-size: 12.5px; }
.ok-chip { position: absolute; right: 18px; top: 58px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #E4F4EC; color: var(--green); font-weight: 700; font-size: 13px; animation: pop .6s 1.2s var(--ease) both; }
.ok-chip .ic { width: 16px; height: 16px; }

.marquee { overflow: hidden; padding: 18px 0; border-block: 1px solid var(--line); background: var(--card); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee .pill { height: 44px; padding: 0 18px; font-size: 15px; }
.marquee .pill .ic { color: var(--c); }

.level-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.level-card .lv-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; transition: transform .4s var(--ease), background .3s, color .3s; }
.level-card .lv-ic .ic { width: 26px; height: 26px; }
.level-card:hover .lv-ic { transform: rotate(-8deg) scale(1.08); background: var(--primary); color: #fff; }
.level-card.hsg .lv-ic { background: var(--red-50); color: var(--red); }
.level-card.hsg:hover .lv-ic { background: var(--red); color: #fff; }
.level-card h3 { font-size: 20px; }
.level-card p { color: var(--muted); font-size: 14.5px; }
.level-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.level-card li { display: flex; gap: 8px; align-items: flex-start; }
.level-card li .ic { width: 18px; height: 18px; color: var(--green); margin-top: 2px; }

.feature { padding: 26px; height: 100%; }
.feature .f-ic { width: 50px; height: 50px; border-radius: 14px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; box-shadow: 0 12px 24px -12px rgba(37, 42, 61, .8); }
.feature .f-ic.red { background: var(--red); box-shadow: 0 12px 24px -12px rgba(178, 107, 61, .8); }
.feature .f-ic .ic { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; }
.soon { display: inline-flex; margin-left: 6px; vertical-align: middle; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; position: relative; }
.steps::before { content: ''; position: absolute; top: 28px; left: 12%; right: 12%; height: 2px; background: repeating-linear-gradient(90deg, var(--primary-100) 0 10px, transparent 10px 18px); }
.step { position: relative; text-align: center; padding: 0 8px; }
.step .num { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: var(--card); border: 2px solid var(--primary); color: var(--primary); font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; transition: background .3s, color .3s, transform .3s var(--ease); }
.step:hover .num { background: var(--primary); color: #fff; transform: scale(1.08); }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14.5px; }

.roles { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.role-tabs { display: flex; flex-direction: column; gap: 8px; }
.role-tab { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; transition: border-color .2s, box-shadow .25s, transform .2s var(--ease); }
.role-tab:hover { transform: translateX(3px); }
.role-tab .r-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.role-tab b { display: block; font-size: 16px; }
.role-tab small { color: var(--muted); font-size: 13px; }
.role-tab.active { border-color: var(--primary); box-shadow: var(--shadow-md); }
.role-tab.active .r-ic { background: var(--primary); color: #fff; }
.role-panel { padding: 32px; min-height: 340px; }
.role-panel[hidden] { display: none; }
.role-panel h3 { font-size: 24px; margin-bottom: 10px; }
.role-panel > p { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.role-panel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-panel li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--bg); font-size: 15px; animation: fade-up .4s var(--ease) both; }
.role-panel li:nth-child(2) { animation-delay: .05s; } .role-panel li:nth-child(3) { animation-delay: .1s; } .role-panel li:nth-child(4) { animation-delay: .15s; } .role-panel li:nth-child(5) { animation-delay: .2s; } .role-panel li:nth-child(6) { animation-delay: .25s; }
.role-panel li .ic { width: 20px; height: 20px; color: var(--primary); margin-top: 2px; }

.cta-band { position: relative; overflow: hidden; border-radius: 28px; background: var(--primary); color: #fff; padding: 56px; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta-band::before { content: ''; position: absolute; right: -80px; top: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.cta-band::after { content: ''; position: absolute; left: 30%; bottom: -160px; width: 300px; height: 300px; border-radius: 50%; background: rgba(178, 107, 61, .35); filter: blur(70px); }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); font-weight: 800; }
.cta-band p { color: #C9D1DE; margin-top: 8px; font-size: 17px; }
.cta-band .btn-white { --bg: #fff; --fg: var(--primary); --bd: #fff; }
.cta-band .btn-ghost-w { --bg: transparent; --fg: #fff; --bd: rgba(255, 255, 255, .4); }
.site-foot { border-top: 1px solid var(--line); padding: 36px 0; margin-top: 88px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-foot img { height: 40px; }

/* ---------- Trang đăng nhập ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form { display: flex; flex-direction: column; padding: 32px 48px; }
.auth-form .logo img { height: 48px; }
.auth-box { width: 100%; max-width: 440px; margin: auto; padding: 32px 0; }
.auth-box h1 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.auth-box .sub { color: var(--muted); margin: 8px 0 28px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-google { --bg: #fff; --fg: var(--ink); --bd: var(--line); width: 100%; height: 50px; }
.btn-google .ic { width: 20px; height: 20px; }
.auth-side { position: relative; overflow: hidden; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-side::before { content: ''; position: absolute; inset: 0; opacity: .5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.5'%3E%3Cpath d='M0 120h180l40 40h120M0 260h120l40-40h200l30 30h210M600 400H420l-40 40H240M600 520H480l-30-30H300'/%3E%3Ccircle cx='340' cy='160' r='6'/%3E%3Ccircle cx='570' cy='250' r='6'/%3E%3Ccircle cx='240' cy='440' r='6'/%3E%3Ccircle cx='300' cy='490' r='6'/%3E%3C/svg%3E") center / cover; }
.auth-side::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(178, 107, 61, .4); filter: blur(90px); }
.auth-side .inner { position: relative; z-index: 1; max-width: 460px; }
.auth-side h2 { color: #fff; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.auth-side p { color: #C9D1DE; font-size: 17px; margin-top: 12px; }
.auth-cards { position: relative; height: 260px; margin-top: 40px; }
.auth-cards .hv-card { color: var(--ink); }
.demo-box { margin-top: 26px; padding: 16px; border-radius: 16px; background: var(--bg); border: 1px dashed var(--line); }
.demo-box b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.demo-box b .ic { width: 16px; height: 16px; color: var(--primary); }
.demo-box p { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-grid button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; font-size: 14px; transition: border-color .2s, transform .15s, box-shadow .2s; }
.demo-grid button:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.demo-grid button small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Trang lỗi ---------- */
.error-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { text-align: center; max-width: 460px; }
.error-logo { height: 44px; margin: 0 auto 28px; }
.error-code { font-size: 96px; font-weight: 800; line-height: 1; color: var(--primary); letter-spacing: -.04em; }
.error-card h1 { font-size: 26px; margin: 10px 0 8px; }
.error-card p { color: var(--muted); margin-bottom: 26px; }

/* ---------- Trình cài đặt ---------- */
.installer { min-height: 100vh; padding: 40px 20px; }
.installer .box { max-width: 760px; margin: 0 auto; }
.installer .head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.installer .head img { height: 52px; }
.req { display: flex; flex-direction: column; gap: 8px; }
.req div { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.req .ok { color: var(--green); } .req .bad { color: var(--red-600); }
.req .ic { width: 18px; height: 18px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14.5px; }
.alert .ic { margin-top: 1px; }
.alert-error { background: var(--red-50); color: var(--red-600); }
.alert-ok { background: var(--green-50); color: var(--green); }
.alert-info { background: var(--primary-50); color: var(--primary); }
.cred { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 18px; font-size: 14.5px; align-items: center; }
.cred code { background: var(--bg); padding: 3px 8px; border-radius: 6px; font-size: 13.5px; }

/* =========================================================
   Đáp ứng màn hình nhỏ
   ========================================================= */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { height: 460px; max-width: 620px; width: 100%; margin: 0 auto; }
  .site-links { display: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .4); z-index: 35; animation: fade-up .2s; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 8px 16px 24px; }
  .app-foot { padding: 16px; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-meta { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-form { padding: 24px 16px; }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .role-tabs { flex-direction: row; overflow-x: auto; }
  .role-tab { flex: 0 0 auto; }
  .role-tab small { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .steps::before { display: none; }
}
@media (max-width: 640px) {
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; gap: 10px; flex-direction: column; }
  .stat-ic { width: 38px; height: 38px; border-radius: 12px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 23px; }
  .topbar-title { display: none; }
  .notif-menu { width: calc(100vw - 32px); right: -60px; }
  .section { padding: 60px 0; }
  .site-nav .inner { padding: 0 16px; gap: 12px; height: 68px; }
  .site-nav .logo img { height: 38px; }
  .site-nav .cta .btn-outline { padding: 0 14px; min-height: 40px; font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .hero-visual { height: 400px; transform: scale(.86); transform-origin: top center; margin-bottom: -50px; }
  .hv-toast { width: 250px; }
  .role-panel { padding: 22px; }
  .role-panel ul { grid-template-columns: minmax(0, 1fr); }
  .cta-band { padding: 32px 24px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 100px 1fr 44px; }
  .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .banner { flex-wrap: wrap; }
  .banner > .btn, .banner > form { width: 100%; }
  .banner > .btn { justify-content: center; }
  .stat-value { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html.js [data-anim] { opacity: 1; transform: none; }
}

/* ---------- Bổ sung ---------- */
.ic-xs { width: 14px; height: 14px; vertical-align: -2px; }
@media (min-width: 961px) { .table-wrap { overflow: visible; } }
.switch input:checked + .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--av); }
.switch .avatar { transition: box-shadow .2s, transform .2s; }
.switch:hover .avatar { transform: scale(1.08); }
.heatmap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hm-label { font-size: 11.5px; color: var(--muted-2); text-align: center; }
.hm-cell { aspect-ratio: 1; border-radius: 7px; background: var(--line-2); }
.hm-cell.on { background: var(--green); animation: pop .5s var(--ease) both; animation-delay: calc(var(--i) * 25ms); }
.hm-cell.future { background: transparent; border: 1.5px dashed var(--line); }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; background: var(--line-2); padding: 2px 7px; border-radius: 6px; }
code.badge { background: var(--primary-50); }
@media print { html.js [data-anim] { opacity: 1; transform: none; } .sidebar, .topbar { display: none; } }
.dot-mark { width: 4px; height: 34px; border-radius: 4px; background: var(--c, var(--primary)); flex-shrink: 0; }

/* ================= Phiên bản 1.1 · Bài kiểm tra, tiến độ tự động, học tuần tự ================= */
.c-green { color: var(--green) !important; }
.c-red { color: var(--red-600) !important; }
.text-center { text-align: center; }
.section-title { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.ring .bar { stroke: var(--ring-color, var(--primary)); }
.ring.sm { width: 92px; height: 92px; flex-shrink: 0; }
.ring.sm .ring-label b { font-size: 21px; }
.ring.lg { width: 168px; height: 168px; flex-shrink: 0; }
.ring.lg .ring-label b { font-size: 40px; }
.ring.lg .ring-label small { font-size: 13px; }
.lesson-row .t-quiz { background: #F1EBFA; color: #A8623A; }

/* Trạng thái bài: khóa / đang học dở */
.lesson-row.locked { opacity: .62; }
.lesson-row.locked .type { filter: grayscale(1); }
.lesson-row.locked:hover { background: var(--card); cursor: not-allowed; }
.lesson-row .lock-ic { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted-2); background: var(--line-2); flex-shrink: 0; }
.lesson-row .lock-ic .ic { width: 14px; height: 14px; }
.mini-ring { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line-2) 0); position: relative; }
.mini-ring::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.lesson-row.current .mini-ring::after { background: var(--primary-50); }
.lesson-row.up-next { box-shadow: inset 3px 0 0 var(--red); }
.lesson-row.just-unlocked { animation: unlockFlash 1.6s var(--ease); }
@keyframes unlockFlash { 0% { background: #FFF6D6; } 100% { background: var(--card); } }
.btn.is-locked { opacity: .55; cursor: not-allowed; }
.btn.pulse { animation: btnPulse 1.6s var(--ease) 2; }
@keyframes btnPulse { 0% { box-shadow: 0 0 0 0 rgba(37, 42, 61, .45); } 100% { box-shadow: 0 0 0 14px rgba(37, 42, 61, 0); } }

/* Vòng tiến độ tự động */
.auto-progress { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--primary-50); max-width: 360px; }
.auto-progress .ap-ring { --p: 0; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--primary) calc(var(--p) * 1%), #fff 0); display: flex; align-items: center; justify-content: center; transition: background .6s; }
.auto-progress .ap-ring > span { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-50); display: flex; align-items: center; justify-content: center; color: #fff; }
.auto-progress .ap-ring .ic { width: 15px; height: 15px; stroke-width: 2.8; }
.auto-progress .ap-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.auto-progress .ap-text b { font-size: 14px; color: var(--primary); }
.auto-progress .ap-text small { font-size: 12px; color: var(--muted); }
.auto-progress.done { background: var(--green-50); }
.auto-progress.done .ap-ring { background: var(--green); }
.auto-progress.done .ap-ring > span { background: var(--green); }
.auto-progress.done .ap-text b { color: var(--green); }

/* Trang bài bị khóa */
.locked-card { max-width: 620px; margin: 24px auto; padding: 44px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.locked-card h1 { font-size: 24px; }
.lock-orb { width: 84px; height: 84px; border-radius: 26px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), #3A4260); color: #fff; box-shadow: var(--shadow-lg); animation: lockWiggle 2.4s var(--ease) 1 .4s; }
.lock-orb .ic { width: 38px; height: 38px; }
@keyframes lockWiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
.blocker { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-align: left; }
.blocker .type { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary-50); color: var(--primary); }
.blocker b { display: block; }

/* Giới thiệu bài kiểm tra */
.quiz-intro { overflow: hidden; }
.quiz-intro-head { display: flex; align-items: center; gap: 18px; padding: 24px; background: linear-gradient(120deg, #F8EEE4, #F1F3F7 70%); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.quiz-intro-head h2 { font-size: 19px; }
.quiz-badge { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: #A8623A; color: #fff; box-shadow: 0 12px 24px -12px rgba(150, 90, 50, .7); flex-shrink: 0; }
.quiz-badge .ic { width: 28px; height: 28px; }
.quiz-facts { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line-2); }
.quiz-facts > div { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line-2); }
.quiz-facts > div:last-child { border-right: 0; }
.quiz-facts .ic { color: var(--primary); width: 20px; height: 20px; margin-bottom: 4px; }
.quiz-facts b { font-size: 16px; }
.quiz-facts span { font-size: 12.5px; color: var(--muted); }
.quiz-cta { padding: 20px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.quiz-cta .alert { flex: 1; margin: 0; }
.quiz-intro .table-wrap { border-top: 1px solid var(--line-2); }

/* Khung làm bài */
.quiz-shell { display: flex; flex-direction: column; gap: 16px; }
.quiz-bar { position: sticky; top: 76px; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); }
.quiz-title { min-width: 0; display: flex; flex-direction: column; }
.quiz-title b { font-size: 15.5px; }
.quiz-title small { font-size: 12.5px; }
.quiz-timer { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.quiz-timer .ic { width: 18px; height: 18px; }
.quiz-timer.warn { background: var(--red); animation: timerBlink 1s steps(2) infinite; }
@keyframes timerBlink { 50% { background: var(--red-600); } }
.quiz-progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: -8px; }
.quiz-progress span { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--primary), #C98552); border-radius: inherit; transition: width .5s var(--ease); }
.quiz-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.quiz-questions { display: flex; flex-direction: column; gap: 16px; }
.quiz-shell.paged .qslide { display: none; }
.quiz-shell.paged .qslide.active { display: block; animation: slideIn .35s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.qslide { padding: 26px 28px; }
.qslide-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qnum { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.qcontent { font-size: 16px; line-height: 1.65; white-space: normal; }
.qcontent.big { font-size: 19px; font-weight: 500; margin-bottom: 22px; color: var(--ink); }
.flag-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; }
.flag-btn .ic { width: 15px; height: 15px; }
.flag-btn.on { background: var(--amber-50); color: var(--amber); border-color: #F5D9A8; }
.choices { display: grid; gap: 12px; }
.choice { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .2s, background .2s, transform .15s, box-shadow .2s; background: #fff; }
.choice:hover { border-color: #B9C6EA; background: #FFFFFF; }
.choice:active { transform: scale(.995); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-key { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); flex-shrink: 0; transition: all .2s; background: #fff; }
.choice-key .ic { width: 18px; height: 18px; }
.choice-text { font-size: 16px; line-height: 1.5; }
.choice input[type=checkbox] + .choice-key { border-radius: 8px; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(37, 42, 61, .12); }
.choice input:checked + .choice-key { background: var(--primary); border-color: var(--primary); color: #fff; }
.choice input:focus-visible + .choice-key { outline: 3px solid rgba(37, 42, 61, .35); outline-offset: 2px; }
.short-input { height: 56px !important; font-size: 18px !important; font-weight: 600; }
.qslide-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.quiz-nav { position: sticky; top: 160px; }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 16px 18px; }
.qdot { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; position: relative; transition: all .2s; }
.qdot:hover { border-color: var(--primary); color: var(--primary); }
.qdot.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.qdot.flagged::after { content: ''; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #F2A93B; border: 2px solid #fff; }
.qdot.current { box-shadow: 0 0 0 3px rgba(178, 107, 61, .35); border-color: var(--red); }
.qdot.answered.current { border-color: var(--red); }
.qdot.sm { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; cursor: default; }
.qdot.sm.flagged { background: #F2A93B; border-color: #F2A93B; }
.qdot.sm.flagged::after { display: none; }
.qlegend { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 18px 16px; }

/* Kết quả */
.result-hero { display: flex; gap: 32px; align-items: center; padding: 30px 32px; flex-wrap: wrap; position: relative; overflow: hidden; }
.result-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--green); }
.result-hero.fail::before { background: var(--red); }
.result-hero.pass { background: linear-gradient(120deg, #F1FAF5, #fff 55%); }
.result-hero h1 { font-size: 28px; margin: 10px 0 4px; }
.result-stats { display: flex; gap: 28px; margin-top: 16px; flex-wrap: wrap; }
.result-stats div { display: flex; flex-direction: column; }
.result-stats b { font-size: 24px; font-variant-numeric: tabular-nums; }
.result-stats span { font-size: 13px; color: var(--muted); }

/* Ngân hàng câu hỏi */
.qcard { overflow: hidden; }
.qcard-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); background: #FFFFFF; flex-wrap: wrap; }
.qcard-head .qnum { width: 30px; height: 30px; font-size: 13px; background: var(--ink-2); }
.qcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.qopts { display: grid; gap: 8px; }
.qopts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qopt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 15px; }
.qkey { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--line-2); color: var(--muted); flex-shrink: 0; }
.qkey .ic { width: 14px; height: 14px; }
.qopt.correct { border-color: #BFE3D0; background: var(--green-50); }
.qopt.correct .qkey { background: var(--green); color: #fff; }
.qopt.wrong { border-color: #F6C6C8; background: var(--red-50); }
.qopt.wrong .qkey { background: var(--red); color: #fff; }
.qtag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.qexpl { border-radius: 12px; background: #F8F9FB; border: 1px solid var(--line-2); padding: 10px 14px; font-size: 14.5px; line-height: 1.6; }
.qexpl summary, .qexpl-title { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--primary); list-style: none; }
.qexpl summary::-webkit-details-marker { display: none; }
.qexpl summary .ic, .qexpl-title .ic { width: 16px; height: 16px; }
.qexpl > div { margin-top: 6px; }
.qexpl.open { background: #F5F8FF; border-color: var(--primary-100); }
.qreview.ok .qcard-head { box-shadow: inset 4px 0 0 var(--green); }
.qreview.bad .qcard-head { box-shadow: inset 4px 0 0 var(--red); }

/* Soạn câu hỏi */
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt-row { display: flex; align-items: center; gap: 10px; }
.opt-row input[type=text] { flex: 1; }
.opt-key { position: relative; cursor: pointer; }
.opt-key input { position: absolute; opacity: 0; }
.opt-key span { width: 44px; height: 44px; border-radius: 12px; border: 1.5px dashed var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); transition: all .2s; }
.opt-key:hover span { border-color: var(--green); color: var(--green); }
.opt-key input:checked + span { background: var(--green); border: 1.5px solid var(--green); color: #fff; box-shadow: 0 6px 14px -8px rgba(28, 124, 84, .8); }
.opt-key input:focus-visible + span { outline: 3px solid rgba(28, 124, 84, .35); }
.sym { min-width: 34px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 15px; cursor: pointer; color: var(--ink-2); }
.sym:hover { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }

/* Chọn câu hỏi cho bài kiểm tra */
.qpick-tools { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; align-items: center; }
.qpick-tools .input-icon { min-width: 220px; }
.qpick-random input[type=number] { width: 70px; height: 40px; }
.qpick-random select { height: 40px; width: auto; }
.qpool { max-height: 560px; overflow-y: auto; position: relative; }
.qpick { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .15s; }
.qpick:hover { background: #FFFFFF; }
.qpick input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.qpick.on { background: var(--primary-50); }
.qpick-body { min-width: 0; }
.qpick-text { font-size: 14.5px; line-height: 1.5; }

/* Kết quả lớp / sổ điểm */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 26px; gap: 10px; align-items: center; }
.bar-track { height: 12px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-track span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--primary); }
.bar-track .r { background: var(--red); } .bar-track .a { background: #F2A93B; } .bar-track .g { background: var(--green); }
.qrate { min-width: 52px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.qrate.r { background: var(--red-50); color: var(--red-600); } .qrate.a { background: var(--amber-50); color: var(--amber); } .qrate.g { background: var(--green-50); color: var(--green); }
.progress.warn span { background: #F2A93B; }
.score-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.score-chip.ok { background: var(--green-50); color: var(--green); }
.score-chip.bad { background: var(--red-50); color: var(--red-600); }
.gradebook th a { color: inherit; }
.gradebook th a:hover { color: var(--primary); }

@media (max-width: 960px) {
  .quiz-main { grid-template-columns: 1fr; }
  .quiz-nav { position: static; order: -1; }
  .quiz-nav .card-head, .quiz-nav .card-body, .qlegend { display: none; }
  .qgrid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); padding: 12px; }
  .quiz-bar { top: 66px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .quiz-facts { grid-template-columns: repeat(2, 1fr); }
  .quiz-facts > div:nth-child(2) { border-right: 0; }
  .quiz-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .qslide { padding: 18px 16px; }
  .qcontent.big { font-size: 17px; }
  .quiz-bar { padding: 8px; gap: 8px; }
  .quiz-bar .btn-red { padding: 0 12px; }
  .quiz-timer { padding: 0 10px; font-size: 15px; }
  .result-hero { padding: 24px 18px; gap: 18px; justify-content: center; text-align: center; }
  .result-hero .row, .result-stats { justify-content: center; }
  .qopts-2 { grid-template-columns: 1fr; }
  .auto-progress { max-width: 100%; }
  .lesson-nav .row { width: 100%; justify-content: space-between; }
}
.qpick-random input[type=number] { border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: #fff; }
.qpick-tools .search-box { min-width: 220px; }

/* ================= Phiên bản 1.2 · Trí tuệ nhân tạo ================= */
:root { --ai: #C07E4D; --ai-2: #8A4F2B; --ai-50: #F8ECE1; }
.btn-ai { background: linear-gradient(120deg, var(--ai), var(--ai-2)); color: #fff; border: 0; box-shadow: 0 10px 22px -12px rgba(150, 90, 50, .8); }
.btn-ai:hover { color: #fff; filter: brightness(1.08); box-shadow: 0 14px 26px -12px rgba(150, 90, 50, .9); }
.btn-ai[disabled] { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.btn-ai-ghost { background: var(--ai-50); color: var(--ai); border: 1px solid #EBD5C3; }
.btn-ai-ghost:hover { background: #F3E3D5; color: var(--ai); }
.ai-ic { color: var(--ai) !important; }
.ai-ic:hover { background: var(--ai-50) !important; }
.badge.b-ai { background: linear-gradient(120deg, var(--ai), var(--ai-2)); color: #fff; }
.ai-orb { width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--ai), var(--ai-2)); box-shadow: 0 8px 18px -10px rgba(150, 90, 50, .9); position: relative; overflow: hidden; }
.ai-orb::after { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, .35), transparent 40%); animation: orbSpin 4s linear infinite; }
.ai-orb .ic { width: 20px; height: 20px; position: relative; z-index: 1; }
.ai-orb.sm { width: 28px; height: 28px; border-radius: 9px; vertical-align: middle; margin-right: 6px; }
.ai-orb.sm .ic { width: 15px; height: 15px; }
.ai-orb.lg { width: 72px; height: 72px; border-radius: 22px; }
.ai-orb.lg .ic { width: 34px; height: 34px; }
@keyframes orbSpin { to { transform: rotate(360deg); } }
.ai-card { overflow: hidden; border-color: #EEDCCB; background: linear-gradient(180deg, #FFFFFF, #fff 60%); }
.ai-card-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; flex-wrap: wrap; }
.ai-card-head b { display: block; font-size: 15.5px; }
.ai-card-head .small { display: block; }
.ai-out { padding: 0 18px 18px; }
.qcard-body .ai-out, [data-ai-box] > .ai-out { padding: 12px 0 0; }
.ai-out.ai-in { animation: aiIn .5s var(--ease); }
@keyframes aiIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ai-text { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid #EEDCCB; border-left: 4px solid var(--ai); }
.ai-text > :first-child { margin-top: 0; }
.ai-text > :last-child { margin-bottom: 0; }
.ai-text h4 { font-size: 14.5px; margin: 12px 0 4px; color: var(--ai); }
.ai-text p { margin: 6px 0; }
.ai-text ul, .ai-text ol { margin: 6px 0; padding-left: 20px; }
.ai-text li { margin: 3px 0; }
.ai-text code { background: var(--ai-50); padding: 1px 6px; border-radius: 6px; font-size: .95em; }
.ai-error { padding: 12px 14px; border-radius: 12px; background: var(--red-50); color: var(--red-600); font-size: 14px; }
.ai-ok { padding: 10px 14px; border-radius: 12px; background: var(--green-50); color: var(--green); font-size: 14px; margin-bottom: 10px; }
.ai-thinking { display: inline-flex; gap: 5px; align-items: center; margin-right: 10px; vertical-align: middle; }
.ai-thinking span { width: 8px; height: 8px; border-radius: 50%; background: var(--ai); animation: think 1.2s ease-in-out infinite; }
.ai-thinking span:nth-child(2) { animation-delay: .15s; background: #C78A5C; }
.ai-thinking span:nth-child(3) { animation-delay: .3s; background: var(--ai-2); }
@keyframes think { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.ai-side { background: linear-gradient(135deg, var(--ai-50), var(--primary-50)); }
.ai-side .side-card-ic { background: linear-gradient(135deg, var(--ai), var(--ai-2)); }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); margin-left: 4px; vertical-align: 1px; }
.mini-stat { padding: 10px 12px; border-radius: 12px; background: #F8F9FB; border: 1px solid var(--line-2); display: flex; flex-direction: column; }
.mini-stat b { font-size: 18px; }
.mini-stat span { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .2s; background: #fff; }
.chip span .ic { width: 15px; height: 15px; }
.chip input:checked + span { border-color: var(--ai); color: var(--ai); background: var(--ai-50); }
.chip input:focus-visible + span { outline: 3px solid rgba(150, 90, 50, .3); }
.chip-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #EBD5C3; background: #fff; color: var(--ai); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .2s; }
.chip-btn:hover { background: var(--ai-50); }

/* AI soạn câu hỏi */
.aigen-empty, .aigen-loading { padding: 48px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.aigen-empty h3 { font-size: 18px; }
.aigen-loading .ai-thinking span { width: 12px; height: 12px; }
.aiq { animation: aiIn .45s var(--ease) both; transition: opacity .2s; }
.aiq.off { opacity: .45; }

/* Tự luận */
.essay-input { min-height: 260px !important; font-size: 16px !important; line-height: 1.7 !important; }
.essay-answer { padding: 14px 16px; border-radius: 12px; background: #F8F9FB; border: 1px solid var(--line-2); line-height: 1.7; font-size: 15px; max-height: 360px; overflow-y: auto; }
.ai-mark { border-radius: 14px; border: 1px solid #EEDCCB; background: #FFFFFF; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-mark.by-teacher { border-color: #CFE0F7; background: #F6F9FF; }
.ai-mark-head { display: flex; align-items: center; gap: 12px; }
.ai-mark-head b { font-size: 14px; }
.ai-score { font-size: 28px; font-weight: 800; color: var(--ai); line-height: 1; font-variant-numeric: tabular-nums; }
.by-teacher .ai-score { color: var(--primary); }
.ai-score small { font-size: 14px; color: var(--muted); font-weight: 600; }
.ai-mark .ai-text { background: transparent; border: 0; padding: 0; }
.mark-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.mark-form .field { margin: 0; }
.qreview.wait .qcard-head { box-shadow: inset 4px 0 0 #F2A93B; }

/* Trợ lý AI trong bài học */
.tutor-fab { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--ai), var(--ai-2)); box-shadow: 0 18px 36px -14px rgba(150, 90, 50, .9); transition: transform .25s var(--ease), opacity .2s; animation: fabIn .6s var(--ease) .4s both; }
.tutor-fab:hover { transform: translateY(-2px) scale(1.02); }
.tutor-fab .ai-orb { background: rgba(255, 255, 255, .2); box-shadow: none; }
.tutor-fab.hide { opacity: 0; pointer-events: none; transform: scale(.8); }
@keyframes fabIn { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
.tutor { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; border: 1px solid #EEDCCB; box-shadow: 0 30px 70px -20px rgba(30, 20, 70, .45); overflow: hidden;
  opacity: 0; transform: translateY(18px) scale(.97); transform-origin: bottom right; transition: opacity .25s, transform .3s var(--ease); }
.tutor.open { opacity: 1; transform: none; }
.tutor-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: linear-gradient(120deg, var(--ai-50), #F1F3F7); border-bottom: 1px solid #F1E2D4; }
.tutor-head b { display: block; font-size: 15px; }
.tutor-head small { display: block; color: var(--muted); font-size: 12.5px; }
.tutor-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #FCFBFF; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.msg .bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; animation: aiIn .3s var(--ease); }
.msg.bot .bubble { background: #fff; border: 1px solid #F1E2D4; border-bottom-left-radius: 6px; color: var(--ink-2); }
.msg.me .bubble { background: linear-gradient(120deg, var(--ai), var(--ai-2)); color: #fff; border-bottom-right-radius: 6px; }
.msg .bubble .ai-text { background: none; border: 0; padding: 0; }
.tutor-suggest { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 0; scrollbar-width: none; }
.tutor-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px 14px; }
.tutor-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 11px 14px; border-radius: 14px; border: 1.5px solid var(--line); font: inherit; font-size: 14.5px; outline: none; }
.tutor-input textarea:focus { border-color: var(--ai); box-shadow: 0 0 0 4px rgba(150, 90, 50, .12); }
.tutor-input .btn { height: 44px; width: 44px; border-radius: 14px; }
@media (max-width: 640px) {
  .tutor-fab { right: 14px; bottom: 14px; padding: 6px; }
  .tutor-fab-text { display: none; }
  .tutor { right: 0; bottom: 0; width: 100vw; height: 88vh; border-radius: 22px 22px 0 0; }
  .mark-form { flex-direction: column; align-items: stretch; }
  .mark-form .field { max-width: none !important; }
}
@media (prefers-reduced-motion: reduce) { .ai-orb::after, .ai-thinking span { animation: none; } }
.aigen-grid { grid-template-columns: 400px minmax(0, 1fr); align-items: start; }
@media (max-width: 1180px) { .aigen-grid { grid-template-columns: 1fr; } }

/* ================= Phiên bản 1.3 · Công thức, đồ thị, nhập Moodle ================= */
.katex { font-size: 1.08em; position: relative; } /* giữ phần MathML ẩn trong công thức, không kéo dài trang khi nằm trong khung cuộn */
.katex-display { margin: .6em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.choice-text .katex, .qopt .katex { font-size: 1.05em; }
.q-img { display: block; max-width: min(100%, 560px); max-height: 420px; height: auto; border-radius: 12px; border: 1px solid var(--line-2); margin: 10px 0; background: #fff; }
.qopt .q-img, .choice .q-img { max-width: 220px; max-height: 160px; margin: 4px 0; }
.graph-embed { display: block; max-width: 560px; margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 8px 8px 4px; }
.graph-svg { display: block; width: 100%; height: auto; }
.g-grid { stroke: #ECEEF2; stroke-width: 1; }
.g-axis { stroke: #334; stroke-width: 1.4; }
.g-curve { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.g-dash { stroke: #98A0AE; stroke-width: 1; stroke-dasharray: 4 4; }
.g-pt { fill: var(--red); stroke: #fff; stroke-width: 1.5; }
.g-lbl { font: italic 600 13px 'Times New Roman', serif; fill: #223; }
.g-tick { font: 11px 'Be Vietnam Pro', sans-serif; fill: #5D6575; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 6px 6px; font-size: 13.5px; }
.g-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.graph-err { padding: 12px; color: var(--red-600); font-size: 13px; }
.graph-preview { border: 1px dashed var(--line); border-radius: 14px; min-height: 120px; }
.graph-preview .graph-svg { max-height: 300px; }
.math-sticky { position: sticky; top: 72px; z-index: 6; }
.math-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #F8F9FB; margin-bottom: -6px; }
.math-bar + textarea, .math-sticky + textarea { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.math-group { display: flex; flex-wrap: wrap; gap: 3px; padding-right: 6px; border-right: 1px solid var(--line); }
.math-group:last-of-type { border-right: 0; }
.mbtn { min-width: 34px; height: 32px; padding: 0 7px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--ink-2); font: inherit; font-size: 13px; transition: background .15s, border-color .15s; }
.mbtn:hover { background: #fff; border-color: var(--line); }
.mbtn .katex { font-size: .95em; }
.mbtn.wide { font-weight: 600; color: var(--primary); }
.mbtn .ic { width: 15px; height: 15px; }
.math-help { margin-left: auto; font-size: 12.5px; font-weight: 600; }
.qpreview-card .card-body { font-size: 15px; }
.qpreview-card .qcontent { font-size: 15.5px; }
.fmt-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fmt { position: relative; cursor: pointer; }
.fmt input { position: absolute; opacity: 0; }
.fmt span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; height: 100%; transition: border-color .2s, background .2s; }
.fmt small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.fmt input:checked + span { border-color: var(--primary); background: var(--primary-50); }
.fmt input:focus-visible + span { outline: 3px solid rgba(37, 42, 61, .3); }
@media (max-width: 640px) { .fmt-list { grid-template-columns: 1fr; } .math-group { border-right: 0; } .math-help { margin-left: 0; } }
.g-legend b { font-weight: 400; }
.mbtn .katex { font-size: 1.05em; }

/* ================= Phiên bản 1.4 · Bài test đầu vào, xếp loại năng lực ================= */
:root { --lv-gioi: #1C7C54; --lv-kha: #252A3D; --lv-tb: #C27B0E; --lv-yeu: #B26B3D; }
.badge.lv { color: #fff; }
.badge.lv-gioi, .lv-gioi.heat-cell { background: var(--lv-gioi); }
.badge.lv-kha, .lv-kha.heat-cell { background: var(--lv-kha); }
.badge.lv-tb, .lv-tb.heat-cell { background: var(--lv-tb); }
.badge.lv-yeu, .lv-yeu.heat-cell { background: var(--lv-yeu); }
.lv-text.lv-gioi { color: var(--lv-gioi); } .lv-text.lv-kha { color: var(--lv-kha); } .lv-text.lv-tb { color: var(--lv-tb); } .lv-text.lv-yeu { color: var(--lv-yeu); }
.lvbar.lv-gioi span { background: var(--lv-gioi); } .lvbar.lv-kha span { background: var(--lv-kha); } .lvbar.lv-tb span { background: var(--lv-tb); } .lvbar.lv-yeu span { background: var(--lv-yeu); }
.level-hero { display: flex; gap: 30px; align-items: center; padding: 30px 32px; flex-wrap: wrap; position: relative; overflow: hidden; }
.level-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--lvc, var(--primary)); }
.lv-bg-gioi { --lvc: var(--lv-gioi); background: linear-gradient(120deg, #EEF8F2, #fff 60%); }
.lv-bg-kha { --lvc: var(--lv-kha); background: linear-gradient(120deg, #F1F3F7, #fff 60%); }
.lv-bg-tb { --lvc: var(--lv-tb); background: linear-gradient(120deg, #FFF6E6, #fff 60%); }
.lv-bg-yeu { --lvc: var(--lv-yeu); background: linear-gradient(120deg, #FDEFEF, #fff 60%); }
.level-hero h1 { font-size: 28px; margin-top: 6px; }
.level-medal { flex-shrink: 0; }
.lm-ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--lvc) calc(var(--p) * 1%), #ECEEF2 0); position: relative; animation: medalIn .8s var(--ease) both; }
.lm-ring::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .05); }
.lm-ring b { position: relative; z-index: 1; font-size: 40px; font-weight: 800; color: var(--lvc); }
.lm-ring small { font-size: 18px; }
@keyframes medalIn { from { transform: scale(.6) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.level-scale { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.lv-step { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; min-width: 96px; opacity: .7; }
.lv-step b { font-size: 14px; } .lv-step small { color: var(--muted); font-size: 12px; }
.lv-step.on { opacity: 1; color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lv-step.on small { color: rgba(255, 255, 255, .85); }
.lv-step.on.lv-gioi { background: var(--lv-gioi); } .lv-step.on.lv-kha { background: var(--lv-kha); } .lv-step.on.lv-tb { background: var(--lv-tb); } .lv-step.on.lv-yeu { background: var(--lv-yeu); }
.topic-bars { display: flex; flex-direction: column; gap: 14px; }
.tbar .row-between { margin-bottom: 6px; }
.lvdist { display: flex; height: 26px; border-radius: 8px; overflow: hidden; gap: 2px; }
.lvdist span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 22px; white-space: nowrap; overflow: hidden; }
.lvdist.lg { height: 34px; } .lvdist.lg span { font-size: 13px; }
.lvdist .lv-gioi, .dot.lv-gioi { background: var(--lv-gioi); } .lvdist .lv-kha, .dot.lv-kha { background: var(--lv-kha); } .lvdist .lv-tb, .dot.lv-tb { background: var(--lv-tb); } .lvdist .lv-yeu, .dot.lv-yeu { background: var(--lv-yeu); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.heat-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 26px; padding: 0 6px; border-radius: 7px; color: #fff; font-weight: 700; font-size: 12.5px; }
.th-in { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 12.5px; font-weight: 600; }
.th-in input { border: 0; padding: 0; height: 26px; font: inherit; font-size: 18px; font-weight: 700; outline: none; background: transparent; width: 100%; }
.th-in.lv-gioi { border-color: #BFE3D0; color: var(--lv-gioi); } .th-in.lv-kha { border-color: #CFDAF5; color: var(--lv-kha); } .th-in.lv-tb { border-color: #F5DDB0; color: var(--lv-tb); }
.pt-card { color: var(--ink); transition: transform .2s, box-shadow .2s; } .pt-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.placement-card .reading { font-size: 14px; }
.placement-banner { background: linear-gradient(120deg, #FFF1F1, #FFF9EE); border-color: #F6D2D2; }
.placement-banner b { display: block; }
.placement-banner span { color: var(--muted); font-size: 14px; }
.segmented.sm span { height: 30px; padding: 0 10px; font-size: 12.5px; }
@media (max-width: 640px) { .level-hero { justify-content: center; text-align: center; padding: 24px 18px; } .level-scale { justify-content: center; } .lm-ring { width: 128px; height: 128px; } }
.sep { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; }

/* ============ v1.5 Luyện đề, thi thử, xếp hạng ============ */
.sc-gioi { --sc: var(--lv-gioi); --sc-bg: #E7F5EE; } .sc-kha { --sc: var(--lv-kha); --sc-bg: #F1F2F5; } .sc-tb { --sc: var(--lv-tb); --sc-bg: #FFF3DD; } .sc-yeu { --sc: var(--lv-yeu); --sc-bg: #FDECEC; }
.progress.sc-gioi span, .progress.sc-kha span, .progress.sc-tb span, .progress.sc-yeu span { background: var(--sc); }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 28px; padding: 0 9px; border-radius: 8px; background: var(--sc-bg, var(--line-2)); color: var(--sc, var(--ink)); font-weight: 800; font-size: 14px; }
.lchips { display: flex; flex-wrap: wrap; gap: 8px; }
.lchip { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; font-size: 13.5px; transition: all .2s; }
.lchip:hover { color: var(--primary); border-color: var(--primary); }
.lchip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.exam-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.exam-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; transition: transform .2s, box-shadow .2s; }
.exam-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.exam-card.st-closed { opacity: .82; }
.exam-card-top { display: flex; gap: 12px; align-items: flex-start; }
.exam-title { font-size: 16.5px; margin: 6px 0 2px; line-height: 1.35; }
.exam-title a { color: var(--ink); } .exam-title a:hover { color: var(--primary); }
.exam-best { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 62px; height: 62px; border-radius: 16px; background: var(--sc-bg); color: var(--sc); }
.exam-best b { font-size: 22px; line-height: 1; } .exam-best small { font-size: 11px; font-weight: 600; opacity: .8; margin-top: 3px; }
.exam-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); }
.exam-facts span { display: inline-flex; align-items: center; gap: 5px; }
.exam-facts.big { gap: 10px; }
.exam-facts.big span { padding: 8px 12px; border-radius: 10px; background: var(--line-2); color: var(--ink-2, var(--ink)); font-size: 14px; }
.exam-facts.big .ic { width: 17px; height: 17px; color: var(--primary); }
.exam-deadline { color: var(--red-600); font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.exam-card-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.exam-hero { display: flex; gap: 30px; align-items: center; padding: 28px 32px; flex-wrap: wrap; position: relative; overflow: hidden; background: linear-gradient(120deg, var(--sc-bg, #F1F3F7), #fff 62%); }
.exam-hero:has(.sc-gioi) { --sc-bg: #E7F5EE; } .exam-hero:has(.sc-kha) { --sc-bg: #F1F2F5; } .exam-hero:has(.sc-tb) { --sc-bg: #FFF3DD; } .exam-hero:has(.sc-yeu) { --sc-bg: #FDECEC; }
.exam-hero h1 { font-size: 26px; margin: 6px 0 0; }
.exam-score { --lvc: var(--sc); flex-shrink: 0; }
.exam-score .lm-ring b { font-size: 44px; }
.exam-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; max-width: 640px; }
.exam-kpis div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.exam-kpis b { font-size: 18px; } .exam-kpis small { color: var(--muted); font-size: 12px; }
.improve { display: inline-flex; gap: 6px; align-items: center; margin: 10px 0 0; padding: 6px 12px; border-radius: 99px; background: #E7F5EE; color: var(--lv-gioi); font-weight: 600; font-size: 14px; }
.rank-list, .lb-list { list-style: none; margin: 0; padding: 4px 0; }
.rank-list li, .lb-list li { display: flex; align-items: center; gap: 10px; padding: 9px 18px; }
.rank-list li + li, .lb-list li + li { border-top: 1px solid var(--line-2); }
.rank-list li.me, .lb-list li.me { background: #F1F3F7; box-shadow: inset 3px 0 0 var(--primary); }
.rank-list li.gap { justify-content: center; color: var(--muted); padding: 2px; }
.rank-list .nm, .lb-list .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-list .nm b, .lb-list .nm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.rank-list .nm small { color: var(--muted); font-size: 12px; }
.rk { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--muted); background: var(--line-2); flex-shrink: 0; }
.rk.medal-1 { background: linear-gradient(135deg, #FFD86B, #F2A93B); color: #6B4300; }
.rk.medal-2 { background: linear-gradient(135deg, #E6EAF1, #B9C2D0); color: #3B4456; }
.rk.medal-3 { background: linear-gradient(135deg, #F4C9A5, #D58A55); color: #5B2F10; }
.list-item.active { background: #F1F3F7; }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.spark span { flex: 1; height: var(--h); border-radius: 6px 6px 3px 3px; background: var(--sc); min-width: 10px; animation: grow .8s var(--ease) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-pick label { position: relative; cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; }
.kind-pick span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; transition: all .2s; }
.kind-pick span .ic { width: 22px; height: 22px; color: var(--primary); }
.kind-pick small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.kind-pick input:checked + span { border-color: var(--primary); background: #F1F3F7; box-shadow: 0 0 0 3px rgba(37, 42, 61, .12); }
.class-picks { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; max-height: 220px; overflow: auto; }
.bands { display: flex; flex-direction: column; gap: 10px; }
.band { display: grid; grid-template-columns: 66px 1fr 28px; align-items: center; gap: 10px; }
.band b { text-align: right; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px; background: var(--line-2); font-size: 13px; }
.person-chip .avatar { width: 24px; height: 24px; font-size: 10px; }
.qstat { align-items: flex-start; }
.qstat-pct { flex-shrink: 0; width: 64px; height: 52px; border-radius: 12px; background: var(--sc-bg); color: var(--sc); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qstat-pct b { font-size: 17px; line-height: 1; } .qstat-pct small { font-size: 11px; }
.qstat-text { display: block; color: var(--ink); font-size: 14.5px; line-height: 1.5; }
/* Bảng xếp hạng */
.lb-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.lb-bar .lb-reset { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; }
.segmented a.seg { display: flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented a.seg.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }
.podium-card { padding: 26px 20px 0; background: radial-gradient(120% 90% at 50% 0%, #F1F3F7, #fff 70%); overflow: hidden; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; max-width: 560px; margin: 0 auto; }
.pod { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; animation: rise .7s var(--ease) both; }
.pod-2 { animation-delay: .1s; } .pod-1 { animation-delay: .25s; } .pod-3 { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
.pod .avatar { width: 58px; height: 58px; font-size: 19px; box-shadow: 0 0 0 4px #fff, var(--shadow-md); }
.pod-1 .avatar { width: 76px; height: 76px; font-size: 24px; box-shadow: 0 0 0 4px #FFD86B, var(--shadow-md); }
.pod-name { margin-top: 10px; font-size: 14.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-xp { font-size: 13px; font-weight: 700; color: var(--primary); margin: 2px 0 10px; }
.pod-block { width: 100%; border-radius: 14px 14px 0 0; display: flex; justify-content: center; padding-top: 12px; color: #fff; font-weight: 800; font-size: 26px; }
.pod-1 .pod-block { height: 120px; background: linear-gradient(180deg, #F2A93B, #E08A1E); }
.pod-2 .pod-block { height: 90px; background: linear-gradient(180deg, #9AA6BA, #7C889D); }
.pod-3 .pod-block { height: 70px; background: linear-gradient(180deg, #D58A55, #B96D3A); }
.pod.me .pod-name { color: var(--primary); }
.crown { position: absolute; top: -26px; color: #F2A93B; animation: bob 2.4s ease-in-out infinite; }
.crown .ic { width: 28px; height: 28px; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.lb-list .nm .progress { height: 6px; margin-top: 5px; max-width: 260px; }
.lb-list .rk { background: transparent; }
.lb-days { display: inline-flex; align-items: center; gap: 3px; min-width: 42px; }
.lb-days .ic { color: #E8590C; }
.lb-xp { min-width: 80px; text-align: right; } .lb-xp small { color: var(--muted); font-weight: 600; }
.me-card { background: linear-gradient(150deg, #2A3045 0%, #3A3340 55%, #8E5129 130%); color: #fff; border: 0; }
.me-card .muted, .me-card small { color: rgba(255, 255, 255, .78) !important; }
.me-card .progress { background: rgba(255, 255, 255, .2); } .me-card .progress span { background: #FFD86B; }
.me-card .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.me-rank { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.me-rank div { background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.me-rank b { font-size: 22px; }
.xp-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xp-rules li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.xp-rules b { color: var(--primary); font-size: 13px; white-space: nowrap; }
.xp-ic { width: 32px; height: 32px; border-radius: 9px; background: #F1F3F7; color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.xp-ic .ic { width: 17px; height: 17px; }
.dash-rank { display: flex; align-items: center; gap: 14px; }
@media (max-width: 640px) {
  .exam-hero { padding: 22px 18px; justify-content: center; } .exam-kpis { grid-template-columns: repeat(2, 1fr); }
  .kind-pick { grid-template-columns: 1fr; } .lb-bar .lb-reset { margin-left: 0; } .lb-days { display: none; }
  .pod .avatar { width: 46px; height: 46px; } .pod-1 .avatar { width: 60px; height: 60px; }
}
.dash-rank-card { display: block; color: #fff; } .dash-rank-card:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); } .dash-rank-card small { font-size: 12.5px; }

/* ============ v1.7 Bài tập về nhà ============ */
.text-red { color: var(--red-600) !important; }
.hw-row .meta { min-width: 0; }
.hw-due { display: flex; flex-direction: column; align-items: flex-end; color: var(--muted); white-space: nowrap; min-width: 128px; text-align: right; }
.hw-due .ic { display: none; }
.hw-due small { font-size: 12px; }
.hw-due.urgent, .hw-due.urgent small { color: var(--red-600); font-weight: 600; }
.hw-title { font-size: 22px; margin: 0 0 2px; }
.hw-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.hw-meta > span { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--line-2); }
.hw-meta > span .ic { width: 20px; height: 20px; color: var(--primary); }
.hw-meta > span > span { display: flex; flex-direction: column; } .hw-meta b { font-size: 14px; } .hw-meta small { color: var(--muted); font-size: 12px; }
.hw-meta .urgent { background: #FDECEC; } .hw-meta .urgent .ic, .hw-meta .urgent small { color: var(--red-600); }
.hw-files { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-file { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); max-width: 100%; }
.hw-file:hover { border-color: var(--primary); color: var(--ink); }
.hw-file > .ic { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.hw-file span { display: flex; flex-direction: column; min-width: 0; } .hw-file b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hw-file small { color: var(--muted); font-size: 12px; }
.hw-file audio { margin-top: 6px; height: 34px; max-width: 280px; }
.hw-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 18px; border: 2px dashed var(--line); border-radius: 16px; background: #FFFFFF; transition: all .2s; }
.hw-drop > .ic { width: 34px; height: 34px; color: var(--primary); }
.hw-drop.over { border-color: var(--primary); background: #F1F3F7; }
.hw-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.hw-thumbs:empty { display: none; }
.hw-thumb { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; animation: popIn .3s var(--ease); }
.hw-thumb img { width: 100%; height: 110px; object-fit: cover; background: var(--line-2); }
.hw-thumb.off { opacity: .35; } .hw-thumb.off .hw-x { background: var(--primary); }
.hw-ficon { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--primary); background: var(--line-2); }
.hw-ficon .ic { width: 36px; height: 36px; }
.hw-tname { font-size: 12px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hw-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(16, 24, 40, .7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; }
.hw-x .ic { width: 14px; height: 14px; }
@keyframes popIn { from { transform: scale(.9); opacity: 0; } }
.hw-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hw-gallery.big { grid-template-columns: 1fr; }
.hw-g { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line-2); }
.hw-g img { width: 100%; max-height: 180px; object-fit: cover; }
.hw-gallery.big .hw-g img { max-height: none; object-fit: contain; background: #fff; }
.hw-pdf iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 12px; }
.hw-text { padding: 14px 16px; border-radius: 12px; background: #FFFFFF; border: 1px solid var(--line-2); white-space: pre-wrap; }
.hw-grade { display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px; border-left: 4px solid var(--lv-gioi); background: linear-gradient(120deg, #EEF8F2, #fff 55%); }
.hw-grade.returned { border-left-color: var(--lv-tb); background: linear-gradient(120deg, #FFF6E6, #fff 55%); }
.hw-grade-score { flex-shrink: 0; width: 84px; height: 84px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); display: flex; align-items: baseline; justify-content: center; padding-top: 18px; color: var(--lv-gioi); }
.hw-grade-score b { font-size: 34px; line-height: 1; } .hw-grade-score small { font-size: 14px; margin-left: 2px; color: var(--muted); }
.hw-grade.returned .hw-grade-score { color: var(--lv-tb); align-items: center; padding: 0; } .hw-grade.returned .hw-grade-score .ic { width: 34px; height: 34px; }
.live-preview { margin-top: 8px; border: 1px dashed var(--line); border-radius: 12px; background: #FFFFFF; }
.ai-ask textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; resize: vertical; margin-bottom: 8px; background: #fff; }
.ai-ask { padding: 0 18px 4px; }
.ai-q { font-size: 13px; color: var(--muted); padding: 8px 12px; border-radius: 10px; background: var(--line-2); margin-bottom: 8px; }
.hw-grade-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.hw-roster { position: sticky; top: 86px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.hw-roster .list { overflow: auto; }
.hw-roster .list-item .badge { font-size: 11px; }
.hw-mark .chip-btn { min-width: 40px; }
@media (max-width: 980px) { .hw-grade-grid { grid-template-columns: 1fr; } .hw-roster { position: static; max-height: 360px; } }
@media (max-width: 640px) { .hw-due { min-width: 0; } .hw-row .badge { display: none; } .hw-pdf iframe { height: 420px; } }
.hw-mark .chip-btn { color: var(--primary); border-color: var(--line); } .hw-mark .chip-btn:hover { background: #F1F3F7; }

/* ============ v1.8 Bảng tin lớp, kết quả học tập cho phụ huynh ============ */
.composer .segmented { margin-bottom: 2px; }
.composer-opts { gap: 16px; align-items: center; }
.composer-opts .check { font-size: 14px; }
.post { padding: 18px 20px 6px; position: relative; scroll-margin-top: 90px; }
.post.kind-announce { border-left: 4px solid var(--red-600, #B26B3D); }
.post.kind-event { border-left: 4px solid var(--lv-tb); }
.post.pinned { box-shadow: 0 0 0 2px #FDE2E2, var(--shadow-sm); }
.post.flash, .cm.flash { animation: flashBg 1.6s ease; }
@keyframes flashBg { 0%, 40% { background: #FFF7D6; } }
.post-head { display: flex; gap: 12px; align-items: flex-start; }
.post-head .badge { font-size: 11px; vertical-align: 1px; }
.post-head .ic-xs { width: 12px; height: 12px; vertical-align: -1px; }
.post-body { margin-top: 12px; font-size: 15px; }
.post-imgs { display: grid; gap: 6px; margin-top: 12px; border-radius: 14px; overflow: hidden; }
.post-imgs.n1 { grid-template-columns: 1fr; } .post-imgs.n2 { grid-template-columns: 1fr 1fr; } .post-imgs.n3, .post-imgs.n4 { grid-template-columns: 1fr 1fr; }
.post-imgs img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; display: block; background: var(--line-2); }
.post-imgs.n1 img { max-height: 520px; object-fit: contain; }
.post-imgs.n3 a:first-child { grid-row: span 2; }
.post-files { margin-top: 10px; }
.event-chip { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 14px 8px 8px; border-radius: 14px; background: #FFF6E6; border: 1px solid #F5DDB0; }
.event-chip.past { opacity: .6; }
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 12px; background: #fff; color: var(--lv-tb); box-shadow: var(--shadow-sm); }
.ev-date b { font-size: 20px; line-height: 1; } .ev-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.event-chip > span:last-child { display: flex; flex-direction: column; } .event-chip small { color: var(--muted); font-size: 12.5px; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 8px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; }
.react { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; font-size: 13px; transition: transform .15s, background .2s, border-color .2s; }
.react span { font-size: 16px; line-height: 1; }
.react b { color: var(--muted); font-size: 12.5px; }
.react.zero { border-color: transparent; background: transparent; opacity: .55; }
.react.zero:hover { opacity: 1; background: var(--line-2); }
.react.mine { background: #F1F3F7; border-color: #C9D5F3; opacity: 1; } .react.mine b { color: var(--primary); }
.react.pop { transform: scale(1.25); }
.comments { padding: 4px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.cm { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; scroll-margin-top: 120px; }
.cm-bubble { background: var(--line-2); border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 14px; max-width: 100%; }
.cm-bubble > div { margin: 2px 0 3px; white-space: pre-wrap; word-break: break-word; }
.cm-bubble .badge { font-size: 10.5px; }
.cm-form { display: flex; align-items: center; gap: 8px; }
.cm-form input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 99px; padding: 0 14px; font: inherit; font-size: 14px; background: #fff; min-width: 0; }
.cm-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 42, 61, .12); }
.up-ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.up-ic .ic { width: 16px; height: 16px; }
.up-ic.ev { background: #FFF6E6; color: var(--lv-tb); } .up-ic.hw { background: #FDECEC; color: var(--red-600); } .up-ic.ex { background: #F1F3F7; color: var(--primary); }
.board-mini { display: block; color: var(--ink); } .board-mini:hover { color: var(--ink); box-shadow: var(--shadow-md); }
.bm-item { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.bm-item .badge { align-self: flex-start; font-size: 11px; }
.trend { width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.trend line { stroke: var(--line); stroke-dasharray: 4 4; } .trend .tg5 { stroke: #F5C6C6; } .trend .tg8 { stroke: #BFE3D0; }
.trend text { font-size: 11px; fill: var(--muted); }
.trend .tl { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: drawLine 1.4s var(--ease) forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.trend .tp { fill: #fff; stroke: var(--sc); stroke-width: 3; }
.fb-item .meta { gap: 3px; } .fb-text { color: var(--ink-2, var(--ink)) !important; line-height: 1.5; white-space: normal !important; }
@media (max-width: 640px) { .post { padding: 14px 14px 4px; } .composer-opts .btn { margin-left: 0 !important; width: 100%; } .react { padding: 0 8px; } }

/* ============ v1.9 Lập trình Python, phòng thi HSG ============ */
.badge.b-purple { background: #F8EADF; color: #A8623A; }
.code-q { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; margin-top: 6px; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: #F7F8FA; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.code-lang { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: #8E5129; }
.code-lang .ic { width: 16px; height: 16px; }
.code-q .CodeMirror, .code-admin .CodeMirror { height: auto; min-height: 180px; font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; font-size: 14px; line-height: 1.55; }
.code-q .CodeMirror-scroll { min-height: 180px; max-height: 520px; }
.code-admin .CodeMirror { min-height: 120px; border: 1px solid var(--line); border-radius: 10px; }
.code-admin .CodeMirror-scroll { min-height: 120px; max-height: 360px; }
.CodeMirror-gutters { background: #FFFFFF; border-right: 1px solid var(--line-2); }
.CodeMirror-activeline-background { background: #F3F6FD; }
.code-src { width: 100%; min-height: 180px; border: 0; padding: 12px; font-family: Consolas, monospace; font-size: 14px; resize: vertical; }
.code-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); background: #FFFFFF; }
.code-status { margin-left: auto; font-weight: 600; }
.code-q.running .code-status::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid var(--primary); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-q.stale { box-shadow: 0 0 0 2px #F5DDB0; }
.code-custom { padding: 10px 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.code-stdin { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: Consolas, monospace; font-size: 13.5px; resize: vertical; }
.code-console { margin: 0; padding: 10px 12px; border-radius: 8px; background: #0F172A; color: #E2E8F0; font-size: 13px; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.code-console.err { color: #FCA5A5; }
.code-tests { border-top: 1px solid var(--line); }
.ctest { border-bottom: 1px solid var(--line-2); }
.ctest:last-child { border-bottom: 0; }
.ctest summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 14px; }
.ctest summary::-webkit-details-marker { display: none; }
.ct-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.ctest.pass .ct-dot { background: var(--lv-gioi); } .ctest.fail .ct-dot { background: var(--lv-yeu); }
.ctest.pass .ct-msg { color: var(--lv-gioi) !important; font-weight: 600; } .ctest.fail .ct-msg { color: var(--lv-yeu) !important; font-weight: 600; }
.ct-msg { flex: 1; } .ct-pts { white-space: nowrap; }
.ct-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 0 12px 12px; }
.ct-body small { color: var(--muted); font-size: 12px; }
.ct-body pre, .code-pre { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: #F7F8FA; border: 1px solid var(--line-2); font-size: 13px; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto; font-family: Consolas, monospace; }
.code-pre { max-height: 420px; }
.test-list { display: flex; flex-direction: column; gap: 8px; }
.test-row { display: grid; grid-template-columns: 30px 1fr 1fr 150px; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; }
.test-row.bad { border-color: #F5C6C6; background: #FFF6F6; }
.test-row small { color: var(--muted); font-size: 12px; }
.test-row textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-family: Consolas, monospace; font-size: 13px; resize: vertical; background: #fff; }
.tr-no { width: 26px; height: 26px; border-radius: 50%; background: #F1F3F7; color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; margin-top: 18px; }
.tr-opt { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; }
.tr-opt input[type=number] { width: 60px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; }
.tr-opt .btn { align-self: flex-start; }
/* Phòng thi */
.contest-badge { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 99px; background: #F8EADF; color: #A8623A; font-size: 13px; font-weight: 600; }
.contest-badge .ic { width: 16px; height: 16px; }
.contest-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(15, 23, 42, .72); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 20px; }
.contest-overlay.show { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.co-box { background: #fff; border-radius: 22px; padding: 30px 28px; max-width: 460px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.co-box h2 { margin: 12px 0 8px; font-size: 22px; } .co-box p { color: var(--muted); margin: 0 0 20px; line-height: 1.6; }
.co-ic { display: inline-block; width: 64px; height: 64px; border-radius: 20px; background: #F8EADF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B3FC6' stroke-width='1.8'%3E%3Cpath d='M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / 34px no-repeat; }
.contest-overlay.danger .co-ic { background-color: #FDECEC; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D8232A' stroke-width='1.8'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E"); }
.quiz-shell.contest .quiz-bar { box-shadow: inset 0 -3px 0 #E4D7FB; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.live-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2, #A0A8B8); }
.live-dot.on { color: var(--lv-yeu); } .live-dot.on::before { background: var(--lv-yeu); animation: pulse 1.4s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(178, 107, 61, .15); } }
tr.viol td { background: #FFF8F8; }
.contest-opts { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px dashed #D9C9F7; border-radius: 12px; background: #FBF8FF; }
.kind-pick { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .test-row { grid-template-columns: 1fr; } .tr-no, .tr-opt { margin-top: 0; padding-top: 0; } .tr-opt { flex-direction: row; align-items: center; flex-wrap: wrap; } .kind-pick { grid-template-columns: 1fr; } }
[data-qeditor] .segmented { display: flex; flex-wrap: wrap; } [data-qeditor] .segmented span { white-space: nowrap; }

/* ============ v2.0 Hệ thống & sao lưu ============ */
.maint-ic { width: 84px; height: 84px; margin: 6px auto 4px; border-radius: 26px; background: #F1F3F7; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.maint-ic .ic { width: 44px; height: 44px; animation: spin 6s linear infinite; }
.check-item { align-items: flex-start; }
.ck-ic { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ck-ic .ic { width: 15px; height: 15px; }
.st-ok .ck-ic { background: #E7F5EE; color: var(--lv-gioi); } .st-warn .ck-ic { background: #FFF3DD; color: var(--lv-tb); } .st-bad .ck-ic { background: #FDECEC; color: var(--lv-yeu); }
.check-item .meta { gap: 2px; }
.ck-fix { color: var(--ink-2, var(--ink)) !important; background: #FFFFFF; border-left: 3px solid var(--lv-tb); padding: 4px 8px; border-radius: 4px; margin-top: 4px; white-space: normal !important; }
.st-bad .ck-fix { border-left-color: var(--lv-yeu); }
.ck-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ck-dot.st-ok { background: var(--lv-gioi); } .ck-dot.st-warn { background: var(--lv-tb); } .ck-dot.st-bad { background: var(--lv-yeu); }
.backup-hero { background: linear-gradient(120deg, #F1F3F7, #fff 60%); }
.restore-card { border: 1px solid #F6D2D2; }
.deploy-guide ol.steps { counter-reset: st; list-style: none; padding: 0; }
.deploy-guide ol.steps > li { counter-increment: st; position: relative; padding: 0 0 14px 46px; }
.deploy-guide ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.deploy-guide code { background: var(--line-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.log-view { max-height: 600px; margin: 0 18px 18px; font-size: 12.5px; }

/* ============ v2.1 Nguồn AI ============ */
.prov-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-left: 4px solid var(--line); }
.prov-card.active { border-left-color: var(--lv-gioi); box-shadow: var(--shadow-md); }
.prov-card.st-cool { border-left-color: var(--lv-tb); } .prov-card.st-bad { border-left-color: var(--lv-yeu); } .prov-card.st-off { opacity: .6; }
.prov-order { display: flex; flex-direction: column; align-items: center; gap: 0; }
.prov-order > span { width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.prov-order .btn { width: 28px; height: 24px; }
.prov-logo { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 15px; }
.prov-logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.prov-logo.k-gemini { background: linear-gradient(135deg, #4285F4, #9B72CB 60%, #D96570); }
.prov-logo.k-openai { background: #10A37F; }
.prov-logo.k-compat { background: #475569; }
.prov-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prov-main code { background: var(--line-2); padding: 0 5px; border-radius: 4px; font-size: 12px; }
.prov-name { font-size: 15.5px; }
.prov-st { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--muted); }
.prov-st.st-ok { background: #E7F5EE; color: var(--lv-gioi); } .prov-st.st-warn { background: #FFF3DD; color: var(--lv-tb); } .prov-st.st-cool { background: #FFF3DD; color: var(--lv-tb); } .prov-st.st-bad { background: #FDECEC; color: var(--lv-yeu); }
.prov-err { color: var(--lv-tb); }
.prov-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.prov-test { margin-top: 6px; }
.prov-kinds { grid-template-columns: repeat(3, 1fr); }
.prov-kinds span { align-items: flex-start; }
details.adv summary { cursor: pointer; color: var(--primary); font-weight: 600; }
@media (max-width: 640px) { .prov-card { flex-wrap: wrap; } .prov-actions { width: 100%; justify-content: flex-end; } .prov-kinds { grid-template-columns: 1fr; } }

/* =========================================================
   v2.1 · Trung tâm học online: cửa hàng khóa học, thanh toán,
   Giáo viên AI, học cùng thầy AI, tư vấn viên AI
   ========================================================= */
.ml-auto { margin-left: auto; }
.mb-3 { margin-bottom: 24px; }
form.inline { display: inline-block; }
.b-violet { background: var(--ai-50); color: var(--ai); }
.b-ghost { background: transparent; color: var(--muted-2); box-shadow: inset 0 0 0 1px var(--line); }
.b-ghost:hover { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-100); }
.site-links a.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.foot-links a .ic { width: 16px; height: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Thẻ khóa học ---- */
.shop-grid { align-items: stretch; }
.shop-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; }
.shop-card:hover { color: inherit; }
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--primary-50); }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.shop-card:hover .cover img { transform: scale(1.04); }
.cover.gen { --c: #252A3D; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000) 100%); display: flex; align-items: flex-end; padding: 16px; }
.cover.gen::before { content: ''; position: absolute; width: 180px; height: 180px; right: -40px; top: -50px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.cover.gen::after { content: ''; position: absolute; width: 90px; height: 90px; right: 70px; bottom: -30px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.cover-ic { position: absolute; right: 22px; top: 22px; width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; color: #fff; transition: transform .4s var(--ease); }
.cover-ic .ic { width: 34px; height: 34px; }
.shop-card:hover .cover-ic { transform: rotate(-8deg) scale(1.06); }
.cover-t { position: relative; z-index: 1; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; opacity: .92; }
.shop-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.shop-body h3 { font-size: 16.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin-top: 2px; }
.shop-meta span { display: inline-flex; align-items: center; gap: 5px; }
.shop-meta .ic { width: 15px; height: 15px; }
.shop-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.price { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price b { font-size: 18px; color: var(--red); font-weight: 800; }
.price s { color: var(--muted-2); font-size: 13.5px; }
.price-off { font-size: 12px; font-weight: 700; color: #fff; background: var(--red); padding: 2px 7px; border-radius: 6px; }
.price.free { font-weight: 800; color: var(--green); font-size: 16px; }
.price.lg b, .price.lg.free { font-size: 28px; }
.stars { display: inline-flex; gap: 1px; color: #DADDE3; font-style: normal; letter-spacing: 0; }
.stars i { font-style: normal; }
.stars i.on { color: #F2A93B; }
.stars i.half { background: linear-gradient(90deg, #F2A93B 50%, #DADDE3 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- Danh mục ---- */
body.store { background: var(--bg); }
.store-hero { position: relative; overflow: hidden; padding: 48px 0 36px; background: linear-gradient(135deg, var(--primary-700), var(--primary) 60%, #3B4362); color: #fff; }
.store-hero::after { content: ''; position: absolute; width: 520px; height: 520px; right: -140px; top: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 65%); }
.store-hero h1 { color: #fff; font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -.02em; }
.store-hero .lead { color: #C9D1DE; margin-top: 8px; font-size: 16px; }
.store-search { position: relative; z-index: 1; margin-top: 22px; max-width: 680px; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 6px 6px 6px 16px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5); }
.store-search > .ic { color: var(--muted-2); }
.store-search input { flex: 1; min-width: 0; border: 0; outline: 0; height: 44px; font-size: 16px; color: var(--ink); background: transparent; }
.store-body { padding-top: 22px; padding-bottom: 64px; }
.store-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.store-filters a.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14px; transition: all .2s; }
.store-filters a.chip .ic { width: 16px; height: 16px; color: var(--c, var(--primary)); }
.store-filters a.chip:hover { border-color: var(--primary-100); color: var(--primary); }
.store-filters a.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.store-filters a.chip.on .ic { color: #fff; }
.store-selects select { height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 0 32px 0 12px; font-weight: 600; }

/* ---- Trang khóa học ---- */
.cp-hero { background: linear-gradient(135deg, #0E1B4A, var(--primary-700) 55%, var(--primary)); color: #fff; padding: 36px 0 44px; }
.cp-hero h1 { color: #fff; font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.02em; margin-top: 10px; max-width: 760px; }
.cp-hero .lead { color: #C9D1DE; margin-top: 10px; max-width: 720px; font-size: 16.5px; }
.cp-crumbs a { color: #E4C9AE; display: inline-flex; gap: 6px; align-items: center; }
.store .preview-wrap .cp-crumbs a { color: var(--primary); }
.cp-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; color: #E9ECF1; }
.cp-facts span { display: inline-flex; gap: 6px; align-items: center; }
.cp-facts .ic { width: 17px; height: 17px; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; padding-top: 28px; padding-bottom: 32px; }
.cp-main h2 { font-size: 21px; }
.cp-side { position: relative; margin-top: -170px; }
.buy-box { position: sticky; top: 96px; overflow: hidden; box-shadow: var(--shadow-lg); }
.buy-in { padding: 20px; }
.buy-incl { list-style: none; padding: 16px 0 0; margin: 16px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.buy-incl li { display: flex; gap: 10px; align-items: center; }
.buy-incl .ic { width: 18px; height: 18px; color: var(--primary); }
.cp-outcomes ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.cp-outcomes li { display: flex; gap: 10px; align-items: flex-start; }
.cp-outcomes li .ic { color: var(--green); width: 18px; height: 18px; margin-top: 2px; }
.cp-curr { display: grid; gap: 10px; }
.cp-ch { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cp-ch summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 14px 16px; cursor: pointer; }
.cp-ch summary::-webkit-details-marker { display: none; }
.cp-ch summary .chev { transition: transform .25s; color: var(--muted-2); }
.cp-ch[open] summary .chev { transform: rotate(180deg); }
.cp-ls { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.cp-ls .type { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.cp-ls .type .ic { width: 16px; height: 16px; }
.ai-mini { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--ai); background: var(--ai-50); padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.ai-mini .ic { width: 12px; height: 12px; }
.review-form { display: grid; gap: 10px; }
.review-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 30px; line-height: 1; color: #DADDE3; cursor: pointer; transition: color .15s, transform .15s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #F2A93B; }
.star-input label:hover { transform: scale(1.12); }
.reviews { display: grid; gap: 10px; }
.review.is-hidden { opacity: .55; }
.preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; padding-bottom: 48px; align-items: start; }
.preview-buy { position: sticky; top: 96px; }
.preview-other { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); color: var(--ink-2); font-size: 14px; }
.preview-other .ic { width: 16px; height: 16px; color: var(--primary); }

/* ---- Trang chủ: thầy AI ---- */
.ai-band { background: linear-gradient(180deg, #F8F9FB, var(--bg)); }
.ai-band-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.ai-band h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.02em; margin-top: 14px; }
.ai-band .lead { color: var(--muted); font-size: 17px; margin-top: 12px; }
.ai-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.ai-points li { display: flex; gap: 10px; align-items: flex-start; }
.ai-points .ic { color: var(--ai); margin-top: 2px; }
.ai-demo { padding: 22px; display: grid; gap: 12px; box-shadow: var(--shadow-lg); transform: rotate(-1deg); }

/* ---- Học cùng thầy AI ---- */
.tl-shell { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 90px; }
.tl-head { display: flex; gap: 16px; align-items: center; padding: 16px 18px; position: sticky; top: 76px; z-index: 5; }
.tl-dots { display: flex; gap: 6px; margin-top: 8px; }
.tl-dots span { flex: 1; max-width: 60px; height: 6px; border-radius: 99px; background: var(--line); transition: background .4s; }
.tl-dots span.done { background: var(--green); }
.tl-dots span.on { background: linear-gradient(90deg, var(--ai), var(--ai-2)); animation: tlPulse 1.6s ease-in-out infinite; }
@keyframes tlPulse { 50% { opacity: .55; } }
.tl-feed { display: flex; flex-direction: column; gap: 12px; }
.tl-msg { display: flex; gap: 10px; align-items: flex-start; scroll-margin-top: 170px; }
.tl-msg.me { justify-content: flex-end; }
.tl-msg .ai-orb.sm { margin: 2px 0 0; }
.tl-bubble { max-width: min(640px, 88%); background: #fff; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 12px 16px; line-height: 1.65; box-shadow: var(--shadow-sm); }
.tl-bubble p + p { margin-top: 8px; }
.tl-msg.me .tl-bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 18px 4px 18px 18px; }
.tl-msg.k-ok .tl-bubble { background: var(--green-50); border-color: #BFE3CF; }
.tl-msg.k-hint .tl-bubble { background: var(--amber-50); border-color: #F3D9A8; }
.tl-msg.k-bad .tl-bubble { background: #FFF5F5; border-color: #F5C6C8; }
.tl-msg.k-reteach .tl-bubble, .tl-msg.k-sum .tl-bubble { background: #F8F9FB; border-color: #EBD5C3; }
.tl-step { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ai); margin-bottom: 6px; }
.tl-qtag { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--primary); background: var(--primary-50); padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; }
.tl-in { animation: tlIn .45s var(--ease) both; }
@keyframes tlIn { from { opacity: 0; transform: translateY(10px); } }
.tl-msg.typing .tl-bubble { display: inline-flex; gap: 5px; padding: 14px 16px; }
.tl-msg.typing .tl-bubble i { width: 8px; height: 8px; border-radius: 50%; background: var(--ai); animation: think 1.2s ease-in-out infinite; }
.tl-msg.typing .tl-bubble i:nth-child(2) { animation-delay: .15s; }
.tl-msg.typing .tl-bubble i:nth-child(3) { animation-delay: .3s; }
.tl-card-wrap { transition: opacity .2s; }
.tl-card-wrap.is-busy { opacity: .5; pointer-events: none; }
.tl-card { background: #fff; border: 2px solid var(--primary-100); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow-md); }
.tl-card.done { border-color: #BFE3CF; background: linear-gradient(180deg, var(--green-50), #fff); }
.tl-q { font-size: 16.5px; font-weight: 600; line-height: 1.6; }
.tl-opts { display: grid; gap: 10px; }
.tl-opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font: inherit; transition: border-color .2s, background .2s, transform .15s; }
.tl-opt:hover { border-color: var(--primary); background: var(--primary-50); transform: translateX(3px); }
.tl-opt.picked { border-color: var(--primary); background: var(--primary-50); }
.tl-short { display: flex; gap: 10px; }
.tl-short input { flex: 1; min-width: 0; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 14px; font-size: 16px; }
.tl-short input:focus { border-color: var(--primary); outline: 0; }
.tl-tools { display: flex; justify-content: flex-end; }
.tl-ask { position: sticky; bottom: 16px; display: flex; gap: 8px; padding: 8px; align-items: center; box-shadow: var(--shadow-lg); z-index: 5; }
.tl-ask input { flex: 1; min-width: 0; border: 0; outline: 0; height: 42px; padding: 0 10px; font-size: 15px; background: transparent; }
.ai-teach-cta { display: flex; gap: 14px; align-items: center; padding: 16px 18px; color: inherit; background: linear-gradient(120deg, #F8F9FB, #F1F3F7); border: 1px solid #EBD5C3; transition: transform .2s, box-shadow .2s; }
.ai-teach-cta:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ai-teach-cta small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---- Giáo viên AI ---- */
.aic-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.aic-steps span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.aic-steps b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 13px; }
.aic-steps span.on { border-color: var(--ai); color: var(--ai); background: var(--ai-50); }
.aic-steps span.on b { background: linear-gradient(135deg, var(--ai), var(--ai-2)); color: #fff; }
.aic-steps span.done { color: var(--green); }
.aic-steps span.done b { background: var(--green); color: #fff; }
.aic-working { text-align: center; padding: 48px 24px; display: grid; justify-items: center; gap: 10px; }
.aic-orb { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--ai), var(--ai-2)); box-shadow: 0 20px 40px -18px rgba(150, 90, 50, .9); position: relative; animation: aicFloat 2.4s ease-in-out infinite; }
.aic-orb .ic { width: 40px; height: 40px; }
.aic-orb::before { content: ''; position: absolute; inset: -10px; border-radius: 32px; border: 2px solid rgba(150, 90, 50, .25); animation: aicRing 2s ease-out infinite; }
.aic-orb.sm { width: 44px; height: 44px; border-radius: 14px; animation: none; }
.aic-orb.sm .ic { width: 22px; height: 22px; }
.aic-orb.sm::before { display: none; }
@keyframes aicFloat { 50% { transform: translateY(-6px); } }
@keyframes aicRing { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.aic-msg { color: var(--muted); min-height: 1.4em; }
.aic-ls { gap: 12px; }
.aic-ls .type { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.aic-ls.st-busy { background: linear-gradient(90deg, transparent, rgba(150, 90, 50, .06), transparent); background-size: 200% 100%; animation: aicShimmer 1.6s linear infinite; }
.aic-ls.st-err small { color: var(--red); }
.aic-ls.flash-in { animation: tlIn .5s var(--ease); }
@keyframes aicShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.aic-dots::after { content: '…'; animation: tlPulse 1.2s infinite; }
.aic-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; text-align: center; }
.aic-kpis div { background: var(--line-2); border-radius: 12px; padding: 10px 6px; }
.aic-kpis b { display: block; font-size: 22px; }
.aic-kpis small { color: var(--muted); }
.outline-ch .card-head { gap: 10px; }
.oc-title { flex: 1; font-weight: 700; }
.oc-lessons { padding: 0 18px 8px; display: grid; gap: 8px; }
.oc-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--bg); }
.oc-row input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font-weight: 600; }
.oc-row input:focus { background: #fff; border-color: var(--primary-100); outline: 0; }
.oc-row .oc-obj { font-weight: 400; font-size: 13.5px; color: var(--muted); }
.oc-no { width: 26px; height: 26px; border-radius: 8px; background: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; flex-shrink: 0; }
.aic-bar { position: sticky; bottom: 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); padding: 10px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.class-picks { display: grid; gap: 8px; }
.ai-script-card .ai-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; padding: 10px 14px; background: var(--bg); border-radius: 12px; }
.text-red { color: var(--red); display: inline-flex; gap: 6px; align-items: center; }
.script-step { border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: #fff; }
.script-step[open] { padding-bottom: 12px; }
.script-step summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 12px 0; cursor: pointer; }
.script-step summary::-webkit-details-marker { display: none; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--ai), var(--ai-2)); color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.script-form { display: grid; gap: 10px; }

/* ---- Thanh toán ---- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.checkout-pay { padding: 24px; }
.checkout-sum { overflow: hidden; position: sticky; top: 92px; }
.pay-head { display: flex; gap: 12px; align-items: center; }
.pay-head small { display: block; color: var(--muted); }
.pay-head .step-n { background: var(--primary); }
.pay-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; margin-top: 18px; align-items: center; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: grid; justify-items: center; gap: 6px; text-align: center; box-shadow: var(--shadow-md); }
.qr-box img { width: 100%; height: auto; border-radius: 10px; }
.pay-info { margin: 0; display: grid; gap: 4px; }
.pay-info div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.pay-info dt { color: var(--muted); font-size: 14px; }
.pay-info dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pay-info .amount { color: var(--red); font-size: 20px; }
.pay-info .hl { background: var(--amber-50); border-radius: 10px; padding: 9px 10px; border: 0; }
.pay-info .code { font-size: 18px; letter-spacing: .06em; }
.pay-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-100); border-top-color: var(--primary); animation: spin 0.9s linear infinite; margin-left: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.sum-lines { margin: 14px 0 0; display: grid; gap: 6px; }
.sum-lines div { display: flex; justify-content: space-between; font-size: 14.5px; }
.sum-lines dd { margin: 0; }
.sum-lines .off { color: var(--green); }
.sum-lines .total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-weight: 800; font-size: 17px; }
.sum-lines .total dd { color: var(--red); }
.coupon-form { display: flex; gap: 8px; margin-top: 14px; }
.coupon-form input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }

/* ---- Quản trị bán hàng ---- */
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-link { display: inline-flex; gap: 8px; align-items: center; padding: 12px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-link .ic { width: 17px; height: 17px; }
.tab-link.on { color: var(--primary); border-bottom-color: var(--primary); }
.order-mini { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.copy-row { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 10px; padding: 6px 6px 6px 12px; }
.copy-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }

/* ---- Tư vấn viên AI ---- */
.adv { position: fixed; right: 22px; bottom: 22px; z-index: 70; }
.adv-fab { display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(120deg, var(--ai), var(--ai-2)); box-shadow: 0 16px 34px -14px rgba(150, 90, 50, .9); transition: transform .2s var(--ease); }
.adv-fab:hover { transform: translateY(-2px); }
.adv-fab .ai-orb { width: 36px; height: 36px; background: rgba(255, 255, 255, .2); box-shadow: none; }
.adv.open .adv-fab { display: none; }
.adv-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); animation: tlIn .3s var(--ease); }
.adv-panel header { display: flex; gap: 10px; align-items: center; padding: 12px 12px 12px 14px; background: linear-gradient(120deg, var(--ai-50), #F1F3F7); border-bottom: 1px solid #F1E2D4; }
.adv-panel header small { display: block; color: var(--muted); font-size: 12px; }
.adv-feed { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.adv-feed .tl-bubble { max-width: 92%; font-size: 14.5px; padding: 10px 13px; }
.adv-course { display: flex; gap: 8px; align-items: center; margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--primary-50); font-weight: 600; font-size: 14px; }
.adv-course .ic { width: 16px; height: 16px; }
.adv-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.adv-chips button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid #EBD5C3; background: #fff; color: var(--ai); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.adv-chips button:hover { background: var(--ai-50); }
.adv-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.adv-form input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }

@media (max-width: 1100px) {
  .cp-body { grid-template-columns: 1fr; }
  .cp-side { margin-top: 0; order: -1; }
  .buy-box { position: static; }
  .buy-box .buy-cover { display: none; }
  .checkout { grid-template-columns: 1fr; }
  .checkout-sum { position: static; order: -1; }
  .checkout-sum .sum-cover { display: none; }
  .ai-band-grid { grid-template-columns: 1fr; }
  .preview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pay-grid { grid-template-columns: 1fr; }
  .qr-box { max-width: 300px; margin: 0 auto; }
  .pay-info div { grid-template-columns: 1fr; gap: 2px; }
  .cp-outcomes ul { grid-template-columns: 1fr; }
  .store-filters { flex-direction: column; align-items: stretch; }
  .store-filters .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; max-width: 100%; min-width: 0; }
  .store-filters > * { min-width: 0; max-width: 100%; }
  .store-filters a.chip { flex-shrink: 0; }
  .tl-head { top: 64px; }
}
@media (max-width: 480px) {
  .hide-xs { display: none !important; }
  .adv { right: 12px; bottom: 12px; }
  .adv-fab span:last-child { display: none; }
  .adv-fab { padding: 7px; }
  .tl-short { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .aic-orb, .aic-orb::before, .tl-dots span.on, .aic-ls.st-busy, .pay-spin { animation: none; } }

/* ---- Trợ lý AI điều hành ---- */
button.side-card.ag-open { width: calc(100% - 32px); text-align: left; border: 0; cursor: pointer; font: inherit; transition: transform .2s, box-shadow .2s; }
button.side-card.ag-open:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ag-fab { position: fixed; right: 22px; bottom: 22px; z-index: 65; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(120deg, var(--ai), var(--ai-2)); box-shadow: 0 16px 34px -14px rgba(150, 90, 50, .9); transition: transform .2s var(--ease); }
.ag-fab:hover { transform: translateY(-2px); }
body:has(.tutor-fab) .ag-fab { bottom: 84px; }
body.ag-on .ag-fab { display: none; }
.ag-panel { position: fixed; right: 18px; bottom: 18px; top: 86px; width: min(420px, calc(100vw - 24px)); z-index: 80; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); animation: tlIn .3s var(--ease); }
.ag-panel header { display: flex; gap: 10px; align-items: center; padding: 12px 10px 12px 14px; background: linear-gradient(120deg, var(--ai-50), #F1F3F7); border-bottom: 1px solid #F1E2D4; }
.ag-panel header small { display: block; color: var(--muted); font-size: 12px; }
.ag-feed { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ag-feed .tl-bubble { max-width: 94%; font-size: 14.5px; padding: 10px 13px; }
.ag-feed .tl-bubble p + p, .ag-feed .tl-bubble ul { margin-top: 6px; }
.ag-tool { align-self: center; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 999px; padding: 4px 10px; }
.ag-tool .ic { width: 14px; height: 14px; }
.ag-card { margin-top: 10px; border: 1.5px solid var(--primary-100); border-radius: 12px; background: #FBFCFF; overflow: hidden; }
.ag-card.pending { border-color: var(--ai); box-shadow: 0 0 0 4px rgba(150, 90, 50, .08); }
.ag-act { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.ag-act-d { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); background: #fff; border-radius: 8px; padding: 8px 10px; border: 1px solid var(--line-2); max-height: 220px; overflow: auto; }
.ag-btns { padding: 10px 12px; }
.ag-st { padding: 8px 12px; display: flex; gap: 6px; align-items: center; }
.ag-st .ic { width: 16px; height: 16px; color: var(--green); }
.ag-chips.mini { display: none; }
.ag-panel .adv-form textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 120px; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; line-height: 1.4; }
@media (max-width: 640px) { .ag-panel { top: 70px; right: 8px; bottom: 8px; } .ag-fab span { display: none; } .ag-fab { padding: 0 14px; } }
.tl-bubble .ai-text { padding: 0; border: 0; background: none; border-radius: 0; font-size: inherit; color: inherit; }
.ag-act-d .ai-text, .ag-act-h .ai-text { padding: 0; border: 0; background: none; }

/* =========================================================
   v2.2 · Giao diện ấm: kem – đồng – xanh than, minh họa 3D
   ========================================================= */
body { background: var(--bg); }
.public { background: var(--bg); }
body.warm, body.store { background: var(--bg); }
.hand, .w-hand { font-family: 'Dancing Script', 'Segoe Script', cursive; }
.w-copper { background: linear-gradient(100deg, #D59A68 0%, #B26B3D 45%, #8E5129 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn-red { --bg: var(--copper); --bd: transparent; background: var(--copper-grad); box-shadow: 0 12px 24px -14px rgba(150, 85, 40, .9); }
.btn-red:hover { --bg: var(--copper-600); filter: brightness(1.05); }
.btn-copper { --fg: #fff; --bd: transparent; background: var(--copper-grad); box-shadow: 0 14px 28px -14px rgba(150, 85, 40, .95); }
.btn-copper:hover { filter: brightness(1.06); color: #fff; }
.btn-ink { --bg: var(--primary); --fg: #fff; --bd: var(--primary); border-radius: 999px; padding: 0 24px; }
.btn-ink:hover { --bg: var(--primary-700); }
.btn-ink .ic { color: #E6B48A; }
.btn-soft { --bg: #fff; --fg: var(--ink); --bd: var(--line); border-radius: 999px; padding: 0 22px; }
.btn-soft:hover { --bd: #C7CDD7; }
.btn-soft .ic { color: var(--copper); }
.btn-lg { height: 52px; font-size: 16px; }

/* thanh điều hướng công khai */
.site-nav { background: rgba(255, 255, 255, .86); }
.site-nav .cta .btn-outline { border-radius: 999px; --bd: var(--line); background: #fff; --fg: var(--ink); }
.site-nav .cta .btn-red { border-radius: 999px; background: var(--primary); box-shadow: 0 10px 22px -14px rgba(30, 30, 50, .9); }
.site-nav .cta .btn-red:hover { background: var(--primary-700); }
.site-links a { border-radius: 999px; }
.site-links a:hover, .site-links a.on { background: #fff; color: var(--copper-600); box-shadow: var(--shadow-sm); }

.w-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--copper-600); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-sm); }
.w-pill .ic { width: 16px; height: 16px; }
.w-pill.dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #E9C4A2; box-shadow: none; }
.w-h2 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; margin-top: 14px; }
.w-sub { color: var(--muted); font-size: 17px; margin-top: 14px; max-width: 560px; }
.w-tight { padding: 56px 0; }
.w-float { animation: float 6s ease-in-out infinite; }

/* hero */
.w-hero { position: relative; overflow: hidden; padding: 40px 0 70px; }
.w-swoosh { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.w-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; }
.w-hero h1 { font-size: clamp(38px, 5.2vw, 64px); font-weight: 800; letter-spacing: -.035em; line-height: 1.06; margin: 20px 0 6px; position: relative; display: inline-block; }
.w-underline { display: block; width: min(340px, 70%); height: 16px; margin-left: 4px; }
.w-underline path { fill: none; stroke: #C98552; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s .5s var(--ease) forwards; }
.w-hero .lead { font-size: 18px; color: var(--muted); max-width: 540px; margin-top: 14px; }
.w-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.w-stats { display: flex; gap: 0; margin-top: 34px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 20px; width: fit-content; box-shadow: var(--shadow-sm); }
.w-stats div { padding: 14px 26px; }
.w-stats div + div { border-left: 1px solid var(--line); }
.w-stats b { display: block; font-size: 28px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.w-stats span { color: var(--muted); font-size: 13.5px; }
.w-hero-art { position: relative; height: 560px; }
.w-hero-img { position: absolute; left: 6%; bottom: 10px; width: 80%; height: auto; filter: drop-shadow(0 30px 40px rgba(16, 24, 40, .18)); }
.w-board { position: absolute; left: 0; top: 30px; z-index: 2; padding: 16px 22px; border-radius: 18px; background: linear-gradient(160deg, #2C3247, #1B1F2C); color: #fff; box-shadow: var(--shadow-lg); border: 6px solid #A86A3E; }
.w-board span { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #E4C9AE; }
.w-board b { display: block; font-size: 30px; font-weight: 700; margin-top: 4px; font-family: 'Dancing Script', cursive; letter-spacing: .02em; }
.w-board i { font-style: normal; color: #9FE0B8; font-size: 14px; font-weight: 600; }
.w-score { position: absolute; right: 2%; top: 10px; z-index: 2; width: 150px; padding: 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); text-align: center; border: 1px solid var(--line); }
.w-score small { color: var(--muted); font-size: 12px; }
.w-score .ring { width: 92px; height: 92px; margin: 6px auto; }
.w-robot { position: absolute; right: -4%; bottom: 0; width: 30%; z-index: 3; }
.w-robot img { width: 100%; height: auto; filter: drop-shadow(0 20px 30px rgba(16, 24, 40, .2)); }
.w-bubble { position: absolute; right: 70%; top: -8%; white-space: nowrap; background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 4px 18px; padding: 10px 16px; font-family: 'Dancing Script', cursive; font-size: 20px; font-weight: 700; color: var(--copper-600); line-height: 1.15; box-shadow: var(--shadow-md); }

/* môn học */
.w-subjects-wrap { position: relative; z-index: 2; margin-top: -36px; }
.w-subjects { overflow: hidden; padding: 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.w-subjects .marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 40s linear infinite; }
.w-subjects:hover .marquee-track { animation-play-state: paused; }
.w-subj { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s; }
.w-subj .ic { width: 18px; height: 18px; color: var(--c, var(--copper)); }
.w-subj:hover { background: var(--copper-50); color: var(--copper-600); }

/* 12 năm học */
.w-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: center; margin-bottom: 36px; }
.w-books { width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgba(16, 24, 40, .2)); }
.w-level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.w-level { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 22px; background: linear-gradient(180deg, #FFFFFF, #F8F9FB); border: 1px solid var(--line); color: inherit; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s; }
.w-level:hover { color: inherit; transform: translateY(-4px); box-shadow: var(--shadow-md); }
.w-level h3 { font-size: 20px; }
.w-level small { color: var(--copper-600); font-weight: 600; }
.w-level ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.w-level li { display: flex; gap: 8px; align-items: flex-start; }
.w-level li .ic { width: 17px; height: 17px; color: var(--copper); margin-top: 2px; }
.w-medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--copper-grad); box-shadow: 0 10px 20px -10px rgba(150, 85, 40, .9), inset 0 2px 0 rgba(255, 255, 255, .35); }
.w-medal .ic { width: 26px; height: 26px; }
.w-level.hsg { flex-direction: row; flex-wrap: wrap; align-items: center; }
.w-level.hsg ul { width: 100%; }
.w-plane { grid-column: span 2; position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 160px; }
.w-plane svg { width: 260px; height: 120px; overflow: visible; }
.w-dash { fill: none; stroke: #C98552; stroke-width: 2; stroke-dasharray: 6 8; }
.w-pl { fill: #fff; stroke: #9E5D33; stroke-width: 1.6; stroke-linejoin: round; }
.w-hand { font-size: 30px; font-weight: 700; color: var(--copper-600); line-height: 1.1; transform: rotate(-4deg); }

/* khối tối */
.w-dark { position: relative; overflow: hidden; border-radius: 36px; padding: 56px 48px 48px; background: radial-gradient(700px 360px at 85% 0%, rgba(201, 133, 82, .35), transparent 60%), linear-gradient(160deg, #2A3045, #181B26); color: #fff; margin-top: 30px; }
.w-dark-head { max-width: 640px; position: relative; z-index: 1; }
.w-dark h2 { color: #fff; font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; letter-spacing: -.02em; margin-top: 14px; }
.w-dark p { color: #C3CAD6; margin-top: 10px; font-size: 16.5px; }
.w-dark-robot { position: absolute; right: 36px; top: 18px; width: 170px; height: auto; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .35)); animation: float 6s ease-in-out infinite; }
.w-feat-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.w-feat { padding: 22px; border-radius: 22px; background: linear-gradient(150deg, #C98A57 0%, #A9653A 60%, #8B4F2A 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 20px 30px -22px rgba(0, 0, 0, .7); transition: transform .25s var(--ease); }
.w-feat:nth-child(3n+2) { background: linear-gradient(150deg, #D7A27A 0%, #B87749 60%, #94572F 100%); }
.w-feat:hover { transform: translateY(-4px); }
.w-feat-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--copper-600); margin-bottom: 14px; }
.w-feat h3 { color: #fff; font-size: 17.5px; }
.w-feat p { color: #FBEADB; font-size: 14.5px; margin-top: 6px; }

/* thầy AI */
.w-ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.w-checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.w-checks li { display: flex; gap: 12px; align-items: flex-start; }
.w-checks li > span { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--copper-grad); color: #fff; }
.w-checks li > span .ic { width: 15px; height: 15px; }
.w-ai-art { position: relative; }
.w-ai-art img { width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgba(16, 24, 40, .18)); }
.w-chat { position: absolute; left: -6%; bottom: -6%; width: 64%; padding: 14px; display: grid; gap: 8px; box-shadow: var(--shadow-lg); font-size: 13.5px; }
.w-chat .tl-bubble { padding: 8px 12px; font-size: 13.5px; }

/* 4 bước */
.w-steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.w-steps::before { content: ''; position: absolute; left: 10%; right: 10%; top: 50%; border-top: 2px dashed #D5DAE2; }
.w-step { position: relative; text-align: center; padding: 30px 20px 24px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s; }
.w-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.w-num { position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--copper-grad); }
.w-step-ic { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #FFFFFF, #EEF0F4); color: var(--copper-600); box-shadow: inset 0 0 0 6px #fff, 0 10px 20px -12px rgba(16, 24, 40, .6); }
.w-step-ic .ic { width: 32px; height: 32px; }
.w-step h3 { font-size: 17px; }
.w-step p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* vai trò */
.w-roles .role-tab { border-radius: 18px; background: #fff; }
.w-roles .role-tab.active { border-color: var(--copper); }
.w-roles .role-tab.active .r-ic { background: var(--copper-grad); }
.w-roles .role-tab .r-ic { background: var(--copper-50); color: var(--copper-600); }
.w-roles .role-panel li .ic { color: var(--copper); }

/* kêu gọi */
.w-cta { position: relative; overflow: hidden; border-radius: 36px; padding: 56px 56px; min-height: 280px; background: radial-gradient(500px 300px at 80% 100%, rgba(201, 133, 82, .45), transparent 70%), linear-gradient(150deg, #2A3045, #171A24); color: #fff; display: flex; align-items: center; margin-top: 40px; }
.w-cta-text { position: relative; z-index: 1; max-width: 560px; }
.w-cta h2 { color: #fff; font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; }
.w-cta p { color: #C3CAD6; margin: 10px 0 24px; font-size: 17px; }
.w-cta .btn-ghost-w { --bg: transparent; --fg: #fff; --bd: rgba(255, 255, 255, .35); border-radius: 999px; }
.w-cta .btn-copper { border-radius: 999px; }
.w-rocket { position: absolute; right: 2%; bottom: -14%; width: 360px; height: auto; transform: rotate(-4deg); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); animation: float 7s ease-in-out infinite; }
.site-foot { margin-top: 56px; background: #F1F2F5; border-top: 1px solid var(--line); }

/* thẻ khóa học, cửa hàng theo màu ấm */
.shop-card { border-radius: 22px; }
.price b { color: var(--copper-600); }
.price-off { background: var(--copper); }
.store-hero, .cp-hero { background: radial-gradient(600px 300px at 90% 0%, rgba(201, 133, 82, .4), transparent 65%), linear-gradient(150deg, #2A3045, #171A24); }
.store-filters a.chip.on { background: var(--primary); border-color: var(--primary); }
.store-search .btn-red, .buy-box .btn-red { border-radius: 14px; }
.cover.gen { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) 35%, #F2D9C2) 0%, color-mix(in srgb, var(--c) 55%, #8E5129) 60%, color-mix(in srgb, var(--c) 40%, #2A1B12) 100%); }

/* khu vực ứng dụng: thanh bên, thẻ */
.sidebar { background: #FFFFFF; border-right-color: var(--line); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 12px 22px -14px rgba(30, 30, 50, .9); }
.nav-item.active .ic { color: #E6B48A; }
.nav-item:hover:not(.active) { background: var(--copper-50); color: var(--copper-600); }
.card { border-color: var(--line); }
.topbar { background: rgba(245, 246, 248, .88); }
.stat-ic { background: var(--copper-50); color: var(--copper-600); }
.progress > span, .progress span[style] { background: var(--copper-grad); }

@media (max-width: 1180px) {
  .w-hero-grid, .w-ai-grid { grid-template-columns: minmax(0, 1fr); }
  .w-hero-art { height: 480px; max-width: 640px; width: 100%; margin: 0 auto; }
  .w-swoosh { opacity: .35; }
  .w-split { grid-template-columns: minmax(0, 1fr) 240px; }
  .w-feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-dark-robot { width: 120px; }
  .w-chat { left: 0; }
}
@media (max-width: 760px) {
  .w-hero { padding-top: 24px; }
  .w-hero-art { height: 360px; }
  .w-board { top: 0; padding: 10px 14px; border-width: 4px; } .w-board b { font-size: 22px; }
  .w-score { width: 120px; padding: 10px; } .w-score .ring { width: 70px; height: 70px; }
  .w-bubble { font-size: 15px; right: 60%; }
  .w-stats div { padding: 12px 16px; } .w-stats b { font-size: 22px; }
  .w-split { grid-template-columns: minmax(0, 1fr); } .w-books { max-width: 240px; margin: 0 auto; }
  .w-level-grid, .w-feat-grid, .w-steps { grid-template-columns: minmax(0, 1fr); }
  .w-plane { grid-column: auto; min-height: 120px; } .w-plane svg { width: 160px; } .w-hand { font-size: 24px; }
  .w-steps::before { display: none; }
  .w-dark, .w-cta { padding: 32px 22px; border-radius: 26px; }
  .w-dark-robot { width: 86px; right: 14px; top: 14px; }
  .w-rocket { position: relative; width: 200px; right: auto; bottom: auto; margin: 10px 0 -40px auto; display: block; }
  .w-cta { flex-direction: column; align-items: flex-start; }
  .w-chat { position: relative; width: 100%; left: 0; bottom: 0; margin-top: -30px; }
}
@media (prefers-reduced-motion: reduce) { .w-float, .w-dark-robot, .w-rocket, .w-subjects .marquee-track { animation: none; } }
.w-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.w-robot { width: 33%; }
@media (max-width: 1180px) {
  .w-swoosh { display: none; }
  .w-hero-art::before { content: ''; position: absolute; left: 8%; right: 0; top: 12%; bottom: 4%; border-radius: 48% 40% 32% 44%; background: radial-gradient(circle at 70% 30%, #3A4058, #1E2230); box-shadow: -14px 14px 0 #C98552; }
}
/* trang đăng nhập / đăng ký: nền tối ấm + minh họa 3D */
.auth-side { background: radial-gradient(600px 400px at 90% 100%, rgba(201, 133, 82, .45), transparent 65%), linear-gradient(160deg, #2A3045, #171A24); flex-direction: column; justify-content: center; gap: 10px; }
.auth-side .inner { display: flex; flex-direction: column; }
.auth-art { position: relative; z-index: 1; width: min(380px, 70%); height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .4)); animation: float 7s ease-in-out infinite; order: -1; }
.auth-side .auth-cards { margin-top: 28px; }
.auth-form { background: var(--bg); }
@media (max-width: 960px) { .auth-art { display: none; } }
.store-hero-in { position: relative; }
.store-art { position: absolute; right: 24px; top: -10px; width: 230px; height: auto; z-index: 1; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .4)); animation: float 7s ease-in-out infinite; }
@media (max-width: 960px) { .store-art { display: none; } }
.ag-fab img, .adv-fab img { width: 40px; height: 44px; object-fit: contain; margin: -10px -2px -6px -6px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.ag-fab { background: var(--copper-grad); padding-left: 10px; }
.adv-fab { background: var(--copper-grad); padding: 6px 18px 6px 10px; }
.ag-ava { width: 40px; height: 44px; object-fit: contain; }
.ag-panel header, .adv-panel header { background: linear-gradient(120deg, var(--copper-50), #FFFFFF); }
.side-card.ai-side .side-card-ic { background: var(--copper-grad); }
.tl-robot { width: 64px; height: 76px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 6px 10px rgba(16, 24, 40, .25)); }
.cta-robot { width: 56px; height: 64px; object-fit: contain; flex-shrink: 0; margin: -6px 0; }
.ai-teach-cta { background: linear-gradient(120deg, #FBF5EF, #F6ECE2); border-color: #EBD5C3; }

/* ---- Sóng trang trí giữa các khối ---- */
.wv { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 120px; pointer-events: none; z-index: 0; }
.wv.flip { top: -1px; bottom: auto; transform: scaleY(-1); }
.w-hero .wv-hero { height: 150px; z-index: 0; }
.w-hero { padding-bottom: 120px; }
.w-subjects-wrap { margin-top: -96px; }
.w-levels { position: relative; overflow: hidden; }
.w-ribbons { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.w-ribbons path { fill: none; stroke: #D9AE88; stroke-width: 1.6; opacity: .55; }
.w-ribbons path:nth-child(2) { stroke: #C98552; stroke-width: 2.4; opacity: .4; }
.w-levels .wrap { position: relative; z-index: 1; }
.w-band { position: relative; padding: 150px 0 160px; margin-top: 30px; background: radial-gradient(800px 420px at 85% 10%, rgba(201, 133, 82, .32), transparent 60%), linear-gradient(165deg, #2B3146 0%, #1B1E2A 100%); }
.w-band .wv path:last-child { filter: drop-shadow(0 -2px 0 rgba(0, 0, 0, .05)); }
.w-band .w-dark { background: none; padding: 0; border-radius: 0; overflow: visible; margin: 0; }
.w-band .w-dark-robot { right: 0; top: -40px; width: 190px; }
.w-band > .wrap { position: relative; z-index: 1; }
.w-soft { position: relative; padding: 140px 0 150px; background: linear-gradient(180deg, #EEF0F4, #F3F4F7); }
.w-soft > .wrap { position: relative; z-index: 1; }
.w-soft .w-step { background: #FFFFFF; }
.w-cta-wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
@media (max-width: 760px) {
  .wv { height: 60px; } .w-hero .wv-hero { height: 70px; }
  .w-band { padding: 80px 0 90px; } .w-soft { padding: 80px 0 90px; }
  .w-band .w-dark-robot { width: 90px; top: -20px; }
  .w-subjects-wrap { margin-top: -50px; }
}
.store-hero, .cp-hero { position: relative; padding-bottom: 110px; }
.store-hero .wv, .cp-hero .wv { height: 90px; }
.store-hero > .wrap, .cp-hero > .wrap { position: relative; z-index: 1; }
.cp-side { margin-top: -230px; position: relative; z-index: 2; }
@media (max-width: 1100px) { .cp-side { margin-top: 0; } }
.w-stats { position: relative; z-index: 3; max-width: 100%; }
@media (max-width: 760px) { .w-stats span { font-size: 12px; } .w-stats div { padding: 10px 12px; } .w-hero-art { margin-top: 18px; } }

/* ---- v2.2.2 · Trung tính, có chiều sâu ---- */
.w-hero { background: radial-gradient(900px 520px at 22% 30%, #FFFFFF 0%, rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, #FFFFFF 0%, #F5F6F8 100%); }
.w-levels, #thay-ai, #khoa-hoc { background: transparent; }
.w-level { background: #fff; box-shadow: var(--shadow-sm); }
.w-level:hover { box-shadow: var(--shadow-lg); }
.w-subjects { box-shadow: var(--shadow-md); }
.w-subj { background: #F3F4F7; }
.w-step, .shop-card, .role-tab, .role-panel, .w-chat { box-shadow: var(--shadow-sm); }
.shop-card:hover, .w-step:hover { box-shadow: var(--shadow-lg); }
.w-soft { background: linear-gradient(180deg, #ECEEF3, #F1F2F6); }
.w-ribbons path { stroke: #D3A47C; opacity: .45; }
.site-foot { background: #fff; }
.card { border-color: var(--line); }
.sidebar { background: #fff; box-shadow: 1px 0 0 var(--line); }
.nav-item:hover:not(.active) { background: #F1F3F7; color: var(--ink); }
.stat-ic { background: #F1F3F7; color: var(--primary); }
.stat-ic.green { background: var(--green-50); color: var(--green); }
.stat-ic.amber { background: var(--amber-50); color: var(--amber); }
.btn-outline { --fg: var(--ink); --bd: var(--line); background: #fff; }
.btn-outline:hover { --bd: #C7CDD7; background: #fff; }
.alert-info { background: #EEF2F8; color: #24324F; }
.ai-teach-cta { background: linear-gradient(120deg, #FFFFFF, #FBF4EE); border-color: #EED9C6; box-shadow: var(--shadow-md); }
.tl-bubble { box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.tl-card { border-color: var(--line); box-shadow: var(--shadow-lg); }
/* đầu trang khóa học trong khu học: khối tối có chiều sâu */
.course-hero { position: relative; overflow: hidden; border: 0; color: #fff; background: radial-gradient(600px 300px at 85% 0%, rgba(201, 133, 82, .38), transparent 65%), linear-gradient(150deg, #262C40, #161925); box-shadow: var(--shadow-lg); }
.course-hero h1, .course-hero b { color: #fff; }
.course-hero .muted, .course-hero .small .muted { color: #B9C1CF !important; }
.course-hero .badge { background: rgba(255, 255, 255, .12); color: #F1E1D1; }
.course-hero .subject-tile { background: rgba(255, 255, 255, .1) !important; color: #E6B48A !important; box-shadow: none; }
.course-hero .progress { background: rgba(255, 255, 255, .14); }
.course-hero .btn-primary { --bg: transparent; --bd: transparent; background: var(--copper-grad); box-shadow: 0 12px 24px -12px rgba(201, 133, 82, .9); }
.course-hero > *:not(.course-hero-art) { position: relative; z-index: 1; }
.course-hero-art { position: absolute; right: 210px; top: 14px; width: 150px; opacity: .9; z-index: 0; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); pointer-events: none; }
@media (max-width: 1180px) { .course-hero-art { display: none; } }
.w-subjects-wrap { margin-top: -54px; }
.w-levels { padding-top: 64px; }

/* =========================================================
   v2.2.3 · Chuyển động kể chuyện + sửa bố cục
   ========================================================= */
/* Kiểu xuất hiện */
html.js [data-anim="left"] { transform: translateX(-48px); }
html.js [data-anim="right"] { transform: translateX(48px); }
html.js [data-anim="zoom"] { transform: scale(.94); }
html.js [data-anim="down"] { transform: translateY(-14px); }
html.js [data-anim="pop"] { transform: translateY(36px) scale(.92); }
html.js [data-anim="fade"] { transform: none; }
html.js [data-anim="wipe"] { transform: translateY(26px); filter: blur(10px); }
html.js [data-anim].in { filter: none; transition: opacity .7s var(--ease), transform .9s cubic-bezier(.16, 1, .3, 1), filter .9s var(--ease); transition-delay: var(--d, 0s); }
html.js [data-anim="pop"].in { transition: opacity .5s var(--ease), transform .7s cubic-bezier(.34, 1.56, .64, 1); transition-delay: var(--d, 0s); }
html.js [data-stagger] > * { opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .5s var(--ease), transform .6s cubic-bezier(.34, 1.4, .64, 1); transition-delay: calc(var(--sd, 0s) + .15s); }
html.js [data-stagger].in > * { opacity: 1; transform: none; }

/* Thanh tiến trình đọc trang */
.scroll-prog { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 60; pointer-events: none; }
.scroll-prog span { display: block; height: 100%; background: var(--copper-grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(201, 133, 82, .6); }

/* Dải môn học: không cắt, xếp gọn */
.w-subjects { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 14px 18px; border-radius: 28px; mask-image: none; -webkit-mask-image: none; overflow: visible; }
.w-subj { height: 40px; padding: 0 16px; transition: background .2s, color .2s, transform .2s var(--ease), box-shadow .2s; }
.w-subj:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); background: #fff; }

/* Robot hero: lắc tay, bong bóng chữ */
.w-robot-in { animation: bob 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.w-bubble { animation: bubbleIn .6s 1.4s cubic-bezier(.34, 1.56, .64, 1) both; transform-origin: 100% 100%; }
@keyframes bubbleIn { from { opacity: 0; transform: scale(.4) translateY(10px); } }
.w-hero-img { animation: heroIn 1.1s .2s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(40px) scale(.96); } }
.w-board { animation: float 6s ease-in-out infinite, cardIn .8s .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.w-score { animation: float 6s -2s ease-in-out infinite, cardIn .8s .8s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes cardIn { from { opacity: 0; scale: .6; } }
.w-hero-art [data-depth] { transition: translate .6s cubic-bezier(.16, 1, .3, 1); }

/* Máy bay giấy bay theo đường nét đứt */
.w-dash { stroke-dashoffset: 0; }
.w-pl { offset-path: path('M6 100 C 60 20, 120 120, 170 60 S 230 30, 246 22'); offset-rotate: auto; offset-distance: 0%; }
.w-pl path { fill: #fff; stroke: #9E5D33; stroke-width: 1.6; stroke-linejoin: round; }
.w-plane.in .w-pl { animation: fly 2.6s .3s cubic-bezier(.45, 0, .25, 1) forwards; }
.w-plane .w-dash { stroke-dasharray: 6 8; clip-path: inset(0 100% 0 0); }
.w-plane.in .w-dash { animation: dashIn 2.6s .3s cubic-bezier(.45, 0, .25, 1) forwards; }
@keyframes fly { to { offset-distance: 100%; } }
@keyframes dashIn { to { clip-path: inset(0 0 0 0); } }
.w-hand { opacity: 0; transform: rotate(-4deg) translateY(8px); transition: opacity .6s 2.4s, transform .6s 2.4s; }
.w-plane.in .w-hand { opacity: 1; transform: rotate(-4deg); }

/* Thẻ: ánh sáng theo chuột */
[data-tilt] { transform-style: preserve-3d; will-change: transform; position: relative; }
.w-feat::after, .w-level::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .28), transparent 60%); }
.w-level::after { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(201, 133, 82, .14), transparent 60%); }
.w-feat:hover::after, .w-level:hover::after { opacity: 1; }
.w-feat .w-feat-ic { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.w-feat:hover .w-feat-ic { transform: translateZ(30px) rotate(-8deg) scale(1.08); }
.w-medal { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.w-level:hover .w-medal { transform: rotate(-12deg) scale(1.1); }

/* Hội thoại thầy AI hiện lần lượt */
html.js .w-chat .tl-msg { opacity: 0; transform: translateY(12px); transition: opacity .45s, transform .5s cubic-bezier(.34, 1.4, .64, 1); }
html.js .w-ai-art.in .w-chat .tl-msg { opacity: 1; transform: none; }
.w-ai-art.in .w-chat .tl-msg:nth-child(1) { transition-delay: .6s; }
.w-ai-art.in .w-chat .tl-msg:nth-child(2) { transition-delay: 1.5s; }
.w-ai-art.in .w-chat .tl-msg:nth-child(3) { transition-delay: 2.3s; }

/* 4 bước: đường nối vẽ dần */
.w-steps::before { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.6s cubic-bezier(.65, 0, .35, 1) .2s; }
.w-steps.in::before { transform: scaleX(1); }
.w-step .w-num { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.w-step:hover .w-num { transform: scale(1.15) rotate(-10deg); }
.w-step-ic { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.w-step:hover .w-step-ic { transform: translateY(-4px) rotate(6deg); }

/* Tên lửa: không còn cạnh vuông, bay lên khi cuộn tới */
.w-rocket-wrap { position: absolute; right: 0; top: 0; bottom: 0; width: 46%; pointer-events: none; -webkit-mask-image: radial-gradient(75% 85% at 62% 52%, #000 55%, transparent 100%); mask-image: radial-gradient(75% 85% at 62% 52%, #000 55%, transparent 100%); }
.w-rocket { position: absolute; right: 4%; bottom: -12%; width: auto; height: 106%; transform: rotate(-4deg) translateY(110%); animation: none; opacity: 0; }
.w-cta.in .w-rocket { animation: launch 1.6s .2s cubic-bezier(.16, 1, .3, 1) forwards, hover 5s 1.9s ease-in-out infinite; }
@keyframes launch { 0% { opacity: 0; transform: rotate(-4deg) translate(30px, 110%); } 60% { opacity: 1; } 100% { opacity: 1; transform: rotate(-4deg) translate(0, 0); } }
@keyframes hover { 0%, 100% { transform: rotate(-4deg) translate(0, 0); opacity: 1; } 50% { transform: rotate(-2deg) translate(4px, -10px); opacity: 1; } }
.w-cta-text { max-width: 52%; }

/* Khối tính năng: robot không đè chữ */
.w-dark-head { max-width: min(640px, calc(100% - 220px)); }

@media (max-width: 760px) {
  /* hero điện thoại: các thẻ không đè mặt nhân vật */
  .w-hero-art { height: 420px; margin-top: 24px; }
  .w-hero-img { left: 0; right: 0; bottom: 18px; width: 88%; margin: 0 auto; }
  .w-board { top: -6px; left: 0; padding: 8px 12px; } .w-board b { font-size: 20px; } .w-board span { font-size: 10px; }
  .w-score { top: -6px; right: 0; width: 96px; padding: 8px; } .w-score .ring { width: 58px; height: 58px; } .w-score small { font-size: 10px; } .w-score .ring-label b { font-size: 16px; }
  .w-robot { width: 26%; right: 0; bottom: 4px; }
  .w-bubble { display: none; }
  .w-hero-art::before { top: 16%; }
  /* tab vai trò: lưới 2 cột, không thanh cuộn */
  .roles { grid-template-columns: minmax(0, 1fr); }
  .role-tabs { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; overflow: visible !important; flex-direction: unset; }
  .role-tab { padding: 10px; gap: 8px; min-width: 0; }
  .role-tab .r-ic { width: 34px; height: 34px; flex-shrink: 0; }
  .role-tab small { display: none; }
  .role-panel ul { grid-template-columns: 1fr; }
  /* khối tối: robot nằm trên tiêu đề */
  .w-band .w-dark-robot { position: relative; right: auto; top: auto; display: block; width: 96px; margin: 0 0 10px auto; translate: none !important; }
  .w-dark-head { max-width: none; }
  /* kêu gọi: tên lửa phía dưới, mờ dần các mép */
  .w-cta { flex-direction: column; align-items: stretch; padding-bottom: 0; }
  .w-cta-text { max-width: none; }
  .w-rocket-wrap { position: relative; width: 100%; height: 230px; margin-top: 10px; -webkit-mask-image: radial-gradient(70% 80% at 50% 45%, #000 55%, transparent 100%); mask-image: radial-gradient(70% 80% at 50% 45%, #000 55%, transparent 100%); }
  .w-rocket { right: 50%; margin-right: -120px; height: 260px; bottom: -20px; }
  .w-subjects { border-radius: 22px; padding: 10px; gap: 8px; }
  .w-subj { height: 36px; padding: 0 12px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .w-robot-in, .w-bubble, .w-hero-img, .w-board, .w-score, .w-pl, .w-rocket { animation: none !important; }
  .w-rocket { transform: rotate(-4deg); opacity: 1; }
  .w-plane .w-dash { clip-path: none; } .w-hand { opacity: 1; }
  html.js [data-stagger] > * { opacity: 1; transform: none; }
}
body.warm main, body.store main { overflow-x: clip; }
.w-rocket-wrap { -webkit-mask-image: none !important; mask-image: none !important; overflow: visible; }
.w-rocket { height: 94%; bottom: 0; right: 4%; }
@media (max-width: 760px) { .w-rocket-wrap { height: 240px; } .w-rocket { height: 226px; bottom: 8px; right: auto; left: 50%; margin: 0 0 0 -108px; } }

/* ================= v2.3 · Nhập đề thông minh ================= */
.si-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 20px 26px; border: 2px dashed #CBD2DC; border-radius: 18px; background: linear-gradient(180deg, #FBFCFD, #F3F5F8); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.si-drop:hover, .si-drop.over { border-color: var(--copper); background: linear-gradient(180deg, #FFFAF5, var(--copper-50)); }
.si-drop.over { transform: scale(1.01); }
.si-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.si-drop b { font-size: 18px; color: var(--ink); }
.si-drop u { color: var(--copper-600); text-underline-offset: 3px; }
.si-drop-art { display: flex; gap: 10px; margin-bottom: 8px; }
.si-drop-art i { width: 64px; height: 78px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); display: grid; place-items: center; align-content: center; gap: 4px; font-style: normal; border-top: 5px solid; transition: transform .35s var(--ease); }
.si-drop-art i .ic { width: 26px; height: 26px; }
.si-drop-art i small { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.si-drop-art .d1 { color: #2B5797; transform: rotate(-8deg) translateY(4px); }
.si-drop-art .d2 { color: #C2332B; transform: translateY(-4px); }
.si-drop-art .d3 { color: #1C7C54; transform: rotate(8deg) translateY(4px); }
.si-drop:hover .d1 { transform: rotate(-14deg) translate(-6px, 0); }
.si-drop:hover .d2 { transform: translateY(-10px); }
.si-drop:hover .d3 { transform: rotate(14deg) translate(6px, 0); }
.si-chosen { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; position: relative; z-index: 1; pointer-events: none; }
.si-file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; color: var(--ink); box-shadow: var(--shadow-sm); }
.si-file b { font-size: 10.5px; padding: 3px 7px; border-radius: 999px; color: #fff; background: #64748B; }
.si-file.k-docx b { background: #2B5797; } .si-file.k-pdf b { background: #C2332B; } .si-file.k-img b { background: #1C7C54; } .si-file.k-doc b, .si-file.k-other b { background: var(--red); }
.si-file small { color: var(--muted); }
.si-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.si-ways > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; padding: 12px; border-radius: 14px; background: var(--bg); }
.si-ways b { font-size: 14px; color: var(--ink); align-self: center; }
.si-ways small { grid-column: 1 / -1; color: var(--muted); line-height: 1.5; }
.si-way-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.si-way-ic.green { background: var(--green-50); color: var(--green); } .si-way-ic.ai { background: var(--ai-50); color: var(--ai); } .si-way-ic.amber { background: var(--amber-50); color: var(--amber); }
.si-way-ic .ic { width: 17px; height: 17px; }
.si-up-foot { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.si-up-foot .check { flex: 1 1 320px; }
.si-up-foot .check.need { color: var(--ai); }
.si-up-foot .btn-lg { margin-left: auto; }
.si-more { flex-basis: 100%; order: 3; font-size: 13.5px; }
.si-more summary { cursor: pointer; color: var(--muted); }
.si-more input { width: 100%; margin-top: 8px; }
.si-guide .si-rules { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.si-guide code { font-size: 12.5px; background: var(--bg); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.si-u { text-decoration: underline 2px; text-underline-offset: 3px; } .si-red { color: #D8232A; font-weight: 700; }
.si-drafts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.si-drafts a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: var(--ink); text-decoration: none; transition: background .2s; }
.si-drafts a:hover { background: var(--bg); }
.si-drafts b { display: block; font-size: 14px; } .si-drafts small { font-size: 12.5px; }
.si-wait { position: fixed; inset: 0; z-index: 90; background: rgba(15, 20, 35, .45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.si-wait[hidden] { display: none; }
.si-wait-card { width: min(420px, 100%); padding: 30px 26px; text-align: center; display: grid; gap: 8px; justify-items: center; animation: siPop .35s var(--ease); }
.si-wait-card b { font-size: 17px; }
.si-scan { position: relative; width: 74px; height: 90px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; place-items: center; color: var(--primary); overflow: hidden; margin-bottom: 8px; }
.si-scan .ic { width: 34px; height: 34px; }
.si-scan i { position: absolute; left: 0; right: 0; height: 3px; background: var(--copper); box-shadow: 0 0 14px 4px rgba(180, 112, 62, .55); animation: siScan 1.6s ease-in-out infinite alternate; }
.si-wait-bar { width: 100%; height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; margin-top: 8px; }
.si-wait-bar i { display: block; height: 100%; width: 40%; border-radius: 6px; background: var(--copper-grad); animation: siBar 1.4s ease-in-out infinite; }
@keyframes siScan { from { top: 6%; } to { top: 92%; } }
@keyframes siBar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes siPop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- màn hình duyệt ---- */
.si-top { position: sticky; top: 8px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; padding: 14px 18px 18px; overflow: hidden; }
.si-top-l { display: flex; align-items: center; gap: 12px; flex: 1 1 340px; min-width: 0; }
.si-top-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.si-badge { width: 44px; height: 44px; border-radius: 12px; background: #2B5797; color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.si-name { width: 100%; font-size: 18px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 3px 6px; margin-left: -6px; border-radius: 8px; color: var(--ink); }
.si-name:hover { border-color: var(--line); } .si-name:focus { border-color: var(--primary); background: #fff; outline: 0; }
.si-stats { font-size: 13.5px; color: var(--ink-2); }
.si-stats .ok, .si-saved.ok { color: var(--green); } .si-stats .bad, .si-sum .bad, .si-saved.bad { color: var(--red-600); } .si-stats .ai { color: var(--ai); }
.si-filter b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red-50); color: var(--red-600); font-size: 12px; margin-left: 4px; }
.si-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--bg); }
.si-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1C7C54, #34A36F); transition: width .5s var(--ease); }
.si-tip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.si-tip .ic { color: var(--amber); }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; font: 600 12px/1.5 ui-monospace, Consolas, monospace; color: var(--ink); text-align: center; }
.si-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.si-side { position: sticky; top: 112px; max-height: calc(100vh - 124px); overflow: auto; border-radius: 18px; }
.si-list { display: grid; gap: 14px; counter-reset: q; }
.si-q { padding: 0; overflow: hidden; border: 1px solid var(--line); transition: box-shadow .2s, border-color .2s, opacity .2s; outline: 0; }
.si-q:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100), var(--shadow-md); }
.si-q.warn { border-left: 4px solid var(--amber); }
.si-q.bad { border-color: var(--red); border-left: 4px solid var(--red); }
.si-q.skip { opacity: .5; }
.si-q.skip .si-b { display: none; }
.si-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: #FAFBFC; border-bottom: 1px solid var(--line); }
.si-no { font-weight: 800; color: var(--ink); }
.si-sec { font-size: 12.5px; color: var(--muted); }
.si-type { font-size: 13px; padding: 4px 26px 4px 8px; border-radius: 8px; min-height: 0; height: auto; width: auto; }
.si-src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.si-src .ic { width: 13px; height: 13px; }
.si-src.s-ok { background: var(--green-50); color: var(--green); } .si-src.s-ai { background: var(--ai-50); color: var(--ai); } .si-src.s-none { background: var(--amber-50); color: var(--amber); }
.si-b { padding: 14px 16px 6px; display: grid; gap: 12px; }
.si-c { font-size: 15.5px; line-height: 1.65; color: var(--ink); cursor: text; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; transition: background .15s; }
.si-c:hover, .si-ot:hover { background: #F6F7F9; }
.si-c img, .si-c .q-img { max-width: min(100%, 420px); border-radius: 8px; display: block; margin: 6px 0; }
.si-in { width: 100%; font: 14.5px/1.55 ui-monospace, Consolas, monospace; border: 1px solid var(--primary); border-radius: 8px; padding: 8px 10px; background: #fff; resize: vertical; }
input.si-in { font-family: inherit; }
.si-pv { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 14.5px; }
.si-pv:empty { display: none; }
.si-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.si-o { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 30px 6px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; }
.si-o.on { border-color: #1C7C54; background: #F0FAF4; }
.si-l { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #CBD2DC; background: #fff; font-weight: 800; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.si-opts.multiple .si-l { border-radius: 8px; }
.si-l:hover { border-color: #1C7C54; color: #1C7C54; transform: scale(1.06); }
.si-o.on .si-l { background: #1C7C54; border-color: #1C7C54; color: #fff; box-shadow: 0 4px 10px -4px rgba(28, 124, 84, .7); }
.si-ot { flex: 1; min-width: 0; padding: 4px 6px; border-radius: 6px; cursor: text; overflow-wrap: anywhere; }
.si-ox { position: absolute; right: 6px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-2); cursor: pointer; opacity: 0; display: grid; place-items: center; }
.si-ox .ic { width: 14px; height: 14px; }
.si-o:hover .si-ox, .si-ox:focus { opacity: 1; } .si-ox:hover { background: var(--red-50); color: var(--red-600); }
.si-add { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.si-add:hover { color: var(--primary); background: var(--primary-50); }
.si-add .ic { width: 14px; height: 14px; }
.si-mini { font-size: 12.5px; margin-top: -6px; }
.si-tf { display: flex; gap: 10px; }
.si-tf button { min-width: 110px; padding: 9px 18px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; color: var(--ink-2); transition: all .15s; }
.si-tf button:hover { border-color: var(--primary); }
.si-tf button.on.t { background: #1C7C54; border-color: #1C7C54; color: #fff; } .si-tf button.on.f { background: #C2332B; border-color: #C2332B; color: #fff; }
.si-short, .si-rub { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.si-short input, .si-rub textarea { font-weight: 400; }
.si-ex summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.si-ex textarea { width: 100%; margin-top: 8px; }
.si-w { display: flex; align-items: center; gap: 8px; margin: 2px 16px 0; padding: 8px 12px; border-radius: 10px; background: var(--amber-50); color: #8A5A00; font-size: 13.5px; font-weight: 600; }
.si-q.bad .si-w { background: var(--red-50); color: var(--red-600); }
.si-w .ic { width: 16px; height: 16px; flex-shrink: 0; }
.si-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px 10px; }
.si-f select { width: auto; font-size: 13px; padding: 4px 26px 4px 8px; min-height: 0; height: auto; }
.si-pts { display: none; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.si-pts input { width: 70px; padding: 4px 8px; min-height: 0; height: auto; font-size: 13px; }
.si.dest-lesson .si-pts { display: inline-flex; }
.si-f .btn .ic { width: 15px; height: 15px; }
.si-dest .card-title .ic { color: var(--copper); }
.si-dest-opts { display: grid; gap: 8px; }
.si-opt { position: relative; cursor: pointer; }
.si-opt input { position: absolute; opacity: 0; }
.si-opt > span { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; transition: all .15s; }
.si-opt > span .ic { grid-row: span 2; align-self: center; width: 20px; height: 20px; color: var(--muted); }
.si-opt b { font-size: 14px; } .si-opt small { color: var(--muted); font-size: 12.5px; }
.si-opt input:checked + span { border-color: var(--copper); background: var(--copper-50); }
.si-opt input:checked + span .ic { color: var(--copper); }
.si-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-100); }
.si-opt input:disabled + span { opacity: .5; cursor: not-allowed; }
.si-classes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 13.5px; transition: all .15s; }
.chip-check input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-100); }
.si-dest .field.warn select { border-color: var(--red); }
.si-sum { margin: 14px 0 12px; padding: 12px; border-radius: 12px; background: var(--bg); font-size: 14px; display: grid; gap: 4px; }
.w-full { width: 100%; justify-content: center; }
.si-dest [data-dest-for][hidden] { display: none; }
@media (max-width: 1100px) {
  .si-layout { grid-template-columns: 1fr; }
  .si-side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .si-ways { grid-template-columns: 1fr; }
  .si-opts { grid-template-columns: 1fr; }
  .si-top { position: static; }
  .si-top-r { width: 100%; }
  .si-top-r .btn { flex: 1; }
  .si-tf button { flex: 1; min-width: 0; }
  .si-up-foot .btn-lg { width: 100%; }
}
.si-promo { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; color: var(--ink); text-decoration: none; border: 1px solid var(--copper-50); background: linear-gradient(90deg, #FFF8F1, #fff); transition: transform .2s, box-shadow .2s; }
.si-promo:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.si-promo .si-badge { background: var(--copper-grad); }
.si-promo b { display: block; } .si-promo small { font-size: 13.5px; }
.si-idx { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.si-type, .si-f select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; color: var(--ink-2); box-shadow: none; }
.si-type:hover, .si-f select:hover { border-color: #CBD2DC; }
.btn-ai.done, .btn-ai.done:disabled { background: var(--green-50); color: var(--green); box-shadow: none; opacity: 1; }
.si-tip { display: block; line-height: 2; }
.si-tip .ic { vertical-align: -3px; margin-right: 4px; }
.si-guide .card-title, .si-dest .card-title { display: flex; align-items: center; gap: 8px; }
.si-ways > div { align-content: start; }
.si-filter b.zero { background: var(--bg); color: var(--muted); }

/* ================= v2.3 · AI khoanh lỗi trên ảnh bài làm ================= */
.ann { --e: #E03131; --o: #1C9A5B; --n: #E8930C; display: grid; gap: 14px; }
.ann-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ann-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.ann-title .ic { color: var(--ai); }
.ann-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.ann-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg); }
.ann-legend i { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid; }
.ann-legend .k-error { color: var(--e); } .ann-legend .k-ok { color: var(--o); } .ann-legend .k-note { color: var(--n); }
.ann-pages { display: grid; gap: 14px; }
.ann-pages.multi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.ann-page { margin: 0; }
.ann-img { position: relative; border-radius: 12px; overflow: hidden; background: #F1F3F6; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); line-height: 0; }
.ann-img img { width: 100%; height: auto; display: block; }
.ann-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ann-sh { fill: transparent; stroke-width: 3px; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: fill .2s, stroke-width .2s; }
.ann-img.drawn .ann-sh { animation: annDraw .9s cubic-bezier(.6, .1, .3, 1) var(--d, 0s) forwards; }
.ann-sh.k-error { stroke: var(--e); } .ann-sh.k-ok { stroke: var(--o); } .ann-sh.k-note { stroke: var(--n); stroke-dasharray: 4 3; stroke-dashoffset: 0; opacity: 0; }
.ann-img.drawn .ann-sh.k-note { animation: annFade .5s var(--d, 0s) forwards; }
.ann-sh.hl.k-error { fill: rgba(224, 49, 49, .12); stroke-width: 4.5px; } .ann-sh.hl.k-ok { fill: rgba(28, 154, 91, .12); stroke-width: 4.5px; } .ann-sh.hl.k-note { fill: rgba(232, 147, 12, .14); }
.ann-pin { position: absolute; transform: translate(-50%, -50%) scale(0); width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid #fff; color: #fff; font: 800 13px/1 var(--font, inherit); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); transition: transform .25s var(--ease); z-index: 2; padding: 0; }
.ann-img.drawn .ann-pin { animation: annPop .4s var(--ease) var(--d, 0s) forwards; }
.ann-pin.k-error { background: var(--e); } .ann-pin.k-ok { background: var(--o); } .ann-pin.k-note { background: var(--n); }
.ann-pin.hl, .ann-pin:focus-visible { transform: translate(-50%, -50%) scale(1.22) !important; outline: 0; }
.ann-pin.flash { animation: annPulse .5s ease 2 !important; transform: translate(-50%, -50%) scale(1); }
.ann.ann-off .ann-svg, .ann.ann-off .ann-pin { visibility: hidden; }
.ann-page figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); padding: 6px 2px 0; line-height: 1.4; }
.ann-page figcaption a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.ann-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ann-it { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--e); cursor: pointer; transition: box-shadow .2s, transform .2s, background .2s; outline: 0; }
.ann-it.k-ok { border-left-color: var(--o); } .ann-it.k-note { border-left-color: var(--n); }
.ann-it.hl, .ann-it:focus-visible { box-shadow: var(--shadow-md); transform: translateX(3px); }
.ann-it.flash { background: #FFF7F0; }
.ann-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: var(--e); }
.ann-it.k-ok .ann-num { background: var(--o); } .ann-it.k-note .ann-num { background: var(--n); }
.ann-it-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ann-it-h b { font-size: 14.5px; }
.ann-tag { font-size: 12px; color: var(--muted); }
.ann-keep { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.ann-keep input { accent-color: var(--primary); }
.ann-quote { margin-top: 6px; padding: 4px 10px; border-left: 3px solid #D7DCE3; color: var(--ink-2); font-style: italic; font-size: 14px; background: var(--bg); border-radius: 0 6px 6px 0; }
.ann-it.k-error .ann-quote { text-decoration: line-through; text-decoration-color: rgba(224, 49, 49, .6); }
.ann-note { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--ink); }
.ann-fix { margin-top: 6px; font-size: 14px; line-height: 1.6; padding: 6px 10px; border-radius: 8px; background: #EEF8F2; color: #12603F; }
.ann-it.k-ok .ann-fix { background: var(--bg); color: var(--ink-2); }
@keyframes annDraw { to { stroke-dashoffset: 0; } }
@keyframes annFade { to { opacity: 1; } }
@keyframes annPop { from { transform: translate(-50%, -50%) scale(0); } 70% { transform: translate(-50%, -50%) scale(1.25); } to { transform: translate(-50%, -50%) scale(1); } }
@keyframes annPulse { 50% { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 0 8px rgba(224, 49, 49, .25); } }
@media (prefers-reduced-motion: reduce) { .ann-sh { stroke-dashoffset: 0 !important; animation: none !important; opacity: 1 !important; } .ann-pin { transform: translate(-50%, -50%) scale(1); animation: none !important; } }

/* Ảnh bài làm tự luận trong bài kiểm tra */
.essay-photos { margin-top: 10px; padding: 12px; border: 1.5px dashed #CBD2DC; border-radius: 14px; background: #FAFBFC; display: grid; gap: 10px; }
.ep-list { display: flex; flex-wrap: wrap; gap: 10px; }
.ep-list:empty { display: none; }
.ep-th { position: relative; margin: 0; width: 110px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.ep-th img { width: 100%; height: 130px; object-fit: cover; display: block; }
.ep-th figcaption { font-size: 12px; text-align: center; padding: 4px; color: var(--muted); }
.ep-th.busy img { opacity: .45; filter: blur(1px); }
.ep-th .hw-x { position: absolute; top: 4px; right: 4px; }
.ep-spin { position: absolute; top: 50px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border: 3px solid var(--line); border-top-color: var(--copper); border-radius: 50%; animation: spin .8s linear infinite; }
.ep-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Học sinh: AI chấm thử bài tập */
.hw-aicheck { border: 1px solid #EBDDF7; background: linear-gradient(180deg, #FCF9FF, #fff 120px); }
.hw-aicheck-h { flex-wrap: nowrap; align-items: center; gap: 12px; }
.hw-aicheck-h small { display: block; line-height: 1.5; }
.hw-pre-score { display: grid; justify-items: center; line-height: 1; padding: 8px 14px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.hw-pre-score b { font-size: 26px; color: var(--ai); } .hw-pre-score small { color: var(--muted); font-size: 12px; } .hw-pre-score em { font-style: normal; font-size: 11px; color: var(--muted); margin-top: 3px; }
.hw-check-wait { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--bg); }
.hw-check-wait[hidden] { display: none; }
.hw-check-wait small { display: block; }
.si-scan.sm { width: 44px; height: 54px; margin: 0; }
.si-scan.sm .ic { width: 22px; height: 22px; }
@media (max-width: 640px) { .hw-aicheck-h { flex-wrap: wrap; } .hw-aicheck-h .btn { width: 100%; } }
.ann-pages:not(.multi) .ann-page { max-width: 760px; width: 100%; justify-self: center; }
.reading pre.calc, pre.calc { display: inline-block; min-width: 90px; margin: 6px 0 10px; padding: 10px 16px; border-radius: 10px; background: #FBFAF6; border: 1px solid var(--line); font: 600 17px/1.35 ui-monospace, Consolas, "Courier New", monospace; color: var(--ink); white-space: pre; overflow-x: auto; max-width: 100%; }
/* Ảnh bìa tự tạo: mỗi lớp một màu, số lớp nổi bật */
.cover.gen { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) 45%, #fff) 0%, var(--c) 50%, color-mix(in srgb, var(--c) 62%, #0B1020) 100%); }
.cover-g { position: absolute; left: 16px; top: 12px; z-index: 1; color: #fff; display: flex; align-items: baseline; gap: 6px; text-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.cover-g small { font-size: 15px; font-weight: 700; opacity: .9; text-transform: uppercase; letter-spacing: .06em; }
.cover-g b { font-size: 64px; line-height: 1; font-weight: 900; letter-spacing: -.03em; }
.course-hero .cover-g b, .cp-cover .cover-g b { font-size: 56px; }

/* ================= v2.4 · Trình chiếu slide bài giảng ================= */
.slide-cta { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid #E3D6C8; background: linear-gradient(100deg, #FFF8F1, #fff 60%); cursor: pointer; text-align: left; color: var(--ink); font: inherit; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.slide-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.slide-cta b { display: block; font-size: 15.5px; }
.slide-cta small { color: var(--muted); font-size: 13px; }
.slide-cta-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--copper-grad); flex-shrink: 0; box-shadow: 0 8px 18px -10px rgba(150, 90, 50, .8); }
.slide-cta-ic .ic { width: 24px; height: 24px; }
.preview-wrap .slide-cta { margin-bottom: 4px; }
body.deck-open { overflow: hidden; }
.deck { position: fixed; inset: 0; z-index: 200; background: radial-gradient(120% 120% at 100% 0%, #2B3350 0%, #161B2C 60%, #0E1220 100%); color: #fff; display: flex; flex-direction: column; animation: deckIn .3s var(--ease); }
.deck-slide { position: absolute; inset: 0 0 64px; display: flex; align-items: center; justify-content: center; padding: 40px clamp(18px, 6vw, 90px); opacity: 0; visibility: hidden; transform: translateX(40px); transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .45s; }
.deck-slide.past { transform: translateX(-40px); }
.deck-slide.on { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--ease), transform .45s var(--ease); }
.deck-in { width: min(1080px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #fff; color: var(--ink); border-radius: 26px; padding: clamp(22px, 4vw, 48px) clamp(20px, 5vw, 60px); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); position: relative; overflow: hidden; }
.deck-in::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--copper-grad); }
.deck-no { position: absolute; right: 28px; top: 18px; font: 900 64px/1 var(--font, inherit); color: #F1E6DA; letter-spacing: -.04em; }
.deck-in h2 { margin: 0 0 18px; font-size: clamp(24px, 3.2vw, 38px); font-weight: 800; color: var(--primary); position: relative; padding-right: 90px; }
.deck-body { overflow-y: auto; font-size: clamp(17px, 1.9vw, 22px); line-height: 1.65; padding-right: 6px; }
.deck-body > * { animation: deckUp .5s var(--ease) both; }
.deck-body > *:nth-child(2) { animation-delay: .08s; } .deck-body > *:nth-child(3) { animation-delay: .16s; } .deck-body > *:nth-child(4) { animation-delay: .24s; } .deck-body > *:nth-child(n+5) { animation-delay: .32s; }
.deck-body ul, .deck-body ol { padding-left: 1.3em; }
.deck-body li { margin: .35em 0; }
.deck-body li::marker { color: var(--copper); font-weight: 800; }
.deck-body strong { color: var(--primary); }
.deck-body pre.calc { font-size: 24px; }
.deck-title .deck-in { background: transparent; color: #fff; box-shadow: none; text-align: left; padding-left: 0; }
.deck-title .deck-in::before { display: none; }
.deck-kicker { display: inline-block; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #E8B98F; font-weight: 700; }
.deck-title h1 { font-size: clamp(32px, 5.4vw, 64px); line-height: 1.12; margin: 14px 0 18px; font-weight: 900; letter-spacing: -.02em; }
.deck-lead { font-size: clamp(16px, 1.8vw, 20px); color: rgba(255, 255, 255, .72); max-width: 820px; }
.deck-start { margin-top: 24px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, .6); }
.deck-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 14px; }
.deck-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.deck-btn:hover, .deck-btn:focus-visible { background: rgba(255, 255, 255, .2); outline: 0; }
.deck-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 50vw; }
.deck-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .25); cursor: pointer; transition: all .25s; }
.deck-dots i.on { width: 26px; border-radius: 6px; background: #E8B98F; }
.deck-count { font-size: 13px; color: rgba(255, 255, 255, .7); min-width: 54px; text-align: center; }
.deck-prog { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: rgba(255, 255, 255, .08); }
.deck-prog i { display: block; height: 100%; width: 0; background: var(--copper-grad); transition: width .35s var(--ease); }
.deck:fullscreen { background: #11162A; }
@keyframes deckIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes deckUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .deck-slide { padding: 14px 10px; } .deck-dots { display: none; } .deck-no { font-size: 40px; right: 16px; } .deck-in h2 { padding-right: 50px; } }
@media (prefers-reduced-motion: reduce) { .deck-slide, .deck-body > * { transition: none; animation: none; } }
/* Nhãn trong danh sách bài */
.ls-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; background: #FFF3E6; color: #A35D25; }
.ls-chip .ic { width: 12px; height: 12px; }
.ls-chip.q { background: var(--primary-50); color: var(--primary); }
.deck-title h1 { color: #fff; }
.deck-title .deck-in { padding-right: min(34vw, 380px); }
.deck-art { position: absolute; right: clamp(10px, 6vw, 90px); top: 50%; width: min(30vw, 340px); transform: translateY(-55%); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); animation: deckFloat 6s ease-in-out infinite; pointer-events: none; }
.deck-no { color: #EADBCB; }
@keyframes deckFloat { 50% { transform: translateY(-60%) rotate(-2deg); } }
@media (max-width: 760px) { .deck-art { display: none; } .deck-title .deck-in { padding-right: 0; } }

/* Menu điện thoại cho trang công khai */
.nav-burger { display: none; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.nav-burger .ic { width: 22px; height: 22px; }
.site-links .only-m { display: none; }
@media (max-width: 1180px) {
  .nav-burger { display: inline-flex; }
  .site-nav.open .site-links { display: flex; flex-direction: column; gap: 2px; position: absolute; top: calc(100% - 4px); left: 12px; right: 12px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 48px -24px rgba(16, 24, 40, .45); animation: navIn .18s ease-out; }
  .site-nav.open .site-links a { padding: 13px 16px; font-size: 16px; border-radius: 12px; box-shadow: none; }
  .site-nav.open .site-links .only-m { display: block; }
  .site-nav.open .site-links .m-cta { background: var(--primary); color: #fff; text-align: center; font-weight: 600; margin-top: 6px; border-radius: 999px; }
}
@keyframes navIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Chia trang danh mục khóa học */
.store-pager { justify-content: center; flex-wrap: wrap; border-top: 0; padding: 28px 0 8px; }
.store-pager a, .store-pager span { min-width: 42px; height: 42px; border-radius: 999px; background: #fff; font-weight: 600; }
.store-pager a:hover { border-color: var(--copper-600, var(--primary)); color: var(--copper-600, var(--primary)); }
.store-pager .gap { border: 0; background: none; min-width: 20px; }
.store-pager .ic { width: 18px; height: 18px; }
@media (max-width: 480px) { .store-pager { gap: 4px; } .store-pager a, .store-pager span { min-width: 36px; height: 36px; padding: 0 6px; font-size: 14px; } .store-pager .gap { min-width: 14px; } }

/* ===== Dạy học thích ứng: năng lực, nhiệm vụ, ôn tập, bản đồ nhiệt ===== */
:root { --m0: #EEF0F4; --m1: #FDE2E1; --m1-ink: #B42318; --m2: #FEF0C7; --m2-ink: #B54708; --m3: #DCFAE6; --m3-ink: #067647; --m4: #12B76A; --m4-ink: #fff; }
.mchip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--m0); color: var(--muted); }
.mchip.m1 { background: var(--m1); color: var(--m1-ink); } .mchip.m2 { background: var(--m2); color: var(--m2-ink); }
.mchip.m3 { background: var(--m3); color: var(--m3-ink); } .mchip.m4 { background: var(--m4); color: var(--m4-ink); }
.mbar { display: block; height: 8px; border-radius: 99px; background: var(--m0); overflow: hidden; min-width: 60px; }
.mbar > span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: #98A2B3; transition: width .8s var(--ease, ease); }
.mbar.m1 > span { background: #F04438; } .mbar.m2 > span { background: #F79009; } .mbar.m3 > span { background: #32D583; } .mbar.m4 > span { background: #12B76A; }
.stat-ic.mdot.m1 { background: var(--m1); color: var(--m1-ink); } .stat-ic.mdot.m2 { background: var(--m2); color: var(--m2-ink); }
.stat-ic.mdot.m3 { background: var(--m3); color: var(--m3-ink); } .stat-ic.mdot.m4 { background: var(--m4); color: #fff; }
.pring { --p: 0; width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; display: inline-grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line-2, #EEF0F4) 0); position: relative; }
.pring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.pring b { position: relative; font-size: 15px; }
.pring.sm { width: 50px; height: 50px; } .pring.sm::before { inset: 6px; } .pring.sm b { font-size: 12.5px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line-2, #EEF0F4); }
.card-foot .ic { width: 16px; height: 16px; vertical-align: -3px; }
/* Nhiệm vụ hôm nay */
.mission-list { display: grid; gap: 10px; padding: 0 20px 16px; }
.mission { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; transition: border-color .2s, transform .15s, box-shadow .2s; min-width: 0; }
.mission:hover { border-color: var(--primary); box-shadow: 0 10px 24px -18px rgba(16, 24, 40, .6); transform: translateY(-1px); }
.mission .meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mission .meta small { color: var(--muted); }
.mi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50, #EEF1FA); color: var(--primary); flex-shrink: 0; }
.mi-ic .ic { width: 20px; height: 20px; }
.mission.done { background: #F6FEF9; border-color: #ABEFC6; }
.mission.done .mi-ic { background: var(--m4); color: #fff; }
.mission.done .meta b { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
/* Bản đồ năng lực của khóa */
.skill-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 18px; }
.skill-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 8px 7px 12px; border-radius: 12px; background: var(--m0); color: var(--ink); font-size: 13.5px; border: 1px solid transparent; transition: transform .15s, border-color .2s; }
.skill-chip:hover { transform: translateY(-1px); border-color: rgba(0,0,0,.12); }
.skill-chip .sc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.skill-chip .sc-pct { font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 8px; background: rgba(255,255,255,.7); }
.skill-chip.m1 { background: var(--m1); color: var(--m1-ink); } .skill-chip.m2 { background: var(--m2); color: var(--m2-ink); }
.skill-chip.m3 { background: var(--m3); color: var(--m3-ink); } .skill-chip.m4 { background: var(--m4); color: #fff; }
.skill-chip.m4 .sc-pct { background: rgba(255,255,255,.25); }
.skill-list .list-item { gap: 12px; }
.skill-list .meta, .practice-done .meta { flex: 1; min-width: 0; }
.sk-bar, .pd-bar { width: 22%; min-width: 70px; }
/* Ôn tập thông minh */
.practice-wrap { max-width: 760px; margin: 0 auto; }
.practice-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.practice-card { padding: clamp(18px, 4vw, 30px); }
.choice.right { border-color: #12B76A; background: #ECFDF3; }
.choice.right .choice-key { background: #12B76A; border-color: #12B76A; color: #fff; }
.choice.wrong { border-color: #F04438; background: #FEF3F2; }
.choice.wrong .choice-key { background: #F04438; border-color: #F04438; color: #fff; }
.choice:has(input:disabled) { cursor: default; }
.practice-fb { margin-top: 16px; padding: 14px 16px; border-radius: 14px; line-height: 1.6; }
.practice-fb > b { display: flex; align-items: center; gap: 8px; font-size: 16.5px; margin-bottom: 4px; }
.practice-fb.ok { background: #ECFDF3; color: #05603A; } .practice-fb.no { background: #FFFAEB; color: #7A2E0E; }
.practice-fb .ic { width: 20px; height: 20px; }
.practice-done { padding: clamp(18px, 4vw, 30px); }
.pd-score { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pd-score .pring { width: 92px; height: 92px; } .pd-score .pring::before { inset: 9px; } .pd-score .pring b { font-size: 20px; }
.pd-score h1 { font-size: clamp(20px, 3vw, 26px); }
.practice-done .list-item { gap: 12px; }
/* Bản đồ nhiệt của lớp */
.skm-wrap, .table-wrap.skm-wrap { overflow-x: auto !important; padding: 4px 12px 14px; }
.skillmap { border-collapse: separate; border-spacing: 3px; width: auto; }
.skillmap tbody tr:hover { background: transparent; }
.skillmap th, .skillmap td { border: 0 !important; }
.skillmap .skm-name { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 170px; max-width: 220px; }
.skillmap thead th { background: #fff; vertical-align: bottom; }
.skm-skill { padding: 6px 2px !important; height: 150px; }
.skm-skill span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ink-2); max-height: 140px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.skm-cell { width: 44px; min-width: 44px; height: 36px; text-align: center; font-size: 12.5px; font-weight: 700; border-radius: 8px; padding: 0 !important; background: var(--m0); color: #98A2B3; cursor: default; }
.skm-cell.m1 { background: #FDA29B; color: #7A271A; } .skm-cell.m2 { background: #FEC84B; color: #7A2E0E; }
.skm-cell.m3 { background: #A6F4C5; color: #05603A; } .skm-cell.m4 { background: #12B76A; color: #fff; }
.skm-avg td { border-top: 2px solid var(--line) !important; }
.skm-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); white-space: nowrap; }
.skm-legend .skm-cell { display: inline-grid; place-items: center; width: auto; min-width: 0; height: 24px; padding: 0 8px !important; font-size: 11.5px; }
.list-item .meta small.warn-tags, .warn-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 2px; }
.warn-tags span { display: inline-flex; align-items: center; gap: 4px; color: #B42318; }
.warn-tags .ic { width: 14px; height: 14px; }
.pk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2, #EEF0F4); min-width: 0; }
@media (max-width: 640px) {
  .skill-list .list-item { flex-wrap: wrap; }
  .sk-bar, .pd-bar { order: 5; width: 100%; }
  .skill-chip .sc-name { max-width: 200px; }
  .mission-list { padding: 0 14px 14px; }
}
@media (max-width: 640px) { .skillmap .skm-name { min-width: 120px; max-width: 150px; } }

/* Ảnh đại diện */
.avatar.has-img { padding: 0; overflow: hidden; background: #fff; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar-edit { position: relative; cursor: pointer; border-radius: 50%; display: inline-flex; }
.avatar-edit .ae-ic { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 4px 10px -4px rgba(0,0,0,.4); }
.avatar-edit .ae-ic .ic { width: 15px; height: 15px; }
.avatar-edit:hover .avatar { filter: brightness(.92); }

/* ---------- Luyện thi chứng chỉ: đoạn văn / bài nghe dùng chung, câu hỏi nói ---------- */
.qsplit { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.qsplit-left { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.passage { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FBFAF7; padding: 16px 18px; }
.passage.is-audio { background: #F6F8FC; }
.passage-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; color: var(--ink-2); }
.passage-head .ic { width: 18px; height: 18px; color: var(--copper); }
.passage-body { font-size: 15.5px; line-height: 1.7; }
.passage-body p { margin: 0 0 .7em; }
.passage-review { padding: 16px 18px; border-left: 4px solid var(--copper); }
.listen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.listen-bar { flex: 1 1 140px; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.listen-bar span { display: block; height: 100%; width: 0; background: var(--copper-grad); transition: width .3s; }
.listen.playing .listen-play { animation: pulseRing 1.6s infinite; }
.listen-count { color: var(--muted); font-weight: 600; }
.listen-note { margin: 0 0 8px; display: flex; gap: 6px; align-items: flex-start; }
.listen-note .ic { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.tapescript { white-space: normal; font-size: 14.5px; line-height: 1.65; padding-top: 6px; }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(180, 112, 62, .45); } 70% { box-shadow: 0 0 0 12px rgba(180, 112, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(180, 112, 62, 0); } }
.speak-q { border: 1px dashed #D9C3B0; border-radius: var(--radius-sm); padding: 16px; background: #FFFCF9; display: flex; flex-direction: column; gap: 10px; }
.speak-rec { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.speak-meter { flex: 1 1 120px; height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.speak-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2FA36B, #E0A23B, #D0372D); transition: width .1s; }
.speak-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.speak-q.recording [data-sp-rec] { animation: pulseRec 1.2s infinite; }
@keyframes pulseRec { 0% { box-shadow: 0 0 0 0 rgba(208, 55, 45, .5); } 70% { box-shadow: 0 0 0 14px rgba(208, 55, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(208, 55, 45, 0); } }
.speak-status { color: var(--muted); }
.speak-q audio, .speak-answer-view audio { width: 100%; max-width: 460px; height: 40px; }
.speak-transcript { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; line-height: 1.6; }
.speak-transcript small { display: block; margin-bottom: 4px; }
.speak-answer-view { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.qcontent img.pic-opt, .choice-text img { max-height: 150px; border-radius: 10px; }
.part-table td:first-child { font-weight: 600; }
.pa-pick { display: grid; gap: 8px; }
@media (max-width: 1100px) {
  .qsplit { grid-template-columns: 1fr; }
  .qsplit-left { position: static; max-height: none; }
}
/* In đề / PDF */
.print-bar { margin-bottom: 14px; }
.print-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 40px; max-width: 900px; margin: 0 auto; font-size: 15px; line-height: 1.6; }
.print-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.print-title { text-align: center; font-size: 22px; margin: 16px 0 6px; }
.print-name { text-align: center; color: var(--ink-2); margin: 0 0 14px; }
.print-part { font-size: 17px; margin: 22px 0 8px; padding: 4px 10px; background: var(--line-2); border-radius: 6px; }
.print-passage { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0 12px; background: #FCFCFA; }
.print-tapescript { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.print-q { margin: 10px 0 14px; break-inside: avoid; }
.print-q .qcontent p { display: inline; }
.print-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 18px; padding-left: 18px; margin-top: 4px; }
.print-lines { height: 110px; background: repeating-linear-gradient(to bottom, transparent 0 26px, #CBD2DC 26px 27px); margin-top: 6px; }
.print-key { columns: 3; font-size: 13.5px; }
@media print {
  .no-print, .ag-fab, .adv, .bottom-nav, footer { display: none !important; }
  .main-wrap, .content { padding: 0 !important; margin: 0 !important; }
  .print-sheet { border: 0; padding: 0; max-width: none; }
  body { background: #fff; }
}
/* Phương án là tranh (Listening Part 1…): xếp ngang */
.choices:has(.choice-text > p > img.q-img:only-child), .choices:has(.choice-text > img.q-img:only-child) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choices:has(.choice-text img.q-img) .choice { flex-direction: column; align-items: center; padding: 12px; }
.choices:has(.choice-text img.q-img) .choice-text img.q-img { max-height: 130px; width: auto; margin: 0; }
.qopts:has(img.q-img) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qopts:has(img.q-img) .qopt img.q-img { max-height: 110px; }
@media (max-width: 640px) { .choices:has(.choice-text img.q-img) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .choices:has(.choice-text img.q-img) .choice { padding: 6px; } }
/* Nhiều tranh liền nhau (kể chuyện theo tranh, thảo luận theo tranh): xếp ngang */
.qcontent p:has(> img.q-img + img.q-img), .passage-body p:has(> img.q-img + img.q-img) { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.qcontent p:has(> img.q-img + img.q-img) > img.q-img { flex: 0 1 calc(33.333% - 8px); min-width: 120px; max-width: 240px; margin: 0; }
.q-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.q-imgs .q-img { flex: 0 1 calc(33.333% - 8px); min-width: 110px; max-width: 240px; margin: 0; }
.choices:has(.choice-text img.q-img) .choice-text { min-width: 0; width: 100%; display: flex; justify-content: center; }
.choices:has(.choice-text img.q-img) .choice-text img.q-img { max-width: 100%; }
@media (max-width: 640px) {
  .quiz-bar .quiz-title small { display: none; }
  .quiz-timer { padding: 0 10px; font-size: 15px; height: 38px; }
  .quiz-timer .ic { display: none; }
}
.quiz-bar > .btn, .quiz-bar > .quiz-timer, .quiz-bar > .contest-badge { flex-shrink: 0; }

/* ===== v2.8: luyện chủ điểm, tạo phiên ôn luyện, trợ giúp câu hỏi ===== */
.badge-outline { box-shadow: inset 0 0 0 1px currentColor; background: transparent; }
.scope-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.scope-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.scope-chip small { color: var(--muted-2); font-weight: 600; }
.scope-chip.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.scope-chip.on small { color: rgba(255,255,255,.7); }
.drill-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.drill-skill { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.drill-skill:hover { border-color: var(--primary-100); }
.drill-skill:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.drill-skill input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.drill-skill .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drill-skill .meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-skill .meta small { color: var(--muted); font-size: 12.5px; }
.chk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chk-chips label { position: relative; cursor: pointer; }
.chk-chips input { position: absolute; opacity: 0; }
.chk-chips span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: #fff; transition: all .15s; }
.chk-chips span small { color: var(--muted-2); font-weight: 600; }
.chk-chips input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.chk-chips input:checked + span small { color: rgba(255,255,255,.7); }
.chk-chips input:focus-visible + span { outline: 3px solid rgba(31, 37, 55, .25); }
.radio-row, .check-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 14px; line-height: 1.45; }
.radio-row input, .check-row input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.drill-count { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.drill-count > div { background: var(--line-2); border-radius: 12px; padding: 10px 8px; text-align: center; }
.drill-count b { display: block; font-size: 20px; font-weight: 800; color: var(--ink); }
.drill-count small { color: var(--muted); font-size: 11.5px; line-height: 1.3; display: block; }
.drill-count .hl { background: var(--green-50); } .drill-count .hl b { color: var(--green); }
.qhelp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.qhelp .btn.loading { opacity: .6; pointer-events: none; }
.qhelp .btn.done { color: var(--green); }
.qhelp-out { flex-basis: 100%; display: grid; gap: 8px; margin-top: 6px; }
.qhelp-item { border-radius: 12px; padding: 10px 14px; background: var(--amber-50); line-height: 1.6; font-size: 14.5px; }
.qhelp-item.translate { background: var(--primary-50); }
.qhelp-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.topic-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.topic-card h3 { font-size: 15.5px; margin: 0; line-height: 1.35; }
.topic-pts { display: flex; align-items: center; gap: 10px; }
.topic-pts .lvl { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: var(--amber-50); color: var(--amber); white-space: nowrap; }
.topic-pts .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.topic-pts .bar span { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, #F6B53F, #1E7B52); border-radius: inherit; }
.topic-pts b { font-size: 13px; white-space: nowrap; }
.topic-stats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.topic-stats span { padding: 3px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); font-weight: 600; }
.topic-stats .r { background: var(--green-50); color: var(--green); } .topic-stats .w { background: var(--red-50); color: var(--red); }
.topic-actions { display: flex; gap: 6px; margin-top: auto; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.week-dots span { font-size: 11px; color: var(--muted); font-weight: 700; }
.week-dots i { display: block; margin: 4px auto 0; width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); border: 2px solid transparent; }
.week-dots i.on { background: #F6B53F; box-shadow: inset 0 0 0 3px #FFE3A8; }
.week-dots i.today { border-color: var(--primary); }
.goal-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.goal-row .progress { flex: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.mini-stats b { display: block; font-size: 17px; } .mini-stats small { color: var(--muted); font-size: 11.5px; }
.ana-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ana-table td, .ana-table th { padding: 9px 8px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.ana-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ana-table td.num { white-space: nowrap; font-weight: 700; }
.ana-table tr.weak td:first-child b { color: var(--red); }
.ana-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.advice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--primary-50); line-height: 1.6; }
.advice .ic { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.advice.good { background: var(--green-50); } .advice.mid { background: var(--amber-50); } .advice.low { background: var(--red-50); }
.exam-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.exam-info-grid > div { background: var(--line-2); border-radius: 12px; padding: 10px; text-align: center; }
.exam-info-grid b { display: block; font-size: 18px; } .exam-info-grid small { color: var(--muted); font-size: 12px; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) {
  .drill-count b { font-size: 17px; }
  .exam-info-grid { grid-template-columns: repeat(2, 1fr); }
  .ana-table .hide-sm { display: none; }
  .drill-skills { grid-template-columns: 1fr; }
}
.text-green { color: var(--green) !important; }
.spark.tall { height: 120px; gap: 3px; }
.spark.tall span { min-width: 4px; border-radius: 4px 4px 2px 2px; }
.spark .s-good { --sc: #F6B53F; } .spark .s-none { --sc: var(--line-2); }
.stat-ic.sm { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; }
.stat-ic.sm .ic { width: 17px; height: 17px; }
details.hw-practice { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
details.hw-practice[open] { border-color: var(--primary-100); background: var(--primary-50); }
details.hw-practice > summary { list-style: none; cursor: pointer; }
details.hw-practice > summary::-webkit-details-marker { display: none; }
.goal-card { background: linear-gradient(180deg, #FFF8EB, #fff 60%); }

/* ---------- Đề tự luyện (học sinh tự tạo đề cho mọi môn) ---------- */
.lchip .badge { margin-left: 6px; height: 20px; padding: 0 7px; font-size: 11.5px; }
.lchip.active .badge { background: rgba(255,255,255,.22); color: #fff; }
.selfexam { padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; border: 1.5px solid color-mix(in srgb, var(--primary) 22%, var(--line)); }
.selfexam-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.selfexam-head small { display: block; margin-top: 2px; line-height: 1.45; }
.selfexam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.selfexam-grid .field { margin: 0; }
.selfexam-focus { grid-column: 1 / -1; }
.selfexam-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.selfexam-foot .badge { vertical-align: middle; }
.selfexam-mine { border-left: 1px solid var(--line); padding-left: 20px; min-width: 0; }
.selfexam-mine .list-item { padding: 9px 4px; }
@media (max-width: 900px) {
  .selfexam { grid-template-columns: 1fr; padding: 16px; }
  .selfexam-mine { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
}
@media (max-width: 560px) { .selfexam-grid { grid-template-columns: 1fr; } .selfexam-foot .btn { width: 100%; justify-content: center; } }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); line-height: 1.5; }
.how-list li { display: flex; gap: 8px; align-items: flex-start; }
.how-list li > svg { flex: none; margin-top: 3px; color: var(--primary); }

/* ===== Hồ sơ người học (mô hình 6 chiều) & dạy học thích ứng ===== */
.lm-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.lm-radar-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; align-items: center; padding: 6px 22px 20px; }
.radar { width: 100%; max-width: 360px; height: auto; margin: 0 auto; display: block; overflow: visible; }
.rd-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.rd-axis { stroke: var(--line); stroke-width: 1; }
.rd-shape { fill: rgba(180, 112, 62, .18); stroke: var(--copper); stroke-width: 2; stroke-linejoin: round; }
.rd-dot { fill: #fff; stroke: var(--copper); stroke-width: 2; }
.rd-lbl { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.rd-val { font-size: 12px; font-weight: 700; fill: var(--copper-600); }
.lm-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lm-legend a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; color: var(--ink); }
.lm-legend a:hover { background: var(--bg); }
.lm-legend b { display: block; font-size: 13.5px; } .lm-legend small { color: var(--muted); font-size: 12.5px; }
.lm-dot { width: 32px; height: 32px; border-radius: 10px; flex: none; display: inline-grid; place-items: center; background: var(--m0); color: var(--muted); }
.lm-dot .ic { width: 16px; height: 16px; }
.lm-dot.m1 { background: var(--m1); color: var(--m1-ink); } .lm-dot.m2 { background: var(--m2); color: var(--m2-ink); }
.lm-dot.m3 { background: var(--m3); color: var(--m3-ink); } .lm-dot.m4 { background: var(--m4); color: #fff; }
.cycle-list { list-style: none; margin: 0; padding: 4px 22px 6px; display: grid; gap: 6px; counter-reset: none; }
.cycle-list li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; position: relative; }
.cycle-list li + li::before { content: ""; position: absolute; left: 25px; top: -7px; width: 2px; height: 6px; background: var(--line); }
.cycle-list li > .ic { width: 16px; height: 16px; color: var(--muted-2); margin-left: auto; flex: none; }
.cycle-list .meta { display: flex; flex-direction: column; min-width: 0; }
.cycle-list .meta b { font-size: 13.5px; } .cycle-list .meta small { font-size: 12.5px; color: var(--muted); }
.cy-n { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; }
.cy-a .cy-n { background: #2E6FB0; } .cy-b .cy-n { background: var(--copper); } .cy-c .cy-n { background: #7A4A9C; }
.cycle-loop { display: flex; gap: 6px; align-items: center; padding: 6px 22px 18px; margin: 0; }
.cycle-loop .ic { width: 14px; height: 14px; }
.lm-dims { align-items: stretch; }
.lm-dim { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; }
.lm-dim header { display: flex; gap: 12px; align-items: center; }
.lm-dim h3 { margin: 0; font-size: 16px; }
.lm-score { font-size: 22px; font-weight: 800; padding: 2px 10px; border-radius: 10px; background: var(--m0); }
.lm-score.m1 { background: var(--m1); color: var(--m1-ink); } .lm-score.m2 { background: var(--m2); color: var(--m2-ink); }
.lm-score.m3 { background: var(--m3); color: var(--m3-ink); } .lm-score.m4 { background: var(--m4); color: #fff; }
.lm-sum { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.lm-facts { margin: 0; display: grid; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.lm-facts div { display: grid; grid-template-columns: 42% 1fr; gap: 10px; font-size: 13px; line-height: 1.45; }
.lm-facts dt { color: var(--muted); } .lm-facts dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.lm-bars, .lm-outcomes { display: grid; gap: 7px; }
.lm-bars > div, .lm-outcomes > div { display: grid; grid-template-columns: 96px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.lm-outcomes > div { grid-template-columns: minmax(0, 1fr) 90px 34px; }
.lm-bars b { text-align: right; font-size: 12.5px; } .lm-outcomes small { color: var(--muted); text-align: right; }
.lm-moods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lm-moods span { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: var(--bg); }
.lm-moods i { font-style: normal; font-size: 20px; line-height: 1.1; } .lm-moods b { font-size: 15px; } .lm-moods small { font-size: 11.5px; color: var(--muted); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head p { margin: 4px 0 0; max-width: 720px; }
.branch-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.br { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.br .ic { width: 14px; height: 14px; }
.br-content .br, .br.br-content { background: #E6F0FA; color: #1F5A93; }
.br-task .br, .br.br-task { background: var(--copper-50); color: var(--copper-600); }
.br-support .br, .br.br-support { background: #F1E9F7; color: #6A3D8A; }
.br.ic-only { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; flex: none; }
.br.ic-only .ic { width: 16px; height: 16px; }
.need-list { display: grid; gap: 14px; }
.need { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 18px; padding: 18px 20px; }
.need-main h3 { margin: 10px 0 4px; font-size: 16px; } .need-main p { margin: 0; }
.dim-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 6px; }
.dim-tag .ic { width: 14px; height: 14px; }
.need-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.opt > b { font-size: 14px; line-height: 1.4; }
.opt-edit { width: 100%; } .opt-edit > summary { list-style: none; } .opt-edit > summary::-webkit-details-marker { display: none; }
.opt-edit[open] > summary { margin-bottom: 10px; }
.opt-edit form { display: grid; gap: 10px; }
.opt-edit textarea { min-height: 76px !important; }
.custom-plan > summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.custom-plan > summary::-webkit-details-marker { display: none; }
.custom-plan > summary .ic { width: 18px; height: 18px; }
.adapt-list .list-item { align-items: flex-start; }
.adapt-list .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adapt-list .meta small { color: var(--muted); font-size: 12.5px; }
.adapt-msg { color: var(--ink-2) !important; background: var(--bg); padding: 6px 10px; border-radius: 8px; margin-top: 2px; line-height: 1.45; }
.adapt-stat { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.adapt.closed { opacity: .65; }
.effect { white-space: nowrap; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.effect.up { background: var(--green-50); color: var(--green); } .effect.down { background: var(--red-50); color: var(--red-600); }
.mood-ic { font-size: 22px; width: 34px; text-align: center; flex: none; }
.checkin { padding: 16px 18px; display: grid; gap: 12px; }
.checkin-q b { display: block; } .checkin-q small { font-size: 12.5px; }
.checkin-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.checkin-row.sm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mood-opt { position: relative; cursor: pointer; }
.mood-opt input, .chip-opt input { position: absolute; opacity: 0; }
.mood-opt span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); background: #fff; transition: all .15s; text-align: center; }
.mood-opt i { font-style: normal; font-size: 24px; line-height: 1.15; }
.mood-opt:hover span { border-color: var(--muted-2); }
.mood-opt input:checked + span { border-color: var(--copper); background: var(--copper-50); color: var(--copper-600); }
.mood-opt input:focus-visible + span, .chip-opt input:focus-visible + span { outline: 3px solid rgba(150, 90, 50, .3); }
.chip-opt { position: relative; cursor: pointer; }
.chip-opt span { display: inline-flex; height: 30px; align-items: center; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; }
.chip-opt input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.checkin-row.sm .btn { margin-left: auto; }
.checkin-done { margin: 0; color: var(--green); display: flex; gap: 6px; align-items: center; }
.checkin-done .ic { width: 16px; height: 16px; }
.survey { display: grid; gap: 18px; }
.sv-q { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.sv-q legend { font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.sv-q .chip span { height: auto; min-height: 36px; padding: 6px 12px; }
.lm-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.lm-link .ic { width: 14px; height: 14px; }
@media (max-width: 1100px) { .lm-top { grid-template-columns: 1fr; } .need { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .lm-dims.g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .lm-radar-body { grid-template-columns: 1fr; padding: 0 14px 16px; }
  .lm-dims.g-3 { grid-template-columns: 1fr; }
  .lm-facts div { grid-template-columns: 1fr; gap: 2px; }
  .checkin-row { grid-template-columns: repeat(2, 1fr); }
  .need { padding: 16px; }
  .cycle-list { padding: 4px 14px 6px; }
}

/* ===== Dạy trực tuyến: lịch học, phòng học ===== */
.stack-form { display: grid; gap: 14px; }
.input-sm { height: 38px !important; padding: 0 10px !important; font-size: 13.5px; }
.sched-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sched-week { font-size: 15px; }
.sched-filter { width: auto; min-width: 200px; height: 40px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.wday { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.wday.today { border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-50); }
.wday-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.wday-head b { font-size: 14px; } .wday-head span { color: var(--muted); font-size: 12.5px; }
.wday-head em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--copper-600); margin-left: auto; }
.wday-none { color: var(--muted-2); font-size: 12px; margin-top: auto; margin-bottom: auto; text-align: center; }
.sess { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: 10px; background: var(--bg); border-left: 4px solid var(--c, var(--primary)); color: var(--ink); transition: transform .15s, box-shadow .15s; }
.sess:hover { color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); background: #fff; }
.sess b { font-size: 13px; line-height: 1.35; } .sess small { font-size: 11.5px; color: var(--muted); }
.sess-time { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.sess-foot .badge { font-size: 11px; }
.sess.st-cancelled { opacity: .55; } .sess.st-cancelled b { text-decoration: line-through; }
.plan-form { display: grid; gap: 16px; }
.live-now { margin-top: 16px; }
.live-pulse { position: relative; }
.live-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--red); animation: livePulse 1.6s ease-out infinite; }
@keyframes livePulse { from { opacity: .9; transform: scale(.9); } to { opacity: 0; transform: scale(1.25); } }
.live-card .list-item { gap: 12px; }
.live-date { width: 44px; height: 46px; flex: none; border-radius: 12px; background: var(--copper-50); color: var(--copper-600); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.live-date b { font-size: 17px; } .live-date small { font-size: 11px; font-weight: 700; }
.live-go { box-shadow: 0 8px 18px -10px rgba(208, 55, 45, .9); }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.live-stage { position: relative; background: #11141C; border-radius: 18px; overflow: hidden; min-height: 460px; height: min(72vh, 760px); display: flex; }
.live-stage.in-call { box-shadow: var(--shadow-lg); }
.live-pre { margin: auto; text-align: center; color: #fff; padding: 30px 22px; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.live-pre h2 { color: #fff; margin: 4px 0 0; } .live-pre .muted { color: #B8C0CE !important; }
.live-pre-ic, .live-wait-ic { width: 64px; height: 64px; border-radius: 20px; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .08); color: #fff; }
.live-pre-ic .ic, .live-wait-ic .ic { width: 30px; height: 30px; }
.live-frame { position: absolute; inset: 0; } .live-frame iframe { border: 0; width: 100%; height: 100%; }
.live-wait { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.live-wait .live-wait-ic { background: var(--copper-50); color: var(--copper-600); }
.live-wait h2 { margin: 8px 0 0; }
.live-wait [data-countdown] { color: var(--copper-600); font-variant-numeric: tabular-nums; }
.av-wrap { position: relative; flex: none; display: inline-flex; }
.on-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #C5CAD3; border: 2px solid #fff; }
.on-dot.on { background: #12B76A; }
.brief-list .list-item { align-items: flex-start; padding: 12px 18px; }
.brief-list .warn-tags { flex-wrap: wrap; }
.live-edit > summary { display: flex; gap: 8px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
.live-edit > summary::-webkit-details-marker { display: none; }
.live-edit > summary .ic { width: 16px; height: 16px; }
.att-table textarea { min-height: 54px !important; height: auto; padding: 8px 10px; resize: vertical; font-size: 13.5px; }
.att-table td { vertical-align: top; }
.live-report .card-foot { justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.live-log .log-block { margin-bottom: 14px; }
.live-log .log-block b { display: flex; gap: 6px; align-items: center; } .live-log .log-block b .ic { width: 16px; height: 16px; }
.live-log .log-block p { margin: 6px 0 0; line-height: 1.6; }
.log-me { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log-me .adapt-msg { width: 100%; margin: 4px 0 0; }
@media (max-width: 1100px) { .live-layout { grid-template-columns: 1fr; } .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .week-grid { grid-template-columns: 1fr; }
  .wday { min-height: 0; }
  .wday.empty { display: none; }
  .live-stage { height: 78vh; min-height: 420px; border-radius: 14px; }
  .sched-filter { width: 100%; }
}
.live-help { background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.live-help summary { cursor: pointer; }
.live-help ol { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.live-fs { position: absolute; right: 12px; top: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 0; background: rgba(17, 20, 28, .72); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.live-fs:hover { background: rgba(17, 20, 28, .9); }
.live-fs .ic { width: 15px; height: 15px; }
.live-stage:fullscreen { border-radius: 0; height: 100vh; }
.live-stage.live-max { position: fixed; inset: 0; z-index: 1000; height: 100dvh; border-radius: 0; }
.live-call b { display: flex; gap: 6px; align-items: center; } .live-call b .ic { width: 16px; height: 16px; }
.live-call p { margin: 6px 0 10px; }
.sess { position: relative; }
.sess-link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.sess > :not(.sess-link) { position: relative; z-index: 1; pointer-events: none; }
.sess > .sess-acts { pointer-events: auto; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; margin-top: 2px; border-top: 1px dashed var(--line); padding-top: 4px; }
.sess-acts form { display: inline-flex; margin: 0; }
.sess-acts .btn-icon { width: 30px; height: 30px; }
.sess-acts .btn-icon .ic { width: 15px; height: 15px; }
.sess-acts [title="Xóa buổi"]:hover, .sess-all:hover { color: var(--red); }
.sess-all { height: 30px; padding: 0 8px; font-size: 11.5px; }
.live-del { text-align: center; }
/* Cảm xúc tự nhận biết */
.checkin-q { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.af-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.af-d { aspect-ratio: 1; border-radius: 6px; background: var(--bg); display: grid; place-items: center; font-size: 13px; line-height: 1; border: 1px solid var(--line-2); }
.af-d.af-good { background: var(--green-50); border-color: transparent; }
.af-d.af-ok { background: #F1F5F9; border-color: transparent; }
.af-d.af-warn { background: #FFF4E5; border-color: transparent; }
.af-d.af-bad { background: var(--red-50); border-color: transparent; }
.af-cap { display: block; margin-top: 5px; font-size: 11.5px; }
.af-ev { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.af-ev li { font-size: 12.8px; line-height: 1.45; padding-left: 14px; position: relative; color: var(--ink-2); }
.af-ev li::before { content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.af-ev li.af-good::before { background: var(--green); } .af-ev li.af-warn::before { background: #E8A13A; } .af-ev li.af-bad::before { background: var(--red); }
.af-moods { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 640px) { .af-moods { grid-template-columns: repeat(3, 1fr); } }

/* ===== Tình hình học sinh (care) ===== */
.care-stat { text-decoration: none; color: inherit; align-items: center; border: 1.5px solid transparent; transition: border-color .2s, transform .2s var(--ease); }
.care-stat:hover { transform: translateY(-1px); }
.care-stat b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.care-stat small { color: var(--muted); font-size: 13.5px; }
.care-dot { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--bg); color: var(--primary); }
.care-dot::before { content: ""; width: 12px; height: 12px; border-radius: 99px; background: currentColor; }
.care-dot:has(.ic)::before { display: none; }
.care-stat-red .care-dot { background: var(--red-50); color: var(--red); }
.care-stat-amber .care-dot { background: var(--amber-50); color: #D97706; }
.care-stat-green .care-dot { background: var(--green-50); color: var(--green); }
.care-stat-cared .care-dot { background: var(--copper-50); color: var(--copper); }
.care-stat.on { border-color: currentColor; }
.care-stat-red.on { border-color: var(--red); } .care-stat-amber.on { border-color: #D97706; } .care-stat-green.on { border-color: var(--green); }
.care-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.care-chips .pill { text-decoration: none; }
.care-chips .pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.care-list { display: grid; gap: 12px; }
.care-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.6fr) minmax(200px, 1fr); gap: 18px; padding: 16px 18px; align-items: start; border-left: 4px solid var(--line); scroll-margin-top: 90px; }
.care-row.care-red { border-left-color: var(--red); }
.care-row.care-amber { border-left-color: #F0A93B; }
.care-row.care-green { border-left-color: #7CC6A0; }
.care-row:target { box-shadow: 0 0 0 3px rgba(208, 55, 45, .18), var(--shadow-sm); }
.care-who { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.care-who .badge { margin-left: 52px; }
.care-name { font-weight: 700; color: var(--ink); text-decoration: none; display: block; }
.care-name:hover { color: var(--red); }
.care-who small { display: block; }
.care-mood { display: flex; gap: 10px; align-items: flex-start; }
.care-emo { font-size: 28px; line-height: 1; width: 40px; text-align: center; flex-shrink: 0; }
.care-mood b { font-size: 14.5px; }
.care-mood > div { flex: 1; min-width: 0; }
.af-strip.sm { gap: 2px; margin-top: 6px; width: 100%; max-width: 200px; grid-template-columns: repeat(14, minmax(0, 1fr)); }
.af-strip.sm .af-d { font-size: 8.5px; border-radius: 4px; }
.care-why ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.care-why li + li { margin-top: 2px; }
.care-tip { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--copper-50); color: #6B3F1F; font-size: 13.5px; line-height: 1.5; }
.care-tip .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--copper); }
.care-act { display: grid; gap: 8px; }
.care-last { display: flex; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--green-50); color: var(--ink-2); line-height: 1.45; }
.care-last .ic { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.care-form > summary { list-style: none; width: 100%; justify-content: center; }
.care-form > summary::-webkit-details-marker { display: none; }
.care-form[open] > summary { display: none; }
.care-form form { display: grid; gap: 8px; }
.care-kinds { display: grid; gap: 4px; }
.care-kinds label { position: relative; }
.care-kinds input { position: absolute; opacity: 0; }
.care-kinds span { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.care-kinds span .ic { width: 15px; height: 15px; color: var(--muted); }
.care-kinds input:checked + span { border-color: var(--primary); background: var(--primary-50); font-weight: 600; }
.care-kinds input:focus-visible + span { outline: 3px solid rgba(37, 42, 61, .3); }
.care-form textarea { font-size: 14px; }
.care-links { gap: 6px; }
.care-links .btn { flex: 1; justify-content: center; }
.care-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.care-sum a { text-decoration: none; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--bg); color: var(--ink); }
.care-sum a b { display: block; font-size: 22px; line-height: 1.1; }
.care-sum a small { color: var(--muted); font-size: 12.5px; }
.care-sum .care-sum-red { background: var(--red-50); } .care-sum .care-sum-red b { color: var(--red); }
.care-sum .care-sum-amber { background: var(--amber-50); } .care-sum .care-sum-amber b { color: #B45309; }
.care-sum .care-sum-green { background: var(--green-50); } .care-sum .care-sum-green b { color: var(--green); }
@media (max-width: 1180px) { .care-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .care-row { grid-template-columns: 1fr; gap: 12px; padding: 14px; } .care-who .badge { margin-left: 0; } }

/* ===== Bài lập trình: ví dụ, giải thích lỗi, so sánh kết quả ===== */
.code-ex { display: grid; gap: 8px; padding: 10px 12px; background: #FBFCFD; border-bottom: 1px solid var(--line); }
.code-ex-item { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.code-ex-item small { color: var(--muted); font-size: 12px; font-weight: 600; }
.code-ex-item pre { margin: 4px 0 0; padding: 7px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); font: 13px/1.5 Consolas, 'Courier New', monospace; white-space: pre-wrap; min-height: 34px; }
.code-ex-arrow { align-self: center; color: var(--muted); font-size: 18px; padding-top: 16px; }
.code-err { display: grid; gap: 2px; padding: 10px 14px; background: #FEF2F2; border-top: 1px solid #FBD5D5; color: #7F1D1D; font-size: 14px; line-height: 1.5; }
.code-err b { color: #B91C1C; }
.code-err[hidden] { display: none; }
.cm-errline { background: #FEE2E2 !important; }
.code-bar kbd { font: 600 10.5px/1 ui-monospace, Consolas, monospace; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line); background: #F7F8FA; color: var(--muted); margin-left: 2px; }
.ct-got pre .ln-bad { background: #FEE2E2; color: #991B1B; display: inline-block; min-width: 100%; }
.ct-got pre .ln-miss { color: #B45309; font-style: italic; }
.ct-got pre .ln-err { color: #B91C1C; }
.ct-hint { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: 8px; background: #FFF7E6; color: #7A4A0C; font-size: 13.5px; line-height: 1.5; }
.ct-hint[hidden] { display: none; }
@media (max-width: 640px) { .code-ex-item { grid-template-columns: 1fr; } .code-ex-arrow { display: none; } }

/* ===== 10 hành vi học tập ===== */
.bh-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.bh-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; display: grid; gap: 6px; align-content: start; }
.bh-top { display: flex; gap: 8px; align-items: flex-start; }
.bh-top b { flex: 1; font-size: 13.5px; line-height: 1.3; }
.bh-ic { font-size: 20px; line-height: 1; }
.bh-sc { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.bh-bar { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.bh-bar i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.bh-good .bh-bar i { background: #16A34A; } .bh-good .bh-sc { color: #16704A; }
.bh-ok .bh-bar i { background: #2563EB; } .bh-ok .bh-sc { color: #2457C5; }
.bh-warn .bh-bar i { background: #D97706; } .bh-warn .bh-sc { color: #A15C07; }
.bh-bad .bh-bar i { background: #DC2626; } .bh-bad .bh-sc { color: #BE123C; }
.bh-none { background: #FAFBFC; } .bh-none .bh-sc { color: var(--muted); }
.bh-val { font-size: 13px; font-weight: 600; }
.bh-lv { font-weight: 500; color: var(--muted); font-size: 12px; }
.bh-item small { color: var(--muted); font-size: 12px; line-height: 1.4; }
@media (max-width: 1180px) { .bh-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .bh-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Phiếu tự đánh giá (Phiếu A) ---------- */
.sv-intro p { color: var(--ink-2); line-height: 1.6; }
.sv-progress { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; margin-bottom: 12px; font-size: 14px; }
.sv-pbar { flex: 1; height: 8px; border-radius: 9px; background: var(--line-2); overflow: hidden; }
.sv-pbar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .25s var(--ease); }
.sv-sec .card-title { margin-bottom: 6px; }
.sv-legend { margin: 0 0 8px; }
.sv-desc { background: var(--copper-50); border-radius: var(--radius-sm); padding: 12px 14px; margin: 6px 0 12px; font-size: 14px; }
.sv-desc p { margin: 6px 0 0; line-height: 1.6; color: var(--ink-2); }
.sv-q { padding: 12px 0; border-top: 1px solid var(--line-2); }
.sv-q:first-of-type { border-top: 0; }
.sv-q.miss { background: var(--red-50); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; }
.sv-q.done .sv-no { background: var(--green); color: #fff; }
.sv-qt { margin: 0 0 8px; line-height: 1.55; font-weight: 500; }
.sv-no { display: inline-block; min-width: 34px; padding: 1px 7px; margin-right: 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 700; text-align: center; }
.sv-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sv-opts.has-na { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .9fr); }
.sv-opts label, .sv-chips label { cursor: pointer; }
.sv-opts input, .sv-chips input { position: absolute; opacity: 0; pointer-events: none; }
.sv-opts span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; transition: .15s; height: 100%; }
.sv-opts span b { font-size: 15px; }
.sv-opts span small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.sv-opts label:hover span, .sv-chips label:hover span { border-color: var(--primary); }
.sv-opts input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.sv-opts input:checked + span small { color: rgba(255,255,255,.85); }
.sv-opts input:focus-visible + span, .sv-chips input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.sv-na span { border-style: dashed; }
.sv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-chips span { display: inline-block; padding: 7px 13px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; transition: .15s; }
.sv-chips input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.sv-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 18px 0 8px; }
.sv-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.sv-wave.done { border-left: 4px solid var(--green); }
.sv-wave.open { border-left: 4px solid var(--amber); }
.sv-wave .btn { margin-top: 4px; }
.sv-banner { display: flex; align-items: center; gap: 14px; border-left: 4px solid var(--copper); }
.sv-banner-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--copper-50); color: var(--copper-600); flex: none; }
.sv-alerts { display: grid; gap: 10px; }
.sv-alert { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.sv-alert p { margin: 4px 0 0; }
.sv-al-bad { border-left-color: #DC2626; background: #FEF6F6; }
.sv-al-warn { border-left-color: #D97706; background: #FFFBF2; }
.sv-al-info { border-left-color: #2563EB; }
.sv-al-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sv-al-br { margin-left: auto; font-size: 12px; color: var(--muted); }
.sv-b-bad { background: #FDE2E4; color: #B42318; }
.sv-b-warn { background: #FEF0C7; color: #93370D; }
.sv-b-info { background: #E6EEFB; color: #2457C5; }
.sv-al-tip { display: flex; gap: 8px; font-size: 14px; }
.sv-al-tip .ic { flex: none; width: 16px; height: 16px; color: var(--copper-600); margin-top: 3px; }
.sv-groups { display: grid; gap: 12px; }
.sv-group h3, .sv-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 4px 0 6px; }
.sv-sc { width: 100%; border-collapse: collapse; font-size: 14px; }
.sv-sc td { padding: 5px 0; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.sv-sc td:last-child { text-align: right; white-space: nowrap; }
.sv-bar { display: inline-block; width: 90px; height: 7px; border-radius: 9px; background: var(--line-2); overflow: hidden; vertical-align: middle; }
.sv-bar i { display: block; height: 100%; background: #16A34A; }
.sv-ok i { background: #2563EB; } .sv-warn i { background: #D97706; } .sv-bad i { background: #DC2626; }
.sv-t-good { color: #16704A; } .sv-t-ok { color: #2457C5; } .sv-t-warn { color: #A15C07; } .sv-t-bad { color: #BE123C; }
.sv-prefs { margin: 4px 0 0; padding-left: 18px; } .sv-prefs li { margin: 3px 0; }
@media (max-width: 720px) {
  .sv-opts, .sv-opts.has-na { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sv-opts .sv-na { grid-column: 1 / -1; }
  .sv-opts span small { display: none; }
  .sv-opts span { padding: 9px 2px; }
  .sv-banner { flex-wrap: wrap; }
}
.sv-more summary { list-style: none; } .sv-more summary::-webkit-details-marker { display: none; } .sv-more[open] summary { margin-bottom: 10px; }
.uni-side .inner { max-width: 520px; }
.uni-side h2 { font-size: 30px; line-height: 1.25; }
.uni-kicker { display: inline-flex; gap: 8px; align-items: center; color: #E9B98F; font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; }
.uni-kicker .ic { width: 16px; height: 16px; }
.uni-steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.uni-steps li { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; color: #E6E9F0; font-weight: 600; }
.uni-steps span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #E9B98F; color: #1F2537; font-weight: 800; flex: none; }
.uni-art { width: min(560px, 92%); animation: none; }
.uni-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.uni-points li { display: flex; gap: 10px; align-items: center; color: #E6E9F0; font-weight: 600; font-size: 15px; }
.uni-points .ic { width: 18px; height: 18px; color: #E9B98F; flex: none; }

/* Ô chọn chưa gắn lớp CSS (bộ lọc trên các trang): cùng kiểu với .select-sm; :where() để mọi quy tắc khác vẫn ghi đè được */
:where(select:not([class]):not(.field select)) { height: 44px; max-width: 100%; padding: 0 38px 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23586174' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; outline: none; font: inherit; color: var(--ink); cursor: pointer; }
:where(select:not([class]):not(.field select)):focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 42, 61, .12); }
/* Menu thả xuống khi đóng không được chiếm chỗ: tránh trang dài thêm (cuộn mãi không hết) vì header dính kéo menu ẩn đi theo */
.dropdown:not(.open) .dropdown-menu { max-height: 0 !important; overflow: hidden; }
.notif-menu { max-height: min(560px, calc(100vh - 96px)); overflow-y: auto; }

/* Thư mục câu hỏi */
.qset-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.qset-bar-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.qset-bar-label .ic { width: 18px; height: 18px; }
.qset-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; transition: border-color .15s, background .15s; max-width: 100%; }
.qset-chip .ic { width: 16px; height: 16px; color: #C07A48; flex-shrink: 0; }
.qset-chip small { background: var(--line-2); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.qset-chip:hover { border-color: var(--primary); color: var(--primary); }
.qset-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.qset-chip.on .ic { color: #E9B98F; }
.qset-chip.on small { background: rgba(255,255,255,.18); color: #fff; }
.qset-chip.qset-add { border-style: dashed; color: var(--muted); }
.qset-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 12px; flex-wrap: wrap; }
.qset-head .grow { min-width: 220px; }
.qset-head b { display: block; font-size: 17px; }
.qset-head-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #FBF1E8; color: #B4703E; flex-shrink: 0; }
.qset-head-ic .ic { width: 22px; height: 22px; }
.qset-menu { position: relative; }
.qset-menu > summary { list-style: none; cursor: pointer; }
.qset-menu > summary::-webkit-details-marker { display: none; }
.qset-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(460px, 86vw); z-index: 30; box-shadow: var(--shadow-lg, 0 18px 40px rgba(20,24,40,.16)); }
.qset-badge { text-decoration: none; background: #FBF1E8; color: #8E5129; }
.qset-badge .ic { width: 13px; height: 13px; }
.qset-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-2); background: #FFFBF7; }
.qset-tools .qset-ic { color: #B4703E; display: inline-flex; }
.qset-tools .select-sm { height: 40px; flex: 1 1 240px; max-width: 420px; }
.qpick.qset-off { display: none; }
.qpick-ans { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 13px; color: var(--green-700, #15803D); }
.qpick-ans .ic { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }

/* Lịch học: lịch nháp chưa báo học sinh */
.draft-box { padding: 6px 0; border: 1.5px dashed #D9A36F; background: #FFFBF6; }
.draft-head { display: flex; gap: 12px; align-items: center; padding: 10px 18px; }
.draft-head b { display: block; }
.draft-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #FBEBDC; color: #B4703E; flex-shrink: 0; }
.draft-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid #F1E2D3; }
.draft-row .grow { min-width: 200px; }
.sess.draft { border-style: dashed !important; border-color: #D9A36F !important; background: #FFFBF6; }
.plan-acts { gap: 10px; flex-wrap: wrap; }
.live-draft { align-items: center; margin-bottom: 14px; background: #FFF6EC; color: #7A4A22; }
.live-draft form { margin: 0; }
/* Màn hình hẹp: ô chọn, bảng điểm thang đo không tràn ngang */
.select-sm { max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .page-actions .row, .page-actions form { min-width: 0; max-width: 100%; }
  .sv-sc { table-layout: fixed; width: 100%; }
  .sv-sc td:first-child { width: 42%; word-break: break-word; }
  .sv-sc .sv-bar { max-width: 100%; }
  .sv-sc td:last-child { white-space: normal; }
  .page-actions { max-width: 100%; flex-wrap: wrap; }
  .page-actions .select-sm { width: 100%; }
}
.seg-3 { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg-3 span { justify-content: center; padding: 0 6px; gap: 6px; white-space: nowrap; }
@media (max-width: 480px) { .seg-3 span .ic { display: none; } }

/* Xếp lớp theo cấp độ */
.lvmap { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; }
.lvmap-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface, #fff); }
.lvmap-row .badge { min-width: 86px; justify-content: center; }
.placed-card { border-left: 4px solid var(--lvc, var(--primary)); }
.move-form .select-sm { max-width: 150px; }
.level-board .card-head { flex-wrap: wrap; gap: 10px; }
.lvb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 0 18px 18px; }
@media (max-width: 1100px) { .lvb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lvb-grid { grid-template-columns: 1fr; } }
.lvb-col { --c: var(--lv-kha); display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); border-top: 5px solid var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, #fff), #fff 55%); }
.lvb-gioi { --c: var(--lv-gioi); } .lvb-kha { --c: var(--lv-kha); } .lvb-tb { --c: var(--lv-tb); } .lvb-yeu { --c: var(--lv-yeu); }
.lvb-col.empty { opacity: .7; }
.lvb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lvb-name { font-weight: 700; color: var(--ink); line-height: 1.35; }
.lvb-num { display: flex; align-items: baseline; gap: 6px; } .lvb-num b { font-size: 30px; line-height: 1; color: var(--c); } .lvb-num span { color: var(--muted); font-size: 13px; }
.lvb-stats { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); } .lvb-stats b { color: var(--ink); }
.lvb-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.lv-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lv-sw { --c: var(--lv-kha); display: flex; flex-direction: column; padding: 8px 16px; border-radius: 12px; border: 1.5px solid var(--line); border-left: 5px solid var(--c); background: #fff; color: var(--ink); min-width: 120px; }
.lv-sw small { color: var(--muted); } .lv-sw.on { background: color-mix(in srgb, var(--c) 12%, #fff); border-color: var(--c); }
.lv-switch .btn:first-of-type { margin-left: auto; }
.lv-sw.lvb-gioi { --c: var(--lv-gioi); } .lv-sw.lvb-kha { --c: var(--lv-kha); } .lv-sw.lvb-tb { --c: var(--lv-tb); } .lv-sw.lvb-yeu { --c: var(--lv-yeu); }
.lvb-col .pct-row { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.lvb-col .pct-row b { color: var(--ink); }
/* Thẻ học phần chia cấp độ + trang cấp độ */
.subj-card .lvdist { height: 22px; }
.subj-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); } .subj-legend span { display: inline-flex; align-items: center; gap: 5px; } .subj-legend b { color: var(--ink); }
.subj-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lvh-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; } .lvh-head .grow { min-width: 260px; } .lvh-note { flex-basis: 100%; margin: 0; }
.lvh-head .lvdist a { color: #fff; text-decoration: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; }
.lvk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .lvk { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .lvk { grid-template-columns: 1fr; } }
.lvk-col { --c: var(--lv-kha); background: #fff; border: 1px solid var(--line-2); border-top: 6px solid var(--c); border-radius: 16px; box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); scroll-margin-top: 90px; overflow: hidden; }
.lvk-head { padding: 14px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, #fff), #fff); border-bottom: 1px solid var(--line-2); }
.lvk-name { font-weight: 800; color: var(--ink); line-height: 1.3; }
.lvk-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); } .lvk-nums b { color: var(--c); font-size: 17px; }
.lvk-hw { display: flex; gap: 6px; align-items: center; padding: 7px 9px; border-radius: 9px; background: #fff; border: 1px dashed color-mix(in srgb, var(--c) 45%, #fff); color: var(--ink); }
.lvk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lvk-list { max-height: 560px; overflow: auto; }
.lvk-st { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); } .lvk-st:last-child { border-bottom: 0; }
.lvk-st:hover { background: color-mix(in srgb, var(--c) 5%, #fff); }
.lvk-st-name { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.lvk-st-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvk-st-meta .t-green { color: var(--green, #1C7C54); } .lvk-st-meta .t-red, .t-red { color: var(--red, #C0392B); }
.lvk-move select { width: 46px; height: 30px; padding: 0 4px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.lvk-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.lvk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 30px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.lvk-chip input { margin: 0 2px 0 6px; }
.lvk-actions { flex-wrap: nowrap; } .lvk-actions .btn { padding-inline: 10px; } .lvk-actions .btn:first-child { flex: 1; justify-content: center; }
.lvk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .lvk-actions .btn { padding-inline: 8px; justify-content: center; white-space: nowrap; }
.lvk-open { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; } .lvk-open:hover { color: var(--ink); }
.lvk-actions .btn { font-size: 13px; gap: 5px; padding-inline: 6px; } .lvk-actions .btn svg { width: 15px; height: 15px; }
/* Đề kiểm tra theo cấp độ */
.lvq { margin: 14px 18px 0; padding: 12px 14px; border-radius: 12px; background: var(--bg-2, #F6F7F9); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.lvq-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .lvq-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lvq-it { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 10px; border-radius: 10px; background: #fff; border-left: 4px solid var(--c); font-size: 13px; }
.lvq-it b { font-size: 17px; color: var(--c); } .lvq-it small { flex-basis: 100%; color: var(--muted); }
.lvk-mode { color: var(--muted); line-height: 1.4; } .lvk-mode .ic { vertical-align: -2px; } .lvk-mode b { color: var(--c); }

/* ---------- Thời gian khóa học & giấy chứng nhận ---------- */
.term-card .card-title{margin:0}
.term-quick{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:-4px 0 4px}
.term-chip{height:28px;padding:0 10px;border-radius:999px;border:1.5px solid var(--line);background:#fff;font:600 12.5px/1 inherit;color:var(--ink-2);cursor:pointer;transition:all .15s}
.term-chip:hover{border-color:var(--copper);color:var(--copper-600);background:var(--copper-50)}
.term-stat{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:4px}
.term-stat a{display:flex;flex-direction:column;align-items:center;padding:10px 6px;border-radius:12px;background:var(--bg);color:inherit;text-decoration:none;text-align:center}
.term-stat a:hover{background:var(--primary-50)}
.term-stat b{font-size:17px;color:var(--primary)}
.term-stat span{font-size:12px;color:var(--muted)}
.course-term{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:14px;color:var(--ink-2)}
.course-term .ic{color:var(--copper)}
.course-hero .course-term{color:rgba(255,255,255,.78)}
.course-hero .course-term b{color:#fff}
.cert-status{display:flex;gap:18px;align-items:center;padding:20px 24px;flex-wrap:wrap;border:1.5px solid #ecd9a8;background:linear-gradient(120deg,#fffaf0 0%,#fff 60%)}
.cert-status h2{margin:0;font-size:18px}
.cert-status p{margin:4px 0 0}
.cert-status-ic{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;flex:none;color:#fff;
  background:radial-gradient(circle at 35% 30%,#f8e08e,#c99a2e 55%,#8a6416);box-shadow:0 0 0 4px #fff4d6,0 6px 14px rgba(138,100,22,.35)}
.cert-status-ic .ic{width:28px;height:28px}
.cert-status.is-closed{border-color:var(--line);background:#fff}
.cert-status.is-closed .cert-status-ic{background:radial-gradient(circle at 35% 30%,#e9edf3,#9aa4b2 60%,#5b6470);box-shadow:0 0 0 4px var(--line-2)}
.cert-mini{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.cert-mini span{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border-radius:999px;background:var(--bg);font-size:12.5px;color:var(--ink-2)}
.cert-mini span.ok{background:var(--green-50);color:var(--green)}
.cert-mini .ic{width:14px;height:14px}
.cert-grid{align-items:start}
.cert-card{padding:14px;overflow:hidden}
.cert-card-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px}
.cert-card-foot small{display:block}
.cert-track{display:block;color:inherit;text-decoration:none}
.cert-checks{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.cert-checks li{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--ink-2)}
.cert-checks li .ic{color:var(--amber)}
.cert-checks li.ok .ic{color:var(--green)}
.cert-dist{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.cert-dist .cd{position:relative;display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;background:var(--bg);overflow:hidden}
.cert-dist .cd b{font-size:18px;position:relative}
.cert-dist .cd .badge{position:relative}
.cert-dist .cd i{position:absolute;left:0;bottom:0;height:4px;width:var(--w);background:var(--copper-grad)}
.cert-why{display:block;color:var(--red-600);font-size:12px;margin-top:2px}
.cert-table .cert-score{font-size:15px;color:var(--primary)}
.d-block{display:block}

/* ---------- Ngân hàng câu hỏi: thanh mức độ nhận thức ---------- */
.cogbar{margin-bottom:14px}
.cogbar-top{display:flex;gap:14px;justify-content:space-between;align-items:flex-start;flex-wrap:wrap}
.cogbar-bar{display:flex;height:34px;border-radius:10px;overflow:hidden;margin-top:12px;gap:2px}
.cogbar-bar a{display:flex;align-items:center;justify-content:center;min-width:26px;color:#fff;text-decoration:none;font-size:12.5px;font-weight:700;white-space:nowrap;overflow:hidden}
.cogbar-bar a span{overflow:hidden;text-overflow:ellipsis;padding:0 6px}
.cb-nb{background:#2563EB}.cb-th{background:#0F9F95}.cb-vd{background:#D97706}.cb-vdc{background:#B91C1C}.cb-none{background:#9CA3AF}
.mix-topics{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px;max-height:260px;overflow:auto;padding:2px}
.mix-topic{display:flex;gap:8px;align-items:flex-start;padding:9px 11px;border:1.5px solid var(--line);border-radius:12px;cursor:pointer;background:#fff}
.mix-topic:has(input:checked){border-color:var(--primary);background:var(--primary-50)}
.mix-topic span{display:flex;flex-direction:column}.mix-topic small{color:var(--muted);font-size:11.5px}
.mix-n{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 12px}
.mix-n label{display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:12px;background:var(--bg)}
.mix-n input{width:62px;height:32px}
.mix-table td,.mix-table th{padding:6px 4px}
.mix-in{width:44px;height:30px;text-align:center;padding:0 2px!important}
.mix-bar-row td{padding-top:0!important;border-top:0!important}
.mix-bar{display:flex;height:6px;border-radius:4px;overflow:hidden;gap:2px}
.cogdot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px;vertical-align:middle}

/* Học sinh chọn khóa học (Toán Thích Ứng) */
.cpick-wrap { background: linear-gradient(135deg, #EEF3FF 0%, #FFF5EC 100%); border: 1px solid #D9E2FA; border-radius: 22px; padding: 22px; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(30,58,138,.08); }
.cpick-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.cpick-ic { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #E8590C; color: #fff; box-shadow: 0 6px 16px rgba(232,89,12,.35); }
.cpick-ic svg { width: 26px; height: 26px; }
.cpick-head h2 { margin: 0 0 4px; font-size: 22px; color: #1E3A8A; }
.cpick-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.cpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.cpick { background: #fff; border: 1px solid #E3E8F4; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.cpick::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, #1E3A8A, #0EA5A4, #E8590C); }
.cpick:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(30,58,138,.14); }
.cpick-mine { border-color: #E8590C; box-shadow: 0 0 0 2px rgba(232,89,12,.18); }
.cpick-top { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cpick-grade { font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: #1E3A8A; border-radius: 99px; padding: 4px 12px; }
.cpick-tag { font-size: 12px; font-weight: 700; color: #C2410C; background: #FFF1E6; border-radius: 99px; padding: 4px 10px; display: inline-flex; gap: 4px; align-items: center; }
.cpick-tag.ok { color: #157347; background: #E7F6EE; }
.cpick h3 { margin: 4px 0 0; font-size: 19px; line-height: 1.3; }
.cpick-meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.cpick-now { margin: 4px 0; font-size: 14.5px; }
.cpick-steps { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 6px; }
.cpick-steps li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.cpick-steps li b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #EEF1F7; color: #55607A; }
.cpick-steps li.on { color: var(--text); font-weight: 700; }
.cpick-steps li.on b { background: #E8590C; color: #fff; }
.cpick-steps li.ok b { background: #16A34A; color: #fff; }
.cpick form { margin: 0; }
.cpick .btn-block { margin-top: auto; }
@media (max-width: 600px) { .cpick-wrap { padding: 16px; border-radius: 18px; } .cpick-head h2 { font-size: 19px; } }

/* Bài kiểm tra đầu vào: lựa chọn "Em chưa biết" và nhắc câu chưa làm */
.choice.dontknow { border-style: dashed; background: #FAFAFC; margin-top: 4px; }
.choice.dontknow .choice-text { color: var(--muted); }
.choice.dontknow .choice-text small { display: block; font-size: 12.5px; opacity: .85; }
.choice.dontknow:has(input:checked) { border-color: #D97706; background: #FFF8EB; }
.choice.dontknow:has(input:checked) .choice-text { color: #92400E; }
.quiz-missing { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: #FFF1F1; border: 1px solid #F6C6C6; color: #8E1426; font-size: 14.5px; line-height: 1.7; }
.quiz-missing .qdot { display: inline-grid; margin: 0 3px; vertical-align: middle; background: #fff; border-color: #E9A3A3; color: #8E1426; }
.place-score { display: inline-flex; align-items: baseline; gap: 6px; margin-top: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.06); font-size: 15px; }
.place-score b { font-size: 22px; color: var(--text); }
.place-score .dk { color: #B45309; font-size: 13.5px; }
.review-cta summary { list-style: none; display: flex; align-items: center; gap: 10px; }
.review-cta summary::-webkit-details-marker { display: none; }

/* ===== Menu trái gọn: nhóm mục + nút thu gọn chỉ còn biểu tượng ===== */
.nav { gap: 2px; }
.nav-item { height: 42px; font-size: 14.5px; }
.nav-group { margin: 14px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2, #98A2B3); white-space: nowrap; }
.nav-group:first-child { margin-top: 2px; }
.sidebar { gap: 16px; }
.brand-mini { display: none; }
.sb-toggle .ic-open { display: none; }
@media (max-width: 960px) { .sb-toggle { display: none; } }
@media (min-width: 961px) {
  .shell { transition: grid-template-columns .25s var(--ease, ease); }
  body.sb-mini { --sidebar: 78px; }
  body.sb-mini .sidebar { padding: 18px 10px; overflow-x: hidden; }
  body.sb-mini .brand { padding: 2px 0; display: flex; justify-content: center; }
  body.sb-mini .brand-full { display: none; }
  body.sb-mini .brand-mini { display: block; height: 40px; width: 40px; border-radius: 12px; }
  body.sb-mini .nav-group { font-size: 0; height: 1px; margin: 10px 12px; background: var(--line); }
  body.sb-mini .nav-group:first-child { display: none; }
  body.sb-mini .nav-item { justify-content: center; padding: 0; gap: 0; }
  body.sb-mini .nav-item > span { display: none; }
  body.sb-mini .nav-item:hover { transform: none; }
  body.sb-mini .nav-count { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: 11px; }
  body.sb-mini .side-card { padding: 10px; justify-content: center; }
  body.sb-mini .side-card > div:not(:first-child) { display: none; }
  body.sb-mini .sb-toggle .ic-close { display: none; }
  body.sb-mini .sb-toggle .ic-open { display: block; }
  /* nhãn nổi khi rê chuột vào biểu tượng */
  body.sb-mini .nav-item::after { content: attr(title); position: fixed; left: 84px; transform: translateY(0); padding: 6px 10px; border-radius: 8px; background: #1F2433; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 60; }
  body.sb-mini .nav-item:hover::after { opacity: 1; }
}

/* ===== Chống tràn ngang trên điện thoại cho toàn bộ trang Quản trị / Giáo viên (a_system, a_voice, t_care...) ===== */
html, body { overflow-x: clip; max-width: 100%; }
.shell, .main-wrap, .content, .grid > *, .stack > *, .card, .list-item .meta, .grow { min-width: 0; }
select, .select-sm, input[type="text"], input[type="file"], textarea { max-width: 100%; box-sizing: border-box; }
.select-sm { overflow: hidden; text-overflow: ellipsis; }
.check-item .meta, .check-item .meta small, .check-item .meta b, .list-item .meta b, .list-item .meta small { overflow-wrap: anywhere; word-break: break-word; }
.code-pre, .log-view { max-width: 100%; overflow-x: auto; box-sizing: border-box; }
@media (max-width: 760px) {
  .content { padding: 8px 12px 24px; max-width: 100vw; overflow-x: clip; }
  .card { max-width: 100%; }
  .card-pad { padding: 16px; }
  .card-head { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .row, .row-between { flex-wrap: wrap !important; }
  .row-between > form { width: 100%; max-width: 100%; }
  select, .select-sm { width: 100%; max-width: 100%; font-size: 14.5px; text-overflow: ellipsis; padding-right: 34px; }
  select option { font-size: 14px; white-space: normal; }
  .tabs { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: 0 0 auto; white-space: nowrap; }
  .list-item { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
  .list-item .meta { flex: 1 1 200px; }
  .backup-hero .btn-primary { margin-left: 0 !important; width: 100%; justify-content: center; }
  .log-view { margin: 0 12px 14px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
  .topbar { max-width: 100vw; }
  .chips { flex-wrap: wrap; max-width: 100%; }
}
