/* ===== Key 4 Aptis Design System ===== */
:root {
  --navy: #1E3A8A;      /* Chủ đạo - Xanh dương đậm */
  --navy-700: #172e6e;
  --emerald: #10B981;   /* Chủ đạo - Xanh ngọc */
  --emerald-600: #0ea371;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;  /* Phụ trợ - Xám nhạt */
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --orange: #F97316;    /* CTA - Cam sáng */
  --orange-600: #ea6a0c;
  --white: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(30, 58, 138, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 58, 138, 0.14);
  --container: 1180px;
  --font: 'Segoe UI', Roboto, system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--emerald-600); }
img { max-width: 100%; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.site-main { min-height: 60vh; }

/* Thuộc tính [hidden] phải LUÔN ẩn — nếu không các class đặt display (inline-block/
   inline-flex như .tip-badge, .btn, .q15-story-badge...) sẽ đè khiến phần tử vẫn hiện.
   Vd tag "Phiên bản riêng của bạn" và nút "Khôi phục mẹo mặc định" khi chưa có bản riêng. */
[hidden] { display: none !important; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 2px solid transparent; transition: all .15s ease; white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-cta { background: var(--orange); color: #fff; }
.btn-cta:hover { background: var(--orange-600); color: #fff; transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-emerald:hover { background: var(--emerald-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--gray-200); }
.btn-ghost:hover { border-color: var(--navy); background: var(--gray-100); }
/* Nút phụ trên nền hero TỐI: chữ trắng, hover đảo màu (fix lỗi trắng-trên-trắng). */
.btn-hero-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .55); }
.btn-hero-ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }

/* ===== Header ===== */
.site-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
/* Logo chữ (icon + KEY4APTIS) do người dùng thiết kế - nền header trắng nên hiện đẹp */
.brand-wordmark { height: 40px; width: auto; display: block; }
.exam-wordmark { height: 30px; }
@media (max-width: 480px) { .brand-wordmark { height: 34px; } }
/* Tên hiển thị "Key for Aptis" (thương hiệu/domain: key4aptis) - nhấn chữ Key */
.brand-key { color: var(--emerald); }
.brand-for { color: var(--orange); }
.brand-aptis { color: var(--navy); }
.brand-text { letter-spacing: -.3px; }

.main-nav { display: flex; align-items: center; flex: 1; gap: 12px; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; flex: 1; }
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 4px; padding: 10px 12px;
  color: var(--gray-800); font-weight: 600; font-size: 14.5px; border-radius: var(--radius-sm);
}
.nav-link:hover { background: var(--gray-100); color: var(--navy); }
.nav-link.active { color: var(--navy); background: var(--gray-100); }
.caret { font-size: 10px; color: var(--gray-400); }
.nav-cta .nav-link { background: var(--orange); color: #fff; }
.nav-cta .nav-link:hover { background: var(--orange-600); color: #fff; }

.submenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .15s ease; z-index: 120;
}
.nav-item.has-children:hover > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li { position: relative; }
.submenu-link { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-800); }
.submenu-link:hover, .submenu-link.active { background: var(--gray-100); color: var(--navy); }
.submenu-icon { display: inline-block; width: 1.3em; text-align: center; }
.caret-right { float: right; color: var(--gray-400); font-size: 11px; }
/* Menu con cấp 2 (flyout sang phải) */
.submenu-nested { top: -8px; left: calc(100% + 4px); }
.submenu li.has-children:hover > .submenu-nested { opacity: 1; visibility: visible; transform: translateY(0); }

.nav-auth { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 13px; color: var(--gray-600); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dropdown tài khoản */
.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 6px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 999px; padding: 8px 16px; font-size: 14px; color: var(--gray-800); cursor: pointer; font-family: inherit; }
.user-trigger:hover { background: var(--gray-200); }
.user-trigger strong { color: var(--navy); }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px;
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .15s ease; z-index: 130;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown li a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-800); }
.user-dropdown li a:hover { background: var(--gray-100); color: var(--navy); }
/* Huy hiệu VIP đặt đầu menu tài khoản (thay cho tag VIP ngoài header). */
.user-dropdown-vip a { color: var(--orange-600); font-weight: 700; }
.user-dropdown-vip a:hover { background: rgba(249, 115, 22, .10); color: var(--orange-600); }
/* Band mục tiêu ở lời chào — làm nổi bật bằng pill cam. */
.greet-band {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.5;
  vertical-align: middle;
}
/* Nút "Thoát" là <button> trong form POST (chống logout-CSRF) nhưng trông như link. */
.logout-form { margin: 0; }
.logout-link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); cursor: pointer; text-decoration: underline; }
.user-dropdown li .logout-link { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-800); text-decoration: none; }
.user-dropdown li .logout-link:hover { background: var(--gray-100); color: var(--navy); }

/* Divider trên trang đăng nhập */
.auth-sep { display: flex; align-items: center; text-align: center; color: var(--gray-400); font-size: 13px; margin: 20px 0 14px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.auth-sep span { padding: 0 12px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--navy); border-radius: 2px; }

.click-banner {
  background: linear-gradient(90deg, var(--navy), var(--emerald));
  color: #fff; text-align: center; padding: 8px 16px; font-size: 14px;
}
.click-banner a { color: #fff; text-decoration: underline; font-weight: 700; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #23499f 55%, var(--emerald) 160%);
  color: #fff; padding: 72px 0 84px;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -1px; }
.hero .highlight { color: #FBBF77; }
.hero p.lead { font-size: 18px; color: #dbe4ff; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; }
.hero-stat b { display: block; font-size: 26px; }
.hero-stat span { color: #cdd9ff; font-size: 13px; }
.hero-art { display: flex; justify-content: center; }
.hero-card {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 26px; width: 100%; backdrop-filter: blur(4px);
}
.hero-card h3 { margin: 0 0 14px; font-size: 16px; }
.skill-pill { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.12); padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; }
.skill-pill b { font-weight: 700; }
.skill-pill em { font-style: normal; color: #cdeee0; font-size: 13px; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 42px; }
.section-head h2 { font-size: 30px; color: var(--navy); margin: 0 0 10px; }
.section-head p { color: var(--gray-600); font-size: 16px; margin: 0; }
.eyebrow { color: var(--emerald-600); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }

/* ===== Cards grid ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; background: var(--gray-100); }
.card h3 { margin: 0 0 8px; color: var(--navy); font-size: 19px; }
.card p { margin: 0 0 16px; color: var(--gray-600); font-size: 14.5px; }
.card-link { font-weight: 700; color: var(--emerald-600); }

.icon-navy { background: rgba(30,58,138,.1) !important; color: var(--navy); }
.icon-emerald { background: rgba(16,185,129,.12) !important; color: var(--emerald-600); }
.icon-orange { background: rgba(249,115,22,.12) !important; color: var(--orange-600); }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 22px; }
.step { background: #fff; border-radius: var(--radius); padding: 24px; border: 1px solid var(--gray-200); }
.step .num { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px; }
.step h4 { margin: 0 0 6px; color: var(--navy); }
.step p { margin: 0; color: var(--gray-600); font-size: 14px; }

/* ===== CTA band ===== */
.cta-band { background: var(--navy); color: #fff; border-radius: 18px; padding: 44px; text-align: center; margin: 20px 0; }
.cta-band h2 { margin: 0 0 10px; font-size: 28px; }
.cta-band p { color: #cdd9ff; margin: 0 0 22px; }

/* ===== Page header (skill pages) ===== */
.page-head { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 40px 0; }
.page-head .eyebrow { display: block; margin-bottom: 6px; }
.page-head h1 { margin: 0 0 8px; color: var(--navy); font-size: 32px; }
.page-head p { margin: 0; color: var(--gray-600); }
.breadcrumb { font-size: 13px; color: var(--gray-400); margin-bottom: 14px; }
.breadcrumb a { color: var(--gray-600); }

/* ===== Auth ===== */
.auth-wrap { max-width: 440px; margin: 48px auto; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; }
.auth-wrap h1 { margin: 0 0 6px; color: var(--navy); font-size: 24px; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--gray-600); margin: 0 0 22px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-control { width: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--navy); }
.form-note { font-size: 13px; color: var(--gray-600); margin: 6px 0 0; line-height: 1.5; }
select.form-control { cursor: pointer; }
.btn-block { width: 100%; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-success { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.auth-forgot { text-align: center; margin: 14px 0 0; font-size: 14px; }
.auth-forgot a { color: var(--navy); font-weight: 600; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--gray-600); }
.limit-note { background: linear-gradient(90deg, rgba(249,115,22,.12), rgba(16,185,129,.12)); border: 1px solid var(--gray-200); }

/* ===== Info / center panels ===== */
.panel { max-width: 560px; margin: 60px auto; background:#fff; border:1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; text-align: center; }
.panel .big-emoji { font-size: 48px; }
.panel h1 { color: var(--navy); margin: 12px 0 8px; }
.panel p { color: var(--gray-600); }

/* ===== List (sections placeholder) ===== */
.placeholder-box { background: #fff; border: 1.5px dashed var(--gray-200); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--gray-600); }
.placeholder-box .big-emoji { font-size: 40px; }

/* ===== Reading - Học theo bộ đề ===== */
.exam-note { background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; border-radius: 12px; padding: 14px 18px; font-size: 14px; margin-bottom: 26px; line-height: 1.7; }
.exam-card .exam-topics { list-style: none; padding: 0; margin: 12px 0 16px; font-size: 13px; color: var(--gray-600); }
.exam-card .exam-topics li { padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-part-tag { display: inline-block; min-width: 24px; text-align: center; background: var(--gray-100); color: var(--gray-600); font-weight: 700; font-size: 11px; padding: 1px 5px; border-radius: 4px; margin-right: 6px; }

/* Thanh bước Part 1..5 */
.rex-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rex-step { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--gray-100); color: var(--gray-400); }
.rex-step.is-done { background: rgba(16,185,129,.12); color: var(--emerald-600); }
.rex-step.is-current { background: var(--navy); color: #fff; }
.rex-progress { font-size: 14px; color: var(--gray-600); margin-right: 6px; }

/* Trang kết quả */
.rex-result { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 30px; background: #fff; border: 2px solid var(--gray-200); border-radius: 16px; padding: 28px 30px; box-shadow: var(--shadow); }
.rex-result.is-good { border-color: var(--emerald); }
.rex-result.is-ok { border-color: var(--orange); }
.rex-result.is-low { border-color: #FCA5A5; }
.rex-score-big { font-size: 52px; font-weight: 800; color: var(--navy); line-height: 1; }
.rex-score-big span { font-size: 24px; color: var(--gray-400); }
.rex-percent { font-size: 24px; font-weight: 800; color: var(--emerald-600); }
.rex-rating { font-size: 14px; font-weight: 700; color: var(--gray-600); }
.rex-bars { display: flex; flex-direction: column; gap: 7px; }
.rex-bar-row { display: flex; align-items: center; gap: 10px; }
.rex-bar-label { font-size: 12px; font-weight: 700; color: var(--gray-600); min-width: 46px; }
.rex-bar { flex: 1; height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.rex-bar span { display: block; height: 100%; background: linear-gradient(90deg, #2563EB, var(--emerald)); border-radius: 999px; }
.rex-bar-score { font-size: 12px; font-weight: 700; color: var(--gray-800); min-width: 34px; text-align: right; }

.rex-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.rex-review-hint { font-size: 14px; color: var(--gray-600); margin: 0 0 14px; }
.rex-part-card { margin-bottom: 18px; }
.rex-part-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rex-part-score { font-size: 15px; font-weight: 800; color: var(--gray-600); background: var(--gray-100); padding: 3px 12px; border-radius: 999px; }
.rex-part-score.is-full { background: rgba(16,185,129,.12); color: var(--emerald-600); }
.rex-table td { vertical-align: top; }

@media (max-width: 780px) {
  .rex-result { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .rex-bars { text-align: left; }
}

/* ===== Listening - Học theo bộ đề ===== */
.lex-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.lex-step { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 8px; background: var(--gray-100); color: var(--gray-600); font-size: 12px; font-weight: 700; transition: all .12s ease; }
.lex-step:hover { background: var(--gray-200); color: var(--navy); }
.lex-step.is-current { background: var(--navy); color: #fff; }

.lex-audio-wrap { margin-bottom: 8px; }
.lex-audio-wrap.is-exhausted .lex-audio { opacity: .5; pointer-events: none; }
.lex-plays { font-size: 13px; font-weight: 700; color: var(--gray-600); margin: 6px 0 18px; }
.lex-plays-left { color: var(--emerald-600); }
.lex-plays-done { color: #DC2626; }
.lex-audio-wrap.is-exhausted .lex-plays-left { color: #DC2626; }

.lex-talk { margin-bottom: 32px; }
.lex-talk-title { font-size: 19px; color: var(--navy); margin: 0 0 10px; }
.lex-subq { padding: 14px 0; border-top: 1px dashed var(--gray-200); }
.lex-subq:first-child { border-top: none; padding-top: 0; }

.lex-tr { border: 1px solid var(--gray-200); border-radius: 8px; margin-bottom: 8px; }
.lex-tr summary { cursor: pointer; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--navy); }
.lex-tr[open] summary { border-bottom: 1px solid var(--gray-200); }
.lex-tr-text { margin: 0; padding: 14px; font-size: 15px; line-height: 1.75; color: var(--gray-800); white-space: pre-line; }

/* Banner nhắc khách chưa đăng nhập (trên trang luyện tập) */
.guest-note { background: #EFF6FF; border-bottom: 1px solid #DBEAFE; color: #1E40AF; text-align: center; font-size: 14px; padding: 9px 16px; }
.guest-note a { font-weight: 700; text-decoration: underline; }
.guest-note.activate-note { background: #FEF3C7; border-bottom-color: #FDE68A; color: #92400E; }

/* Trang "cần kích hoạt" / "đăng ký thành công" */
.act-box { text-align: left; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; padding: 20px 22px; margin: 22px 0; }
.act-box-title { font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.act-box p { color: var(--gray-600); font-size: 14px; margin: 0 0 8px; }
.act-warn { background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E !important; border-radius: 8px; padding: 10px 12px; font-size: 13px !important; }
.act-note { color: var(--gray-400) !important; font-size: 13px !important; margin: 0 !important; }
.act-steps { margin: 0 0 12px; padding-left: 20px; color: var(--gray-600); font-size: 14px; line-height: 1.9; }
.act-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }

/* ===== Gia hạn / Gói cước ===== */
.bill-alert { border-radius: 12px; padding: 14px 18px; margin-bottom: 26px; font-size: 15px; }
.bill-alert-warn { background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; }
.bill-alert-ok { background: #ECFDF5; border: 1px solid #D1FAE5; color: #065F46; }

.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.bill-card { position: relative; background: #fff; border: 1.5px solid var(--gray-200); border-radius: 16px; padding: 28px 22px; text-align: center; transition: transform .15s ease, box-shadow .15s ease; }
.bill-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.bill-card.is-featured { border-color: var(--emerald); }
.bill-card.is-promo { border-color: var(--orange); }
.bill-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--emerald); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
/* Màu badge do admin chọn (inline style trên thẻ) ghi đè màu mặc định. */
.bill-price { font-size: 30px; font-weight: 800; color: var(--navy); }
.bill-price-old { display: inline-block; margin-left: 6px; font-size: 16px; font-weight: 600; color: var(--gray-400); text-decoration: line-through; }
.bill-days { font-size: 17px; font-weight: 700; color: var(--emerald-600); margin-top: 2px; }
.bill-desc { color: var(--gray-600); font-size: 14px; margin: 10px 0 14px; }
.bill-countdown { margin: 0 0 16px; padding: 8px 10px; background: rgba(249,115,22,.08); border: 1px dashed rgba(249,115,22,.35); border-radius: var(--radius-sm); font-size: 13px; color: var(--orange-600); }
.bill-countdown-label { display: block; font-size: 12px; }
.bill-countdown-time { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.bill-btn { width: 100%; }

/* Voucher tự áp trên trang gia hạn (thẻ gói) */
.bill-voucher-badge { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 800; color: #92400E; background: #FEF3C7; border: 1px solid #FDE68A; padding: 2px 8px; border-radius: 999px; }
.bill-price-after { font-size: 26px; font-weight: 800; color: var(--orange-600, #EA580C); line-height: 1.1; margin-top: 2px; }
.bill-price-after .bill-price-old { font-size: 15px; color: var(--gray-400); text-decoration: line-through; font-weight: 600; margin-left: 6px; }
.bill-bonus-badge { display: inline-block; font-size: 12px; font-weight: 700; color: #059669; background: #ECFDF5; border: 1px solid #A7F3D0; padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.bill-save { margin-top: 6px; display: inline-block; font-size: 13px; font-weight: 800; color: #DC2626; background: #FEF2F2; border: 1px solid #FECACA; padding: 2px 10px; border-radius: 999px; }
/* Gói đang áp voucher giảm giá -> ẩn giá gốc, hiện giá sau mã (JS thêm .has-discount). */
.bill-card.has-discount .bill-price { display: none; }
/* [hidden] phải THẮNG display của author (giống .ovl[hidden]) — nếu không các badge luôn hiện. */
.bill-voucher-badge[hidden], .bill-price-after[hidden], .bill-save[hidden], .bill-bonus-badge[hidden] { display: none; }
/* Nút "Chọn gói này" thẳng hàng: thẻ xếp dọc, đẩy form xuống đáy (thẻ cùng hàng bằng chiều cao nhờ grid). */
.bill-card { display: flex; flex-direction: column; }
.bill-card form { margin-top: auto; }
.bill-voucher-pick { margin-top: 16px; }
.bill-voucher-note { margin: 0 0 8px; font-size: 14px; color: var(--gray-700, #374151); }
.bill-voucher-note code { background: #F3F4F6; padding: 1px 5px; border-radius: 5px; }
.vc-pick-list { display: grid; gap: 8px; max-width: 560px; }
.vc-pick-list.vc-pick-inline { grid-template-columns: 1fr 1fr; }
.vc-pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid #E5E7EB; border-radius: 10px; cursor: pointer; }
.vc-pick:hover { border-color: #FCD34D; background: #FFFBEB; }
.vc-pick input { margin: 0; flex: none; }
.vc-pick-main { display: flex; flex-direction: column; gap: 1px; }
.vc-pick-main strong { color: var(--navy); }
.vc-pick-meta { font-size: 12px; color: var(--gray-500, #6b7280); }
.vc-pick-meta code { background: #F3F4F6; padding: 1px 5px; border-radius: 5px; }
.vc-pick-none { background: #F9FAFB; }
/* Giãn cách khối thông báo trạng thái tài khoản với danh sách gói */
.bill-status { margin-top: 30px; }
.pay-voucher-tag { color: var(--orange-600, #EA580C); font-weight: 700; }

.bill-referral { margin-top: 40px; background: linear-gradient(135deg, #EFF6FF, #ECFDF5); border: 1px solid #DBEAFE; border-radius: 16px; padding: 28px; text-align: center; }
.bill-referral h3 { margin: 0 0 8px; color: var(--navy); }
.bill-referral p { color: var(--gray-600); margin: 0 0 16px; }
/* Khi tắt bán gói -> khối giới thiệu là nội dung chính của trang */
.bill-referral.is-only { margin-top: 0; padding: 36px 28px; }
.bill-ref-row { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.bill-ref-more { margin: 16px 0 0 !important; font-size: 14px; }
.bill-history { margin-top: 32px; background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 22px 24px; overflow-x: auto; }
.bill-history h3 { margin: 0 0 14px; font-size: 17px; }
@media (max-width: 640px) { .bill-ref-row { flex-direction: column; } }

/* ===== Trang thanh toán QR ===== */
.pay-wrap { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 34px; background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); }
/* BẮT BUỘC: `display:grid` ở trên đè mất [hidden] mặc định của trình duyệt -> khi
   thanh toán xong, JS set payWrap.hidden=true nhưng khối QR VẪN HIỆN, chồng lên
   khối "Thanh toán thành công". Cùng bẫy với .ovl / .modal-overlay[hidden]. */
.pay-wrap[hidden] { display: none; }
.pay-done[hidden] { display: none; }
.pay-qr { text-align: center; }
.pay-qr-img { width: 100%; max-width: 300px; border: 1px solid var(--gray-200); border-radius: 12px; }
.pay-qr-note { font-size: 13px; color: var(--gray-600); margin-top: 12px; }
.pay-qr-missing { background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; border-radius: 12px; padding: 24px; font-size: 14px; line-height: 1.7; }

.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--gray-200); }
.pay-label { color: var(--gray-600); font-size: 14px; }
.pay-value { font-weight: 700; color: var(--gray-800); text-align: right; }
.pay-amount { color: var(--orange-600); font-size: 20px; }
.pay-code { color: var(--navy); font-size: 19px; letter-spacing: 1px; background: #EFF6FF; padding: 3px 10px; border-radius: 6px; }
.pay-copy { cursor: pointer; margin-left: 8px; background: #fff; border: 1px solid var(--gray-200); border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 700; color: var(--gray-600); }
.pay-copy:hover { border-color: var(--navy); color: var(--navy); }
.pay-copy.is-copied { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.pay-warn { background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 18px; }
.pay-status { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--gray-600); }
.pay-spinner { width: 15px; height: 15px; border: 2px solid var(--gray-200); border-top-color: var(--emerald); border-radius: 50%; animation: pay-spin .8s linear infinite; }
@keyframes pay-spin { to { transform: rotate(360deg); } }

.pay-done { text-align: center; background: #fff; border: 2px solid var(--emerald); border-radius: 16px; padding: 50px 30px; box-shadow: var(--shadow-lg); }
.pay-done-icon { font-size: 60px; }
.pay-done h2 { color: var(--emerald-600); margin: 10px 0 8px; }
.pay-done p { color: var(--gray-600); }
.pay-done-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* ===== Trang tài khoản ===== */
.acc-wrap { display: flex; flex-direction: column; gap: 20px; max-width: 860px; }
.acc-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.acc-label { display: block; font-size: 13px; font-weight: 800; letter-spacing: .6px; color: var(--gray-400); text-transform: uppercase; margin-bottom: 10px; }
.acc-note { color: var(--gray-600); font-size: 14px; margin: 8px 0 0; }
.acc-expiry { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.acc-expiry.is-expired { border-color: #FCA5A5; background: #FEF2F2; }
.acc-big { font-size: 28px; font-weight: 800; color: var(--emerald-600); }
.acc-big-red { color: #DC2626; }

.acc-ref-row { display: flex; gap: 10px; margin-top: 12px; }
.acc-ref-input { flex: 1; border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--gray-800); background: var(--gray-50); font-family: inherit; }
.acc-ref-stat { margin-top: 14px; font-size: 14px; color: var(--gray-600); }
.acc-ref-earned { color: var(--emerald-600); font-weight: 700; margin-left: 6px; }

.acc-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.acc-table th { text-align: left; color: var(--gray-400); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--gray-200); }
.acc-table td { padding: 11px 10px; border-bottom: 1px solid var(--gray-100); }
.acc-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); }
.acc-badge-ok { background: rgba(16,185,129,.12); color: var(--emerald-600); }
.acc-badge-wait { background: rgba(249,115,22,.12); color: var(--orange-600); }
.acc-soon { opacity: .7; }

/* ===== Cập nhật thông tin tài khoản ===== */
.acc-flash { border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.acc-flash-ok { background: rgba(16,185,129,.12); color: var(--emerald-600); border: 1px solid rgba(16,185,129,.3); }
.acc-flash-err { background: #FEF2F2; color: #DC2626; border: 1px solid #FCA5A5; }
.acc-forms { display: flex; flex-direction: column; gap: 22px; }
.acc-form { display: flex; flex-direction: column; gap: 8px; }
.acc-form-label { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.acc-form-row { display: flex; gap: 10px; align-items: center; }
.acc-form-row .acc-input { flex: 1; }
.acc-input {
  border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; color: var(--gray-800); background: var(--gray-50); font-family: inherit;
}
.acc-input:focus { outline: none; border-color: var(--navy); background: #fff; }
.acc-input-block { width: 100%; }
.acc-form-hint { font-size: 13px; color: var(--gray-500); margin: 2px 0 0; }
/* Nút lưu (navy) cho các form thông tin. */
.btn-navy { background: var(--navy); color: #fff; border: none; white-space: nowrap; }
.btn-navy:hover { background: #16223f; color: #fff; }

/* ===== Danh sách người đã giới thiệu ===== */
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ref-stat { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 20px; text-align: center; box-shadow: var(--shadow); }
.ref-stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.ref-stat-label { font-size: 13px; color: var(--gray-600); font-weight: 600; }
.ref-stat-ok .ref-stat-num { color: var(--emerald-600); }
.ref-stat-day .ref-stat-num { color: var(--orange-600); }

.ref-email { background: var(--gray-100); padding: 3px 8px; border-radius: 6px; font-size: 13px; color: var(--gray-800); letter-spacing: .5px; }
.ref-table td:first-child { color: var(--gray-400); font-weight: 700; }
.ref-note { font-size: 13px; color: var(--gray-600); margin: 16px 0 0; }
.ref-empty { text-align: center; padding: 34px 20px; color: var(--gray-600); }
.ref-empty-icon { font-size: 46px; }
.ref-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.ref-pager-info { font-size: 14px; color: var(--gray-600); }

@media (max-width: 640px) { .ref-stats { grid-template-columns: 1fr; } }

/* ===== 2 trụ cột trang chủ: Key & AI theo band ===== */
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pillar { border-radius: 18px; padding: 30px; border: 1.5px solid var(--gray-200); background: #fff; }
.pillar-key { background: linear-gradient(135deg, #ECFDF5, #F0FDF9); border-color: #A7F3D0; }
.pillar-ai { background: linear-gradient(135deg, #FFF7ED, #FEF3C7); border-color: #FED7AA; }
.pillar h3 { margin: 0 0 10px; color: var(--navy); font-size: 21px; }
.pillar > p { color: var(--gray-600); margin: 0 0 14px; }
.pillar-list { list-style: none; padding: 0; margin: 0; }
.pillar-list li { position: relative; padding: 5px 0 5px 22px; font-size: 14px; color: var(--gray-800); }
.pillar-list li::before { content: '✓'; position: absolute; left: 0; font-weight: 800; }
.pillar-key .pillar-list li::before { color: var(--emerald-600); }
.pillar-ai .pillar-list li::before { color: var(--orange-600); }

@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

/* ===== Facebook: icon header · khối trang chủ · footer ===== */
:root { --fb: #1877F2; --fb-dark: #0f5fd1; }

.nav-fb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  color: var(--fb); background: rgba(24,119,242,.1); padding: 6px 12px; border-radius: 999px; white-space: nowrap; transition: all .15s ease; }
.nav-fb:hover { background: var(--fb); color: #fff; }

.fb-band { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  background: linear-gradient(135deg, #EFF6FF, #E0EAFF); border: 1.5px solid #BFDBFE; border-radius: 18px; padding: 32px 34px; }
.fb-band-icon { color: var(--fb); display: flex; }
.fb-band-text h2 { margin: 0 0 8px; color: var(--navy); font-size: 24px; }
.fb-band-text p { margin: 0 0 12px; color: var(--gray-600); }
.fb-band-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; font-weight: 600; color: var(--gray-800); }
.fb-band-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btn-fb { background: var(--fb); color: #fff; border: none; white-space: nowrap; }
.btn-fb:hover { background: var(--fb-dark); color: #fff; }
.fb-band-page { font-size: 13px; color: var(--gray-600); }
.fb-band-page:hover { color: var(--fb); }

.footer-social { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.footer-social a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #a9b7d6; }
.footer-social a:hover { color: #fff; }

@media (max-width: 900px) {
  .fb-band { grid-template-columns: 1fr; text-align: center; gap: 18px; padding: 28px 22px; }
  .fb-band-icon { justify-content: center; }
  .fb-band-list { justify-content: center; }
}
@media (max-width: 920px) { .nav-fb { align-self: flex-start; } }

@media (max-width: 780px) {
  .pay-wrap { grid-template-columns: 1fr; }
  .acc-expiry { flex-direction: column; align-items: stretch; }
  .acc-ref-row { flex-direction: column; }
  .acc-table thead { display: none; }
  .acc-table td { display: flex; justify-content: space-between; gap: 12px; }
}

/* ===== Trang chưa xây dựng (chỉ icon + dòng chữ) ===== */
.under-construction { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 60px 20px; }
.under-construction .uc-icon { font-size: 72px; line-height: 1; }
.under-construction .uc-text { color: var(--navy); font-size: 22px; font-weight: 800; margin: 0; }

/* Checkbox đồng ý điều khoản ở form đăng ký */
.form-agree { margin-top: 4px; }
.agree-label { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--gray-700,#374151); cursor: pointer; font-weight: 400; }
.agree-label input { margin-top: 2px; flex: none; }
.agree-label a { color: var(--navy); font-weight: 700; }

/* Trang Điều khoản & Điều kiện */
.legal { max-width: 800px; margin: 0 auto; line-height: 1.75; color: var(--gray-800,#1f2937); }
.legal .legal-intro { background: #f7f9fc; border: 1px solid #e5e9f2; border-radius: 12px; padding: 14px 18px; }
.legal h2 { color: var(--navy); font-size: 19px; margin: 26px 0 8px; }
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal p { margin: 8px 0; }
.legal .legal-foot { margin-top: 28px; color: var(--gray-500,#6b7280); font-size: 13px; text-align: center; }

/* Popup chủ động mời bật thông báo */
.push-prompt-overlay { position: fixed; inset: 0; z-index: 1600; background: rgba(15,31,69,.55); display: flex; align-items: center; justify-content: center; padding: 18px; }
.push-prompt-box { position: relative; background: #fff; border-radius: 16px; max-width: 400px; width: 100%; padding: 30px 24px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.push-prompt-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 17px; color: #9aa4b8; cursor: pointer; line-height: 1; }
.push-prompt-icon { font-size: 46px; line-height: 1; }
.push-prompt-box h3 { color: var(--navy); margin: 8px 0 6px; font-size: 20px; }
.push-prompt-box p { color: var(--gray-700,#374151); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; }
.push-prompt-note { color: #b45309 !important; font-size: 13px !important; margin: -8px 0 12px !important; }
.push-prompt-yes { width: 100%; }
.push-prompt-no { display: block; width: 100%; margin-top: 10px; border: 0; background: transparent; color: var(--gray-500,#6b7280); font-size: 13.5px; cursor: pointer; text-decoration: underline; }

/* Popup kết quả chấm AI (Speaking form mô tả tranh) */
.wfp-ai-histlink { display: inline-block; margin: 8px 0 2px; font-size: 13px; color: var(--navy); text-decoration: underline; }
.wfp-ai-ok { color: var(--emerald-600,#0ea371); }
.wfp-ai-modal { position: fixed; inset: 0; z-index: 1500; background: rgba(15,31,69,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.wfp-ai-modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.wfp-ai-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-200,#e5e9f2); }
.wfp-ai-modal-head h3 { margin: 0; color: var(--navy); font-size: 18px; }
.wfp-ai-modal-x { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #9aa4b8; line-height: 1; }
.wfp-ai-modal-body { padding: 18px 20px; overflow-y: auto; }
.wfp-ai-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--gray-200,#e5e9f2); }

/* Trang billing khi CHƯA kích hoạt -> nội dung nhắc kích hoạt (như popup) */
.bill-activate { max-width: 480px; margin: 10px auto; background: #fff; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 16px; padding: 32px 26px; text-align: center; box-shadow: var(--shadow); }
.bill-activate-icon { font-size: 48px; line-height: 1; }
.bill-activate-msg { color: var(--gray-800,#1f2937); font-size: 15.5px; line-height: 1.7; margin: 14px 0 22px; }
.bill-activate .btn-cta { display: inline-block; }
.bill-activate-later { display: block; margin-top: 14px; color: var(--navy); font-size: 13.5px; text-decoration: underline; }

/* Popup "Tài khoản chưa kích hoạt" (bấm tính năng VIP khi chưa active) */
.ak-actv-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(15,31,69,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ak-actv-box { background: #fff; border-radius: 16px; max-width: 420px; width: 100%; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ak-actv-icon { font-size: 44px; line-height: 1; }
.ak-actv-msg { color: var(--gray-800,#1f2937); font-size: 15px; line-height: 1.65; margin: 12px 0 20px; }
.ak-actv-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ak-actv-actions .btn { width: 100%; }
/* "Gửi lại email" là link phụ, đặt dưới nút "Để sau", không làm nổi bật */
.ak-actv-resend { color: var(--navy); font-size: 13.5px; text-decoration: underline; }
.ak-actv-resend:hover { color: var(--navy-700,#172e6e); }

/* Thông báo "Dịch là tính năng VIP" trên trang làm bài (Listening) */
.tr-vip-note { background: #fff8ed; border: 1px solid #fde3bf; color: #92400e; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.tr-vip-note a { color: var(--navy); font-weight: 700; }

/* ===== Vocab for Writing ===== */
.wv-lock { text-align: center; max-width: 480px; margin: 20px auto; background: #fff; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 16px; padding: 34px 24px; box-shadow: var(--shadow); }
.wv-lock-icon { font-size: 44px; }
.wv-lock h2 { color: var(--navy); margin: 8px 0; font-size: 20px; }
.wv-tips { background: #fff8ed; border: 1px solid #fde3bf; border-radius: 12px; padding: 4px 16px; margin-bottom: 16px; }
.wv-tips summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 10px 0; }
.wv-tips ul { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; color: var(--gray-700,#374151); font-size: 14px; }
.wv-progress { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; }
.wv-prog-item { background: #fff; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 999px; padding: 6px 14px; }
.wv-prog-item.is-known { color: var(--emerald-600,#0ea371); }
.wv-prog-item.is-review { color: var(--orange); }
.wv-authnote { background: #eef3ff; border: 1px solid #d5e0fb; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.wv-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.wv-tab { border: 1px solid var(--gray-200,#e5e9f2); background: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--gray-700,#374151); }
.wv-tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.wv-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.wv-search { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 10px; font-size: 14px; }
.wv-select { padding: 9px 10px; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 10px; font-size: 14px; background: #fff; }
.wv-chk { font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; color: var(--gray-700,#374151); }
.wv-count { font-size: 13px; color: var(--gray-500,#6b7280); margin-left: auto; }
.wv-empty { color: var(--gray-500,#6b7280); padding: 24px; text-align: center; }

/* Danh sách */
.wv-row { display: flex; gap: 12px; justify-content: space-between; background: #fff; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.wv-term-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wv-term { font-weight: 800; color: var(--navy); font-size: 16px; }
.wv-pos { color: var(--gray-500,#6b7280); font-size: 13px; }
.wv-band { background: #eef3ff; color: var(--navy); border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.wv-chip { border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.wv-chip.is-core { background: #fee2e2; color: #b91c1c; }
.wv-chip.is-common { background: #e0f2fe; color: #0369a1; }
.wv-chip.is-extra { background: #f3f4f6; color: #6b7280; }
.wv-freq { font-size: 11.5px; color: var(--orange); }
.wv-meaning { margin-top: 3px; color: var(--gray-800,#1f2937); }
.wv-ex { margin-top: 4px; font-size: 13px; color: var(--gray-600,#4b5563); font-style: italic; }
.wv-ex-vi { color: var(--gray-500,#6b7280); font-style: normal; }
.wv-speak { border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 0 2px; }
.wv-row-actions { display: flex; gap: 4px; align-items: flex-start; flex: none; }
.wv-mini { border: 1px solid var(--gray-200,#e5e9f2); background: #fff; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }
.wv-mini.is-on { background: var(--navy); border-color: var(--navy); }

/* Flashcard */
.wv-flash-stage { max-width: 460px; margin: 0 auto; text-align: center; }
.wv-card { perspective: 1200px; height: 240px; cursor: pointer; }
.wv-card-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.wv-card.is-flipped .wv-card-inner { transform: rotateY(180deg); }
.wv-card-front, .wv-card-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; box-shadow: var(--shadow); }
.wv-card-front { background: linear-gradient(135deg,#1e3a8a,#2563eb); color: #fff; }
.wv-card-back { background: #fff; border: 1px solid var(--gray-200,#e5e9f2); transform: rotateY(180deg); }
.wv-fc-term { font-size: 30px; font-weight: 800; }
.wv-fc-pos { opacity: .85; }
.wv-fc-speak { color: #fff; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); border-radius: 8px; padding: 6px 12px; margin-top: 6px; }
.wv-fc-meaning { font-size: 22px; font-weight: 700; color: var(--navy); }
.wv-fc-ex { font-style: italic; color: var(--gray-600,#4b5563); font-size: 14px; }
.wv-fc-exvi { color: var(--gray-500,#6b7280); font-size: 13px; }
.wv-flash-pos { margin: 12px 0 6px; color: var(--gray-500,#6b7280); font-weight: 700; }
.wv-flash-ctrls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.wv-flash-hint { margin-top: 10px; font-size: 12px; color: var(--gray-400,#9ca3af); }
.btn-danger-ghost { background: #fff; border: 1px solid #f5b5b5; color: #b91c1c; }

/* Trắc nghiệm */
.wv-quiz { max-width: 560px; margin: 0 auto; }
.wv-quiz-head { color: var(--gray-500,#6b7280); font-size: 13px; margin-bottom: 8px; }
.wv-quiz-q { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: var(--gray-800,#1f2937); }
.wv-quiz-opts { display: grid; gap: 10px; }
.wv-opt { text-align: left; border: 1px solid var(--gray-200,#e5e9f2); background: #fff; border-radius: 10px; padding: 12px 14px; font-size: 15px; cursor: pointer; }
.wv-opt:hover { border-color: var(--navy); }
.wv-opt.is-correct { background: #dcfce7; border-color: #4ade80; }
.wv-opt.is-wrong { background: #fee2e2; border-color: #f87171; }
.wv-quiz-done { text-align: center; padding: 20px; }
.wv-quiz-score { font-size: 40px; font-weight: 800; color: var(--navy); }

/* Ghép đôi */
.wv-match-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wv-match { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wv-mcol { display: grid; gap: 10px; }
.wv-mtile { border: 1px solid var(--gray-200,#e5e9f2); background: #fff; border-radius: 10px; padding: 12px; font-size: 14px; cursor: pointer; text-align: center; }
.wv-mtile.is-sel { background: #eef3ff; border-color: var(--navy); }
.wv-mtile.is-done { background: #dcfce7; border-color: #4ade80; color: var(--gray-400,#9ca3af); cursor: default; }
.wv-mtile.is-bad { background: #fee2e2; border-color: #f87171; }

/* Chuyện chêm */
.wv-storycard { background: #fff; border: 1px solid var(--gray-200,#e5e9f2); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.wv-storycard h3 { color: var(--navy); margin: 0 0 10px; }
.wv-storybody { line-height: 2.1; font-size: 15.5px; color: var(--gray-800,#1f2937); }
.wv-en { color: #b45309; background: #fff7ed; border-radius: 5px; padding: 1px 5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.wv-en i { font-style: normal; color: var(--emerald-600,#0ea371); font-weight: 600; font-size: 12.5px; }
@media (max-width: 560px) { .wv-match { grid-template-columns: 1fr 1fr; gap: 10px; } .wv-count { margin-left: 0; } }

/* ===== PWA: banner "Thêm vào màn hình chính" ===== */
.pwa-install {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1200;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e5e9f2; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15,31,69,.18); padding: 12px 14px;
  transform: translateY(140%); opacity: 0; transition: transform .28s ease, opacity .28s ease;
  max-width: 460px; margin: 0 auto;
}
.pwa-install.show { transform: translateY(0); opacity: 1; }
.pwa-install-icon { border-radius: 10px; flex: none; }
.pwa-install-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-install-title { color: var(--navy); font-size: 15px; font-weight: 800; }
.pwa-install-desc { color: var(--gray-600, #4b5563); font-size: 12.5px; line-height: 1.4; }
.pwa-hl { color: var(--orange); } /* nhấn dòng thông báo bằng màu cam */
.pwa-install-btn {
  flex: none; border: 0; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
}
.pwa-install-btn:active { transform: translateY(1px); }
.pwa-install-close {
  flex: none; border: 0; background: transparent; color: #9aa4b8; font-size: 16px;
  cursor: pointer; padding: 4px; line-height: 1; align-self: flex-start;
}
/* Trên máy tính màn rộng: chỉ hiện góc phải, không kéo ngang cả trang */
@media (min-width: 720px) { .pwa-install { left: auto; right: 20px; bottom: 20px; margin: 0; } }
/* App đã cài (mở ở chế độ standalone) thì không bao giờ hiện banner */
@media (display-mode: standalone) { .pwa-install { display: none !important; } }

/* Bật thông báo đẩy ở trang Tài khoản */
.acc-push-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.acc-push-status { font-size: 13px; font-weight: 700; color: var(--emerald-600, #0ea371); }
.acc-push-hint { color: #6b7280; font-size: 12.5px; margin-top: 8px; }

/* ===== Footer ===== */
.site-footer { background: #0f1f45; color: #c7d2e8; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; padding: 48px 20px 30px; }
.footer-brand { display: flex; gap: 12px; }
.footer-brand .brand-text { font-size: 18px; font-weight: 800; }
.footer-brand .brand-aptis { color: #fff; } /* nền footer tối -> Aptis phải trắng */
/* Logo trắng đầy đủ (icon + KEY4APTIS + slogan) — hợp nền footer navy */
.footer-logo { width: 200px; max-width: 72%; height: auto; display: block; }
.footer-slogan { color: #93a4c8; font-size: 13px; margin: 10px 0 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.footer-col h4 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.footer-col a { display: block; color: #a9b7d6; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 20px; font-size: 13px; color: #8697bd; }

/* ===== Responsive ===== */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; margin-left: auto; }
  .main-nav {
    position: fixed; top: 68px; right: 0; bottom: 0; width: 300px; max-width: 85%;
    background: #fff; flex-direction: column; align-items: stretch; padding: 16px;
    box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .2s ease;
    overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 4px 0 4px 14px; }
  .nav-auth { margin-top: 16px; flex-direction: column; align-items: stretch; }
  .hero h1 { font-size: 32px; }
}

/* ===== Count badge (reading overview) ===== */
.count-badge { font-size: 12px; font-weight: 700; color: var(--emerald-600); background: rgba(16,185,129,.12); padding: 4px 10px; border-radius: 999px; }
.count-badge.soon { color: var(--gray-600); background: var(--gray-100); }
.card-meta { font-size: 13px; color: var(--gray-600); margin: 10px 0 16px !important; font-weight: 600; }

/* ===== Speaking - Học theo câu hỏi (Part 1) - trong exam layout ===== */
/* Câu hỏi ở trên, nút Record căn giữa màn hình bên dưới. */
.sp-qrow { display: flex; flex-direction: column; align-items: stretch; gap: 18px; margin: 0 0 26px; }
.sp-question { margin: 0; font-size: 26px; font-weight: 800; color: #0f172a; line-height: 1.35; }

.sp-record { flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  background: #E11D48; color: #fff; font-size: 16px; font-weight: 700; padding: 13px 26px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(225,29,72,.28); transition: background .15s ease, transform .1s ease; }
.sp-record:hover { background: #be123c; }
.sp-record:active { transform: scale(.97); }
.sp-record .sp-mic { display: inline-flex; }
.sp-record.is-recording { background: #0f172a; box-shadow: 0 6px 16px rgba(15,23,42,.3); animation: sp-pulse 1.3s infinite; }
@keyframes sp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(225,29,72,.45); } 50% { box-shadow: 0 0 0 10px rgba(225,29,72,0); } }

.sp-label { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--gray-400); text-transform: uppercase; margin-bottom: 10px; }
.sp-answer { min-height: 130px; border: 1.5px solid var(--gray-200); border-radius: 12px; background: var(--gray-50); padding: 16px 18px; font-size: 16px; line-height: 1.7; color: var(--gray-800); }
.sp-answer .sp-answer-ph { color: var(--gray-400); font-style: italic; }
.sp-answer.has-text .sp-answer-ph { display: none; }
.sp-answer .sp-answer-text .interim { color: var(--gray-400); }
.sp-rec-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; min-height: 4px; }
.sp-rec-status { font-size: 13px; font-weight: 700; color: #E11D48; }
.sp-playback { height: 36px; }

.sp-div { border: none; border-top: 1px dashed var(--gray-200); margin: 26px 0 22px; }

.sp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.sp-tabs-single { grid-template-columns: 1fr; } /* chưa có đáp án band -> 1 nút chiếm hết chiều ngang */
.sp-tab { cursor: pointer; background: #fff; border: 1.5px solid var(--gray-200); border-radius: 12px; padding: 15px; font-size: 15px; font-weight: 700; color: var(--gray-600); transition: all .15s ease; }
.sp-tab-1 { color: #2563EB; }
.sp-tab-2 { color: var(--emerald-600); }
.sp-tab-band { color: var(--navy); } /* đáp án theo band mục tiêu -> nhấn navy */
/* Nút band bị khoá (tài khoản thường) -> dạng anchor sang trang nâng cấp. */
.sp-tab.is-locked { text-decoration: none; text-align: center; color: var(--gray-500); background: var(--gray-50); }
.sp-tab.is-locked:hover { border-color: var(--navy); color: var(--navy); }
.btn-band.is-locked { text-decoration: none; opacity: .9; }
.sp-tab-1.is-active { border-color: #2563EB; background: #EFF6FF; }
.sp-tab-2.is-active { border-color: var(--emerald); background: #ECFDF5; }
.sp-tab-band.is-active { border-color: var(--navy); background: #EEF2F9; }

.sp-sample { background: #EFF6FF; border: 1px solid #DBEAFE; border-radius: 14px; padding: 20px 22px; }
.sp-sample-2 { background: #ECFDF5; border-color: #D1FAE5; }
.sp-sample-band { background: #EEF2F9; border-color: #C7D2E4; } /* đáp án band: nền navy nhạt */
.sp-sample-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sp-sample-title { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--gray-600); text-transform: uppercase; }
.sp-read { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--gray-200); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--gray-800); }
.sp-read:hover { border-color: var(--gray-400); }
.sp-read.is-playing { background: var(--navy); color: #fff; border-color: var(--navy); }
.sp-sample-text { margin: 0; font-size: 16px; line-height: 1.75; color: var(--gray-800); }

/* ===== Khung mẫu theo band (Speaking Part 2 & 3) — trang Học form ===== */
.sbk-lg { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 700; font-size: 12.5px; }
.sbk-lg-frame { background: #DBEAFE; color: #1E40AF; }
.sbk-lg-fill { background: #FFEDD5; color: #9A3412; }

/* Bảng các bước khung */
.sbk-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.sbk-step { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px; }
.sbk-step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.sbk-step-label { font-weight: 800; color: var(--navy); font-size: 14px; }
.sbk-step-desc { font-size: 13px; color: var(--gray-600); margin-top: 3px; line-height: 1.5; }

.sbk-rowhead { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; font-size: 16px; font-weight: 800; color: var(--gray-800); }

/* Khối khung mẫu */
.sbk { background: #F8FAFC; border: 1px solid #C7D2E4; border-radius: 14px; padding: 18px 20px; }
.sbk-read { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--gray-200); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--gray-800); }
.sbk-read:hover { border-color: var(--gray-400); }
.sbk-legend { font-size: 12.5px; color: var(--gray-600); margin: 12px 0 0; line-height: 1.6; }

/* Ô tự luyện */
.sbk-textarea { width: 100%; min-height: 140px; border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px; font-size: 15px; line-height: 1.7; resize: vertical; font-family: inherit; }
.sbk-textarea:focus { outline: none; border-color: var(--navy); }
.sbk-wc { font-size: 13px; color: var(--gray-600); margin-top: 8px; }
.sbk-practice-note { font-size: 13.5px; color: var(--gray-600); margin: 8px 0 0; }

.sbk-controls { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px 16px; }
.sbk-ctrl-label { font-size: 13px; font-weight: 700; color: var(--gray-600); }
.sbk-bandout { color: var(--navy); font-weight: 800; }
.sbk-slider { width: 100%; margin: 10px 0 4px; accent-color: var(--orange); }
.sbk-ticks { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; color: var(--gray-500, #9ca3af); }
.sbk-hint { font-size: 13px; color: var(--gray-600); margin-top: 8px; }
.sbk-rubric { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sbk-tag { font-size: 12px; font-weight: 700; color: #166534; background: #DCFCE7; padding: 2px 9px; border-radius: 999px; }

.sbk-vars-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.sbk-vars-label { font-size: 13px; font-weight: 700; color: var(--gray-600); }
.sbk-vars { display: flex; flex-wrap: wrap; gap: 8px; }
.sbk-varbtn { cursor: pointer; background: #fff; border: 1.5px solid var(--gray-200); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--gray-600); }
.sbk-varbtn:hover { border-color: var(--gray-400); }
.sbk-varbtn.is-active { border-color: var(--orange); background: #FFF7ED; color: var(--orange-600); }

.sbk-outwrap { margin-top: 16px; background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 16px 18px; }
.sbk-outhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sbk-outtitle { font-size: 12.5px; font-weight: 800; letter-spacing: 1px; color: var(--gray-500, #9ca3af); }
.sbk-out { font-size: 16px; line-height: 1.85; color: var(--gray-800); }
.sbk-out p { margin: 0 0 10px; }
.sbk-out p:last-child { margin-bottom: 0; }
.sbk-frame { background: #DBEAFE; border-radius: 5px; padding: 0 3px; }
.sbk-fill { background: #FFEDD5; border-radius: 5px; padding: 0 3px; }
.sbk-tip { font-size: 12.5px; color: var(--gray-500, #9ca3af); margin: 12px 0 0; }
@media (max-width: 640px) { .sbk { padding: 14px; } }

/* Trang Học form Speaking (2 cột như email): ảnh, câu hỏi, mic ghi âm, transcript */
.spf-media { border: 1px solid var(--gray-200); border-radius: 12px; padding: 10px; background: #fff; text-align: center; margin-top: 12px; }
.spf-media img { max-width: 100%; max-height: 300px; border-radius: 8px; }
.spf-media-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spf-media-pair .spf-imgcell img { max-height: 200px; }
.spf-qbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 16px; font-size: 17px; font-weight: 800; color: var(--navy); }
.spf-qbadge { font-size: 12px; font-weight: 700; color: #2563EB; background: #EFF6FF; padding: 3px 10px; border-radius: 999px; }
.spf-read { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--gray-200); border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 700; color: var(--gray-800); white-space: nowrap; }
.spf-read:hover { border-color: var(--gray-400); }

.spf-mic { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border: none; border-radius: 999px; padding: 10px 20px; font-size: 15px; font-weight: 700; }
.spf-mic:hover { background: var(--navy-700); }
.spf-mic.is-recording { background: #DC2626; animation: spfpulse 1.2s ease-in-out infinite; }
.spf-mic-ic { display: inline-flex; }
@keyframes spfpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.spf-timer { margin-left: auto; font-size: 13px; font-weight: 700; color: #DC2626; }
.spf-transcript { margin-top: 12px; min-height: 96px; background: #fff; border: 1px dashed var(--gray-300, #d1d5db); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.7; color: var(--gray-800); }
.spf-transcript.has-text { border-style: solid; border-color: var(--gray-200); }
.spf-transcript.has-text .spf-tr-ph { display: none; }
.spf-tr-ph { color: var(--gray-400); }
.spf-tr-text .interim { color: var(--gray-400); }
.spf-recfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.spf-recstatus { font-size: 12.5px; color: var(--gray-500, #9ca3af); }
.spf-playback { width: 100%; margin-top: 10px; }
.spf-viplock { text-align: center; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 16px; padding: 40px 24px; }
.spf-viplock-ic { font-size: 44px; }
.spf-viplock h2 { margin: 10px 0 8px; color: var(--navy); font-size: 22px; }
.spf-viplock p { max-width: 560px; margin: 0 auto 18px; color: var(--gray-600); line-height: 1.7; }
@media (max-width: 640px) { .spf-media-pair { grid-template-columns: 1fr; } }

/* Part 2: ảnh + tab câu hỏi con */
.sp-image { border: 1px solid var(--gray-200); border-radius: 14px; padding: 14px; text-align: center; background: #fff; margin-bottom: 24px; }
.sp-image img { max-width: 100%; max-height: 440px; border-radius: 8px; }

/* Part 3: cặp 2 ảnh so sánh */
.sp-image-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.sp-image-pair .sp-image { margin-bottom: 0; position: relative; }
.sp-image-pair .sp-image img { max-height: 300px; }
.sp-image-badge { position: absolute; top: 20px; left: 20px; background: rgba(15,23,42,.72); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }

.sp-subtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.sp-subtab { cursor: pointer; background: #fff; border: 1.5px solid var(--gray-200); border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 700; color: var(--gray-600); transition: all .15s ease; }
.sp-subtab:hover { border-color: var(--gray-400); }
.sp-subtab.is-active { border-color: #2563EB; background: #EFF6FF; color: #2563EB; }

/* Part 4: badge thời gian chuẩn bị / nói */
.sp-p4-badge { display: inline-flex; align-items: center; gap: 10px; background: #FEF3C7; border: 1px solid #FDE68A; color: #92400E; font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 10px; margin: 0 0 20px; }
.sp-p4-badge .sp-p4-sep { color: #D97706; }

.sp-sampletoggle { display: block; width: 100%; cursor: pointer; background: #fff; border: 1.5px solid #BFDBFE; border-radius: 12px; padding: 15px; font-size: 15px; font-weight: 700; color: #2563EB; transition: background .15s ease; }
.sp-sampletoggle:hover, .sp-sampletoggle.is-active { background: #EFF6FF; border-color: #2563EB; }
.sp-subpanel .sp-sample { margin-top: 16px; }

@media (max-width: 640px) {
  .sp-qrow { flex-direction: column; }
  .sp-record { align-self: center; }
  .sp-question { font-size: 22px; }
  .sp-tabs, .sp-subtabs, .sp-image-pair { grid-template-columns: 1fr; }
}

/* ===== Exam mode ===== */
.exam-body { background: #fff; display: flex; flex-direction: column; min-height: 100vh; }
.exam-top {
  display: flex; align-items: center; gap: 20px; padding: 14px 28px;
  position: sticky; top: 0; background: #fff; z-index: 50;
}
.exam-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--gray-800); flex: 1; }
.exam-timer { font-size: 15px; color: var(--gray-800); font-weight: 600; text-align: center; flex: 1; }
.exam-timer strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.exam-timer.warning strong { color: #DC2626; }
.exam-timer.times-up strong { color: #DC2626; }
.exam-label { font-weight: 800; color: var(--navy); flex: 1; text-align: right; }
.exam-progressbar { height: 3px; background: linear-gradient(90deg, #EF4444, #F97316); }

.exam-main { flex: 1; padding: 40px 28px 120px; }
.exam-content { max-width: 1100px; margin: 0 auto; }
.exam-qtitle { font-size: 38px; color: var(--gray-800); margin: 0 0 18px; font-weight: 800; }
.exam-qtitle .qnum { border-bottom: 3px solid var(--navy); padding: 0 10px; color: var(--navy); }
.exam-instruction { font-size: 16px; color: var(--gray-800); margin: 0 0 28px; }
.vn-note { color: var(--gray-400); font-size: 14px; }

/* Gap rows */
.q1-form { display: flex; flex-direction: column; gap: 14px; }
.gap-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  background: var(--gray-50); border: 1.5px solid var(--gray-100); border-radius: 12px;
  padding: 20px 24px; font-size: 17px; transition: all .15s ease;
}
.gap-text { color: var(--gray-800); }
.gap-select {
  padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; min-width: 120px; cursor: pointer;
}
.gap-select:focus { outline: none; border-color: var(--navy); }
.gap-mark { font-weight: 700; margin-left: auto; font-size: 14px; }
.gap-row.is-correct { background: #ECFDF5; border-color: #A7F3D0; }
.gap-row.is-correct .gap-mark { color: var(--emerald-600); }
.gap-row.is-correct .gap-select { border-color: var(--emerald); }
.gap-row.is-wrong { background: #FEF2F2; border-color: #FECACA; }
.gap-row.is-wrong .gap-mark { color: #DC2626; }
.gap-row.is-wrong .gap-select { border-color: #EF4444; }

.q1-result { margin-top: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.q1-score { font-size: 18px; color: var(--gray-800); background: var(--gray-100); padding: 12px 20px; border-radius: 10px; }
.q1-score.all-correct { background: #ECFDF5; color: var(--emerald-600); }
.q1-score strong { color: var(--navy); }
.q1-score.all-correct strong { color: var(--emerald-600); }

/* Bottom bar */
.exam-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--gray-100);
  border-top: 1px solid var(--gray-200); padding: 14px 28px; z-index: 50;
}
/* Back trái · nhóm giữa (Check + nút phụ) căn giữa · Next phải — dùng auto-margin
   để nhóm giữa luôn ở chính giữa dù có Check hay không. */
.exam-bottom-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.exam-bottom-inner > .exam-nav-btn:first-child { margin-right: auto; }
.exam-bottom-inner > .exam-nav-btn:last-child { margin-left: auto; }
.exam-nav-btn { min-width: 110px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 720px) {
  .exam-top { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .exam-brand, .exam-timer, .exam-label { flex: none; }
  .exam-brand { flex: 1; }
  .exam-timer { order: 3; width: 100%; text-align: left; }
  .exam-main { padding: 24px 16px 110px; }
  .exam-qtitle { font-size: 28px; }
  .gap-row { padding: 16px; font-size: 16px; }
  .exam-nav-btn { min-width: 90px; }
}

/* ĐIỆN THOẠI: footer 2 hàng.
   Hàng trên = các nút phụ (Mẹo/Dịch/AI/đáp án...) chia đều (1→giữa, 2→đôi, 3→ba).
   Hàng dưới = Back (icon ←) · Check result (giữa) · Next (icon →). */
@media (max-width: 640px) {
  .exam-bottom { padding: 10px 14px; }
  .exam-bottom-inner { flex-wrap: wrap; gap: 10px; justify-content: space-between; }
  .exam-bottom-inner > .exam-nav-btn:first-child,
  .exam-bottom-inner > .exam-nav-btn:last-child { margin: 0; }

  /* Hàng trên */
  .exam-center-btns { order: -1; flex: 1 0 100%; gap: 8px; }
  .exam-center-btns > * { flex: 1; min-width: 0; justify-content: center; text-align: center; }

  /* Hàng dưới: Check/nút chính chiếm giữa (co được để nút dài không đẩy Next rớt hàng) */
  .exam-check { flex: 1; min-width: 0; }
  .exam-bottom-inner > .exam-nav-btn { flex: 0 0 auto; min-width: 0; font-size: 0; padding: 12px 18px; }
  .exam-bottom-inner > .exam-nav-btn::before { font-size: 22px; line-height: 1; font-weight: 700; }
  .exam-bottom-inner > .exam-nav-btn:first-child::before { content: "\2190"; }  /* ← */
  .exam-bottom-inner > .exam-nav-btn:last-child::before { content: "\2192"; }   /* → */
}

/* ===== Modal review (chấm điểm) ===== */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,.3);
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; border-bottom: 1px solid var(--gray-200);
}
.modal-title { margin: 0; font-size: 21px; color: var(--gray-800); font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 30px; line-height: 1; color: var(--gray-400);
  cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--gray-800); }
.modal-body { padding: 24px; }
.modal-score { text-align: center; font-size: 27px; font-weight: 800; color: var(--emerald-600); margin-bottom: 6px; }
.modal-class { text-align: center; font-size: 24px; font-weight: 800; color: #2563EB; margin-bottom: 22px; }

.review-table { width: 100%; border-collapse: collapse; }
.review-table th, .review-table td {
  border: 1px solid var(--gray-200); padding: 14px 16px; text-align: center; font-size: 16px;
}
.review-table th { font-weight: 700; color: var(--gray-800); }
.review-table td.ans-correct { color: var(--emerald-600); font-weight: 600; }
.review-table td.ans-wrong { color: #DC2626; font-weight: 600; }
.review-table td.ans-empty { color: #DC2626; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Nút Mẹo (bóng đèn phát sáng) */
.exam-center-btns { display: flex; align-items: center; gap: 10px; }
.btn-tip {
  background: #FEF3C7; color: #92400E; border-color: #FDE68A;
}
.btn-tip:hover { background: #FDE68A; color: #92400E; transform: translateY(-1px); }
.tip-bulb { display: inline-block; filter: drop-shadow(0 0 0 rgba(251,191,36,0)); animation: bulbGlow 1.8s ease-in-out infinite; }
@keyframes bulbGlow {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(251,191,36,.4)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 8px rgba(251,191,36,.95)); transform: scale(1.12); }
}

/* Modal mẹo */
.modal-card-tip { max-width: 520px; }
.tip-hint { color: var(--gray-600); font-size: 15px; margin: 0 0 14px; }
.tip-sentence {
  margin: 0; padding: 20px 22px; font-size: 19px; line-height: 1.7; color: var(--gray-800);
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border-left: 5px solid #F59E0B;
  border-radius: 12px; font-weight: 500;
}
/* Part 4: mẹo nhiều dòng (mỗi người A/B/C/D một dòng) */
.tip-sentence-multi { white-space: pre-line; font-size: 16px; }
.tip-badge {
  display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700;
  color: var(--emerald-600); background: rgba(16,185,129,.12); padding: 5px 12px; border-radius: 999px;
}
.tip-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-top: 18px; }
/* 2 nút (Sửa mẹo · Khôi phục) rộng bằng nhau + kéo hết chiều ngang modal.
   1 nút -> full width; màn hẹp -> tự xuống dòng mỗi nút full width. */
.tip-controls .btn { flex: 1 1 200px; justify-content: center; text-align: center; }
.tip-login-note { margin: 4px 0 0; font-size: 14px; color: var(--gray-600); }
.tip-login-note a { font-weight: 700; }
.tip-textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--gray-200); border-radius: 12px;
  font-family: inherit; font-size: 17px; line-height: 1.6; resize: vertical; color: var(--gray-800);
}
.tip-textarea:focus { outline: none; border-color: #F59E0B; }
.tip-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.tip-msg { margin-right: auto; font-size: 13px; color: var(--gray-600); }

/* ===== Part 2+3: sắp xếp câu (kéo thả) ===== */
.q2-subtitle { font-size: 26px; font-weight: 800; color: var(--gray-800); margin: 0 0 18px; }
.q2-subtitle .qnum { border-bottom: 3px solid var(--navy); padding: 0 8px; color: var(--navy); }
.q2-topic { font-size: 20px; color: var(--navy); margin: 0 0 18px; font-weight: 700; }

.q2-area { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.q2-panel {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 14px;
  padding: 20px; min-height: 320px;
}
.q2-pool.drag-over { background: #EFF6FF; border-color: var(--navy); }

.q2-slot-row { display: flex; align-items: stretch; gap: 12px; margin-bottom: 12px; }
.q2-slot-num {
  flex: 0 0 28px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--gray-400); font-size: 15px;
}
.q2-slot {
  flex: 1; min-height: 54px; border: 1.5px dashed var(--gray-400); border-radius: 10px;
  background: #fff; display: flex; align-items: center; transition: all .12s ease;
}
.q2-slot.drag-over { border-color: var(--navy); border-style: solid; background: #EFF6FF; }
.q2-slot.filled { border-style: solid; border-color: var(--gray-200); padding: 0; }
.q2-slot.is-correct { border-color: var(--emerald); background: #ECFDF5; }
.q2-slot.is-wrong { border-color: #EF4444; background: #FEF2F2; }
.q2-slot .q2-card { margin: 0; width: 100%; }

.q2-card {
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px; font-size: 15.5px; line-height: 1.55; color: var(--gray-800);
  cursor: grab; user-select: none; transition: box-shadow .12s ease, border-color .12s ease;
}
.q2-card:last-child { margin-bottom: 0; }
.q2-card:hover { box-shadow: var(--shadow); border-color: var(--navy); }
.q2-card:active { cursor: grabbing; }
.q2-card.dragging { opacity: .5; }
.q2-card.selected { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.2); }

.review-table.q2-review td { text-align: left; }

@media (max-width: 720px) {
  .q2-area { grid-template-columns: 1fr; gap: 16px; }
  .q2-panel { min-height: auto; }
  .q2-card { font-size: 15px; }
}

/* ===== Part 4: ghép câu hỏi với người ===== */
.q4-people { margin-bottom: 30px; }
.q4-person { margin-bottom: 18px; }
.q4-person-name { margin: 0 0 6px; color: var(--navy); font-size: 16px; font-weight: 700; }
.q4-person-text { margin: 0; color: var(--gray-800); font-size: 15.5px; line-height: 1.65; }

/* Câu hỏi căn phải đồng bộ */
.q4-questions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.q4-qrow {
  display: flex; flex-direction: column; gap: 6px; max-width: 100%;
  background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px;
  padding: 10px 14px;
}
.q4-qmain { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q4-qlabel { color: var(--gray-800); font-size: 15.5px; flex: 1 1 auto; }
.q4-dash { color: var(--gray-400); }
.q4-select {
  padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; min-width: 72px; cursor: pointer;
}
.q4-select:focus { outline: none; border-color: var(--navy); }
.q4-qrow.is-correct { background: #ECFDF5; border-color: #A7F3D0; }
.q4-qrow.is-correct .q4-select { border-color: var(--emerald); }
.q4-qrow.is-wrong { background: #FEF2F2; border-color: #FECACA; }
.q4-qrow.is-wrong .q4-select { border-color: #EF4444; }

/* Modal so sánh đáp án (3 cột) */
.modal-card-wide { max-width: 760px; }
.modal-compare-title { text-align: center; font-size: 27px; font-weight: 800; color: var(--gray-800); margin-bottom: 20px; }
.review-table.q4-review td { text-align: center; }
.review-table.q4-review td.q4-qcell { text-align: center; color: var(--gray-800); }

@media (max-width: 720px) {
  .q4-questions { align-items: stretch; }
  .q4-qrow { flex-wrap: wrap; }
  .q4-qlabel { text-align: left; }
  .review-table.q4-review th, .review-table.q4-review td { padding: 8px; font-size: 13px; }
}

/* ===== Part 5: chọn tiêu đề cho đoạn ===== */
.q5-title { font-size: 30px; font-weight: 800; color: var(--gray-800); margin: 0 0 22px; }
.q5-paras { display: flex; flex-direction: column; gap: 26px; }
.q5-para-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q5-num { font-weight: 700; color: var(--gray-800); font-size: 16px; min-width: 24px; }
.q5-select {
  flex: 1; max-width: 580px; padding: 10px 14px; border: 1.5px solid var(--gray-300, #D1D5DB);
  border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff; cursor: pointer;
}
.q5-select:focus { outline: none; border-color: var(--navy); }
.q5-para-text { margin: 0; color: var(--gray-800); font-size: 15.5px; line-height: 1.7; }
.q5-para.is-correct .q5-select { border-color: var(--emerald); background: #ECFDF5; }
.q5-para.is-wrong .q5-select { border-color: #EF4444; background: #FEF2F2; }

/* Điểm trong modal so sánh (chữ tối, nhỏ hơn tiêu đề) */
.compare-score { text-align: center; font-size: 18px; font-weight: 700; color: var(--gray-800); margin: -6px 0 20px; }
.compare-score.all-correct { color: var(--emerald-600); }
.review-table.q5-review td { text-align: center; }
.review-table.q5-review td.q5-numcell { font-weight: 700; color: var(--gray-800); }

@media (max-width: 720px) {
  .q5-title { font-size: 24px; }
  .q5-select { max-width: 100%; }
  .review-table.q5-review th, .review-table.q5-review td { padding: 8px; font-size: 13px; }
  /* Nút "Dịch đáp án" cạnh dropdown bị chật -> cho xuống dòng riêng (canh dưới select). */
  .q5-para-head { flex-wrap: wrap; }
  .q5-para-head .js-tr-open { flex-basis: 100%; margin-left: 34px; margin-top: 2px; }
}

/* ===== Tra từ vựng & dịch câu (Part 1) ===== */
.gap-item { display: flex; flex-direction: column; }
.vocab-word { position: relative; cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background .1s ease; }
.vocab-word:hover { background: #FEF3C7; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
/* Tooltip báo cho user biết bấm vào để dịch */
.vocab-word:hover::after {
  content: "Ấn vào để dịch sang tiếng Việt";
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px; padding: 5px 9px; border-radius: 6px;
  background: var(--gray-800); color: #fff; font-size: 12px; font-weight: 400;
  line-height: 1.2; white-space: nowrap; letter-spacing: 0; z-index: 400;
  pointer-events: none; box-shadow: var(--shadow);
}
.vocab-word:hover::before {
  content: ""; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 1px; border: 5px solid transparent; border-top-color: var(--gray-800);
  z-index: 400; pointer-events: none;
}

.gap-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px 2px; }
.btn-sentence-vi {
  background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-sentence-vi:hover:not(:disabled) { background: #DBEAFE; }
.btn-sentence-vi:disabled { opacity: .5; cursor: not-allowed; }
.sentence-vi {
  font-size: 15px; color: var(--gray-800); background: #ECFDF5; border-left: 4px solid var(--emerald);
  border-radius: 8px; padding: 8px 14px; margin-top: 6px;
}

/* ===== Nút "Dịch" + khối dịch dùng chung (tr-block / translate-modal) ===== */
.btn-translate {
  background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-translate:hover { background: #DBEAFE; }
.btn-translate.btn-sm { padding: 4px 11px; font-size: 12.5px; }
.tr-block { margin: 2px 0; }
.tr-en { font-size: 15.5px; line-height: 1.75; color: var(--gray-800); }
.tr-tools { margin-top: 6px; }
/* Bản dịch tiếng Việt (Part 4/5) xuống hẳn dòng riêng, không nằm cạnh nút Dịch.
   Dùng :not([hidden]) để khi CHƯA dịch (còn hidden) không hiện khối xanh rỗng. */
.tr-tools .sentence-vi:not([hidden]) { display: block; margin-top: 8px; }
.tr-modal-list { margin: 8px 0 0; padding-left: 24px; display: flex; flex-direction: column; gap: 18px; }
.tr-modal-item { padding-bottom: 2px; }

.vocab-popup {
  position: absolute; z-index: 300; background: #fff; border: 1px solid var(--gray-200);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 14px; max-width: 320px;
  display: flex; flex-direction: column; gap: 4px;
}
.vocab-popup[hidden] { display: none; }
.vp-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.vp-word { font-weight: 700; color: var(--navy); font-size: 16px; }
.vp-pos { font-size: 11.5px; color: var(--gray-500); font-style: italic; }
.vp-phon { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.vp-accent { font-size: 10.5px; font-weight: 700; color: var(--gray-500); }
.vp-ipa { color: var(--gray-700); font-size: 13px; }
.vp-audio { background: var(--gray-100); border: none; border-radius: 6px; padding: 2px 7px; cursor: pointer; font-size: 12.5px; }
.vp-audio:hover { background: var(--gray-200); }
.vp-meaning { color: var(--gray-800); font-size: 14px; font-weight: 600; }
.vp-dim { color: var(--gray-400); font-weight: 400; }
.vp-img { max-width: 100%; border-radius: 8px; margin: 2px 0; }
.vp-example { font-size: 12.5px; color: var(--gray-700); font-style: italic; border-left: 3px solid var(--gray-200); padding-left: 8px; }
.vp-example-vi { display: block; color: var(--gray-500); font-style: normal; margin-top: 2px; }
.vp-colloc { font-size: 12px; color: var(--gray-600); }
.vp-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; border-top: 1px solid var(--gray-100); padding-top: 8px; }
.vp-save { background: var(--emerald); color: #fff; border: none; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.vp-save:disabled { opacity: .5; cursor: default; }
.vp-status { font-size: 12px; color: var(--gray-600); }
.vp-status a { font-weight: 700; }

/* Thẻ kho từ vựng của tôi (giàu) */
.vocab-pos { font-size: 11px; color: var(--gray-500); font-style: italic; font-weight: 400; }
.vocab-phon { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 6px; }
.vocab-accent { font-size: 10.5px; font-weight: 700; color: var(--gray-500); }
.vocab-ipa { color: var(--gray-700); }
.vocab-audio { background: var(--gray-100); border: none; border-radius: 6px; padding: 2px 7px; cursor: pointer; font-size: 12.5px; }
.vocab-audio:hover { background: var(--gray-200); }
.vocab-img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.vocab-example { font-size: 12.5px; color: var(--gray-700); font-style: italic; border-left: 3px solid var(--gray-200); padding-left: 8px; margin-top: 8px; }
.vocab-example-vi { display: block; color: var(--gray-500); font-style: normal; margin-top: 2px; }
.vocab-colloc { font-size: 12px; color: var(--gray-600); margin-top: 8px; }

.vocab-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.vocab-topbar .vocab-count { margin: 0; }

/* Tab kho từ vựng (Của tôi + các chủ đề) */
.vocab-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; border-bottom: 2px solid var(--gray-100); padding-bottom: 2px; }
.vocab-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 10px 10px 0 0; font-weight: 600; font-size: 14px; color: var(--gray-600); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.vocab-tab:hover { color: var(--navy); background: var(--gray-50); }
.vocab-tab.is-active { color: var(--navy); border-bottom-color: var(--gold, #F59E0B); background: var(--gray-50); }
.vocab-tab-n { font-size: 11px; font-weight: 700; background: var(--gray-200); color: var(--gray-700); border-radius: 999px; padding: 1px 7px; }
.vocab-tab.is-active .vocab-tab-n { background: var(--gold, #F59E0B); color: #fff; }

/* Nút Lưu trên thẻ tab chủ đề */
.vocab-save { position: absolute; top: 10px; right: 10px; border: 1px solid var(--emerald); background: #fff; color: #065F46; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.vocab-save:hover:not(:disabled) { background: #ECFDF5; }
.vocab-save.is-saved { background: var(--emerald); color: #fff; border-color: var(--emerald); cursor: default; }

/* ===== Ôn từ vựng (flashcard + gõ chính tả) ===== */
.vr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.vr-modes { display: inline-flex; background: var(--gray-100); border-radius: 10px; padding: 4px; gap: 4px; }
.vr-mode { border: none; background: transparent; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--gray-600); font-family: inherit; }
.vr-mode.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.vr-toolbar-right { display: flex; align-items: center; gap: 12px; }
.vr-progress { font-size: 14px; color: var(--gray-600); }
.vr-progress strong { color: var(--navy); font-size: 16px; }

.vr-stage { max-width: 560px; margin: 0 auto; }

/* Flashcard: lật 3D */
.vr-card { perspective: 1200px; height: 260px; cursor: pointer; margin-bottom: 18px; }
.vr-card-inner { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.vr-card.is-flipped .vr-card-inner { transform: rotateY(180deg); }
.vr-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; border-radius: 16px; border: 1px solid var(--gray-200); background: #fff; box-shadow: var(--shadow-lg); text-align: center; }
.vr-front { }
.vr-back { transform: rotateY(180deg); background: #FFFBEB; }
.vr-word { font-size: 34px; font-weight: 800; color: var(--navy); }
.vr-phon { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 14px; }
.vr-accent { font-size: 11px; font-weight: 700; color: var(--gray-500); }
.vr-ipa { color: var(--gray-700); }
.vr-audio { background: var(--gray-100); border: none; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 15px; }
.vr-audio:hover { background: var(--gray-200); }
.vr-hint-text { font-size: 12.5px; color: var(--gray-400); }
.vr-meaning { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.vr-pos { font-size: 14px; color: var(--gray-500); font-weight: 400; font-style: italic; }
.vr-example { font-size: 14px; color: var(--gray-600); font-style: italic; }
.vr-ex-vi { display: block; color: var(--gray-500); font-style: normal; margin-top: 4px; }
.vr-syn { display: block; color: var(--gray-600); font-style: normal; font-size: 13px; margin-top: 8px; }
.vr-controls { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.vr-know { border: 1px solid var(--gray-300); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; }
.vr-known { border-color: var(--emerald); color: #065F46; }

/* Gõ chính tả */
.vr-spell-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 24px; text-align: center; }
.vr-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 18px 0; }
.vr-slot { min-width: 26px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-bottom: 3px solid var(--gray-300); font-size: 24px; font-weight: 700; color: var(--gray-400); text-transform: none; }
.vr-slot.is-shown { color: var(--navy); border-bottom-color: var(--gold, #F59E0B); }
.vr-slot-space { min-width: 18px; border-bottom: none; }
.vr-input { width: 100%; max-width: 380px; font-size: 20px; text-align: center; padding: 12px 14px; border: 2px solid var(--gray-200); border-radius: 12px; font-family: inherit; }
.vr-input:focus { outline: none; border-color: var(--navy); }
.vr-spell-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.vr-feedback { min-height: 22px; margin-top: 14px; font-weight: 600; }
.vr-feedback.is-ok { color: #059669; }
.vr-feedback.is-err { color: #DC2626; }

/* Bộ lọc tiến độ */
.vr-filter-lbl { font-size: 13px; color: var(--gray-600); display: inline-flex; align-items: center; gap: 6px; }
.vr-filter { border: 1px solid var(--gray-300); border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 13px; background: #fff; }

/* Trắc nghiệm */
.vr-quiz-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 24px; text-align: center; }
.vr-quiz-q { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.vr-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.vr-opt { border: 2px solid var(--gray-200); background: #fff; border-radius: 12px; padding: 14px 16px; font-size: 15px; font-weight: 600; color: var(--gray-800); cursor: pointer; font-family: inherit; text-align: left; transition: border-color .15s, background .15s; }
.vr-opt:hover:not(:disabled) { border-color: var(--navy); }
.vr-opt:disabled { cursor: default; }
.vr-opt.is-correct { border-color: var(--emerald); background: #ECFDF5; color: #065F46; }
.vr-opt.is-wrong { border-color: #DC2626; background: #FEF2F2; color: #991B1B; }
@media (max-width: 480px) { .vr-word { font-size: 28px; } .vr-card { height: 220px; } .vr-options { grid-template-columns: 1fr; } }

/* ===== Listening: audio + câu hỏi ===== */
.lis-audio { width: 100%; height: 44px; margin-bottom: 22px; }

/* Đề mới chưa có audio / paragraph */
.lis-empty-note { background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 10px; padding: 14px 16px; color: var(--gray-600); font-size: 15px; margin-bottom: 18px; }

/* Modal Mẹo ghi nhớ — Câu 15 */
.q15-tip p { margin: 0 0 8px; color: var(--gray-800); font-size: 15px; line-height: 1.6; }
.q15-tip-rule { color: var(--gray-700); }
.q15-tip-seq { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.q15-tip-cell { display: flex; flex-direction: column; align-items: center; min-width: 66px; border-radius: 8px; padding: 6px 8px; border: 1px solid var(--gray-200); }
.q15-tip-ans { font-size: 12.5px; font-weight: 700; }
.q15-tip-digit { font-size: 22px; font-weight: 800; line-height: 1.1; }
.q15-w-man { background: #EFF6FF; } .q15-w-man .q15-tip-ans, .q15-w-man .q15-tip-digit { color: #1E40AF; }
.q15-w-woman { background: #FDF2F8; } .q15-w-woman .q15-tip-ans, .q15-w-woman .q15-tip-digit { color: #BE185D; }
.q15-w-both { background: #F5F3FF; } .q15-w-both .q15-tip-ans, .q15-w-both .q15-tip-digit { color: #6D28D9; }
.q15-tip-num { font-size: 16px; }
.q15-tip-num strong, .q15-tip-decode strong { letter-spacing: 2px; color: var(--navy); }
.q15-tip-story { background: #ECFDF5; border-left: 4px solid var(--emerald); border-radius: 8px; padding: 12px 14px; font-size: 16px; font-weight: 600; color: #065F46; margin: 8px 0 10px; }
.q15-tip-story-wrap { margin: 8px 0 10px; }
.q15-story-badge { display: inline-block; background: var(--emerald); color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.q15-story-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.q15-tip-exam { background: rgba(30,58,138,.06); border: 1px solid rgba(30,58,138,.15); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.q15-tip-exam-h { font-weight: 700; color: var(--navy); }
.q15-tip-muted { color: var(--gray-500); font-size: 13.5px; }

/* ===== Chấm AI (Writing) ===== */
.ai-status { padding: 16px; text-align: center; color: var(--gray-700); font-size: 15px; }
.ai-status-err { color: #b91c1c; }
.ai-status .ai-miss-link { color: #b91c1c; font-weight: 700; text-decoration: underline; }
.ai-status .ai-miss-link:hover { color: #7f1d1d; }
.ai-band { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.ai-band strong { color: var(--emerald-600); }
.ai-target { font-size: 14px; font-weight: 600; color: var(--gray-500); }
.ai-overall { color: var(--gray-800); font-size: 15px; line-height: 1.6; margin: 0 0 14px; }
.ai-sec { margin: 12px 0; }
.ai-sec h4 { margin: 0 0 6px; font-size: 15px; color: var(--gray-800); }
.ai-sec ul { margin: 0; padding-left: 22px; }
.ai-sec li { margin: 3px 0; color: var(--gray-700); font-size: 14.5px; line-height: 1.55; }
.ai-good h4 { color: var(--emerald-600); }
.ai-warn h4 { color: #C55A11; }
.ai-part { border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--gray-50); }
.ai-part-h { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.ai-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--gray-200); flex-wrap: wrap; }
.ai-remain { font-size: 13.5px; color: var(--gray-500); }
.ai-history-link { font-weight: 700; color: var(--navy); }

/* Trang lịch sử chấm AI */
.ai-hist-wrap { max-width: 820px; }
.ai-empty { color: var(--gray-600); background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 10px; padding: 18px; }
.ai-hist-item { border: 1px solid var(--gray-200); border-radius: 10px; margin-bottom: 12px; background: #fff; }
.ai-hist-item > summary { cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-hist-band { font-weight: 800; color: var(--emerald-600); }
.ai-hist-pending { color: var(--gray-400); }
.ai-hist-item.is-ungraded > summary { border-left: 3px solid var(--gray-300); }
.ai-hist-gradebox { padding: 8px 0 4px; }
.wr-hist-msg { font-size: 13.5px; color: var(--gray-500); margin-left: 8px; }
.wr-hist-err { color: #b91c1c; }
/* Nút xác nhận/hoàn thành trong modal */
.ai-confirm-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.ai-hist-club { font-weight: 600; color: var(--gray-800); }
.ai-hist-date { margin-left: auto; font-size: 13px; color: var(--gray-500); }
.ai-hist-body { padding: 0 16px 16px; }
.ai-hist-answers { margin-top: 12px; }
.ai-hist-answers > summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: 14px; }
.ai-ans-blk { margin: 8px 0; font-size: 14px; color: var(--gray-700); }

.lis-qbox { background: var(--gray-100); border-radius: 12px; padding: 24px 26px; margin-bottom: 20px; }
.lis-question { font-weight: 700; font-size: 17px; color: var(--gray-800); margin-bottom: 6px; }
.lis-question-vi { color: var(--emerald-600); font-size: 15px; margin: 4px 0 14px; }
.lis-options { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.lis-option { display: flex; align-items: baseline; gap: 10px; cursor: pointer; font-size: 16px; color: var(--gray-800); }
.lis-option input { width: 18px; height: 18px; accent-color: var(--navy); cursor: pointer; position: relative; top: 3px; }
.lis-opt-vi { color: var(--emerald-600); font-size: 14px; }
.lis-tools { margin-top: 16px; }

.lis-para-toggle-wrap { margin-bottom: 14px; }
.btn-para-toggle { background: #2563EB; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-para-toggle:hover { background: #1D4ED8; }
.lis-paragraph { border: 1px solid var(--gray-200); border-radius: 12px; padding: 20px 24px; }
.lis-para-label { font-weight: 700; color: var(--gray-800); margin-bottom: 10px; }
.lis-para-text { margin: 0; line-height: 1.85; color: var(--gray-800); font-size: 15.5px; }
.para-vi { background: #ECFDF5; border-left: 4px solid var(--emerald); border-radius: 8px; padding: 10px 14px; color: var(--gray-800); font-size: 15px; margin-top: 12px; }

/* ===== Listening Câu 14 ===== */
.q14-topic { font-size: 18px; font-weight: 700; color: var(--gray-800); margin: 0 0 10px; }
.q14-instruction { color: var(--gray-700, #374151); font-size: 15px; margin: 0 0 20px; }
.q14-persons { display: flex; flex-direction: column; gap: 14px; }
.q14-prow { display: flex; align-items: center; gap: 16px; }
.q14-plabel { min-width: 74px; color: var(--gray-800); font-size: 15px; }
.q14-select {
  flex: 1; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; cursor: pointer;
}
.q14-select:focus { outline: none; border-color: var(--navy); }
.q14-prow.is-correct .q14-select { border-color: var(--emerald); background: #ECFDF5; }
.q14-prow.is-wrong .q14-select { border-color: #EF4444; background: #FEF2F2; }

.q14-answers-vi { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.q14-ans-vi-row { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px 12px; }
.q14-ans-en { color: var(--gray-800); }
.q14-ans-vi { color: var(--emerald-600); }

.q14-para-block { margin-bottom: 16px; }
.q14-person-para { margin: 0; line-height: 1.8; color: var(--gray-800); font-size: 15.5px; }
.q14-para-vi { margin-top: 6px; color: var(--emerald-600); font-size: 14.5px; background: #ECFDF5; border-left: 3px solid var(--emerald); border-radius: 6px; padding: 6px 12px; }

@media (max-width: 720px) {
  .q14-prow { flex-direction: column; align-items: stretch; gap: 4px; }
  .q14-plabel { min-width: 0; font-weight: 600; }
}

/* ===== Listening Câu 15 (Man/Woman/Both) ===== */
.q15-statements { display: flex; flex-direction: column; gap: 14px; }
.q15-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.q15-stext { color: var(--gray-800); font-size: 15.5px; }
.q15-num { font-weight: 700; margin-right: 2px; }
.q15-select {
  padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff; cursor: pointer; min-width: 190px;
}
.q15-select:focus { outline: none; border-color: var(--navy); }
.q15-row.is-correct .q15-select { border-color: var(--emerald); background: #ECFDF5; }
.q15-row.is-wrong .q15-select { border-color: #EF4444; background: #FEF2F2; }
.q15-vi { flex-basis: 100%; color: var(--emerald-600); font-size: 14px; margin-left: 18px; }

/* ===== Listening Câu 16 & 17 (bài dài + câu con) ===== */
.l1617-sub { margin-bottom: 22px; }
.l1617-q { font-weight: 600; font-size: 15.5px; color: var(--gray-800); margin-bottom: 4px; }
.l1617-qid { font-weight: 700; margin-right: 4px; }
.l1617-q-vi { color: var(--emerald-600); font-size: 14px; margin: 4px 0 8px; }

/* ===== Writing: danh sách câu lạc bộ ===== */
/* Dải tổng quan trên đầu trang danh sách CLB */
.wr-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px;
}
.wr-sum-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px;
  background: linear-gradient(135deg, rgba(30,58,138,.06), rgba(5,150,105,.06));
  border: 1px solid var(--gray-200); border-radius: var(--radius);
}
.wr-sum-num { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
.wr-sum-num.wr-sum-band { color: var(--emerald-600); }
.wr-sum-label { font-size: 12.5px; color: var(--gray-500); text-align: center; }

.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.club-card {
  display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: all .15s ease;
}
.club-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--navy); }
.club-card.is-done { border-color: rgba(5,150,105,.4); }
.club-card-top { display: flex; align-items: center; gap: 12px; }
.club-num { width: 42px; height: 42px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(30,58,138,.1); color: var(--navy); font-weight: 800; border-radius: 10px; font-size: 15px; }
.club-name { font-weight: 700; color: var(--gray-800); font-size: 16px; flex: 1; line-height: 1.3; }
.club-band {
  flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--emerald-700, #047857);
  background: rgba(5,150,105,.12); padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}

.club-stats { display: flex; gap: 10px; }
.club-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px; background: var(--gray-50, #f9fafb); border-radius: 10px;
}
.club-stat-num { font-size: 20px; font-weight: 800; color: var(--navy); line-height: 1; }
.club-stat-label { font-size: 11.5px; color: var(--gray-500); }

.club-actions { display: flex; gap: 10px; margin-top: 2px; }
.club-btn { flex: 1; text-align: center; padding: 9px 10px; font-size: 14px; }

@media (max-width: 640px) {
  .wr-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Writing: thực hành ===== */
.wr-content { max-width: 1000px; }
.wr-instruction { font-weight: 700; color: var(--gray-800); font-size: 16px; margin: 0 0 26px; line-height: 1.6; }
.wr-list { display: flex; flex-direction: column; gap: 22px; }
.wr-block { }
.wr-q { display: block; color: var(--gray-800); font-size: 15.5px; margin-bottom: 8px; }
.wr-q.wr-strong { font-weight: 700; }
.wr-email-main { color: var(--gray-700, #374151); font-size: 15px; line-height: 1.7; margin: 0 0 8px; }
.wr-input, .wr-textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--gray-800);
}
.wr-input:focus, .wr-textarea:focus { outline: none; border-color: var(--navy); }
.wr-textarea { resize: vertical; line-height: 1.6; }
.wr-wc { text-align: right; color: var(--gray-600); font-size: 14px; margin-top: 6px; }
.wr-sample {
  margin-top: 10px; background: #ECFDF5; border-left: 4px solid var(--emerald);
  border-radius: 8px; padding: 12px 16px; color: var(--gray-800); font-size: 15px; line-height: 1.7;
}
.wr-sample-label { font-weight: 700; color: var(--emerald-600); }
/* Đáp án theo band mục tiêu — tông navy để phân biệt với đáp án mẫu chung (xanh lá).
   Không set `display` -> giữ nguyên [hidden]{display:none} mặc định của trình duyệt. */
.wr-sample-band {
  margin-top: 8px; background: #EEF2FF; border-left: 4px solid var(--navy);
  border-radius: 8px; padding: 12px 16px; color: var(--gray-800); font-size: 15px; line-height: 1.7;
}
.wr-sample-band-label { font-weight: 700; color: var(--navy); }
/* Nút "Đáp án band X" (navy) — cạnh nút "Đáp án mẫu" (cyan). */
.btn-band { background: var(--navy); color: #fff; border: none; }
.btn-band:hover { background: #16223f; color: #fff; }

/* Nút Đáp án mẫu (cyan) */
.btn-info { background: #22CDE6; color: #083344; border: none; }
.btn-info:hover { background: #10bcd6; color: #083344; }

/* ===== Trang kho từ vựng ===== */
.vocab-count { color: var(--gray-600); margin-bottom: 16px; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.vocab-card { position: relative; background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.vocab-en { font-weight: 700; color: var(--navy); font-size: 17px; margin-bottom: 4px; }
.vocab-vi { color: var(--gray-600); font-size: 14.5px; }
.vocab-del { position: absolute; top: 6px; right: 10px; background: none; border: none; color: var(--gray-400); font-size: 20px; cursor: pointer; line-height: 1; }
.vocab-del:hover { color: #DC2626; }

@media (max-width: 720px) {
  .lis-qbox { padding: 18px; }
}

@media (max-width: 560px) {
  .modal-title { font-size: 18px; }
  .modal-score { font-size: 23px; }
  .modal-class { font-size: 20px; }
  .review-table th, .review-table td { padding: 10px; font-size: 14px; }
}


/* ==========================================================================
   Pop-up "Mới cập nhật" (góc phải dưới) — chỉ dùng ở trang chủ
   ========================================================================== */
.announce {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .25s ease;
}
.announce.is-open { opacity: 1; transform: translateY(0); }
.announce-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; background: var(--navy); color: var(--white);
}
.announce-title { font-size: 14px; font-weight: 700; }
.announce-min {
  border: 0; background: transparent; color: rgba(255, 255, 255, .85);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; font-weight: 700;
}
.announce-min:hover { color: var(--white); }
.announce-scroll { max-height: 232px; overflow: hidden; position: relative; }
/* Rê chuột vào -> JS chuyển sang cuộn tay (xem announce.js). */
.announce-scroll.is-manual { overflow-y: auto; }
.announce-track { list-style: none; margin: 0; padding: 0; }
.announce-track.is-scrolling {
  animation: announce-scroll var(--announce-duration, 18s) linear infinite;
}
@keyframes announce-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-1 * var(--announce-shift, 0px))); }
}
.announce-item + .announce-item { border-top: 1px solid var(--gray-100); }
.announce-row {
  display: flex; gap: 10px; padding: 12px 14px;
  text-decoration: none; color: inherit; transition: background .15s ease;
}
.announce-row.is-link:hover { background: var(--gray-50); }
.announce-icon { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.announce-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.announce-body b { font-size: 14px; color: var(--navy); }
.announce-text { font-size: 13px; color: var(--gray-600); line-height: 1.45; }
.announce-date { font-size: 12px; color: var(--gray-400); }
.announce-row.is-link:hover .announce-body b { color: var(--emerald-600); }

/* Bong bóng thu gọn (thay cho việc đóng hẳn). */
.announce-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--navy); color: #fff; font-size: 24px; line-height: 1;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.announce-bubble:hover { transform: scale(1.08); }
.announce-bubble-dot {
  position: absolute; top: 12px; right: 12px; width: 10px; height: 10px;
  background: var(--orange); border-radius: 50%; border: 2px solid var(--navy);
}

@media (max-width: 480px) {
  .announce { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .announce-bubble { right: 14px; bottom: 14px; }
}

/* Người tắt hiệu ứng chuyển động: bỏ cuộn tự động, trả lại thanh cuộn tay */
@media (prefers-reduced-motion: reduce) {
  .announce { transition: none; }
  .announce-track.is-scrolling { animation: none; }
  .announce-scroll { overflow-y: auto; }
}

/* ==========================================================================
   Nhãn "đợt cập nhật gần nhất" trên thẻ dạng bài (overview từng kỹ năng)
   ========================================================================== */
.card.has-update { position: relative; border-color: rgba(249, 115, 22, .45); }
.update-flag {
  position: absolute; top: -10px; right: 14px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
  color: var(--white); background: var(--orange);
  padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(249, 115, 22, .35);
}

@media (max-width: 480px) {
  .update-flag { right: 10px; font-size: 11px; padding: 3px 8px; }
}

/* ==========================================================================
   Overlay thông báo toàn màn hình — chỉ dùng ở trang chủ
   ========================================================================== */
body.ovl-open { overflow: hidden; } /* khoá cuộn nền khi overlay mở */

.ovl {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s ease;
}
/* BẮT BUỘC: `display:flex` ở trên đè mất [hidden] mặc định của trình duyệt (CSS tác giả
   luôn thắng stylesheet trình duyệt) -> overlay vẫn phủ kín màn hình, trong suốt nhưng
   NUỐT HẾT CLICK của cả trang. Cùng lý do với .modal-overlay[hidden] / .vocab-popup[hidden]. */
.ovl[hidden] { display: none; }
.ovl.is-open { opacity: 1; }
.ovl-card {
  position: relative; width: 100%; max-width: 480px;
  background: var(--white); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 38px 32px 30px; text-align: center;
  max-height: calc(100vh - 40px); overflow-y: auto;
  transform: translateY(16px) scale(.97); transition: transform .22s ease;
}
.ovl.is-open .ovl-card { transform: translateY(0) scale(1); }
.ovl-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent; color: var(--gray-400);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.ovl-close:hover { color: var(--gray-800); background: var(--gray-100); }
.ovl-icon {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: linear-gradient(135deg, rgba(249, 115, 22, .14), rgba(16, 185, 129, .14));
}
.ovl-date {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--orange);
  background: rgba(249, 115, 22, .12); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.ovl-title { margin: 0 0 10px; font-size: 24px; line-height: 1.3; color: var(--navy); }
.ovl-text { margin: 0 0 22px; font-size: 15px; line-height: 1.6; color: var(--gray-600); }
.ovl-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ovl-actions .btn { min-width: 128px; }

/* Overlay mời dùng voucher (tông cam/vàng, biến thể khẩn cấp khi sắp hết hạn) */
.ovl-voucher .ovl-icon { background: linear-gradient(135deg, rgba(249, 115, 22, .18), rgba(234, 179, 8, .18)); }
.ovl-voucher .ovl-date { color: var(--orange-600, #EA580C); background: rgba(249, 115, 22, .12); }
.vq-countdown { display: inline-block; margin: 0 0 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--orange-600, #EA580C); background: rgba(249, 115, 22, .1); padding: 6px 12px; border-radius: 999px; }
.vq-urgent { color: #DC2626; }
.ovl-voucher.is-urgent .ovl-card { border: 2px solid #FCA5A5; }
.ovl-voucher.is-urgent .vq-countdown { color: #DC2626; background: rgba(220, 38, 38, .1); }

/* Khối kêu gọi vào tài khoản — chỉ hiện với khách chưa đăng nhập */
.ovl-guest { border-top: 1px solid var(--gray-200); margin-top: 4px; padding-top: 18px; }
.ovl-guest-note { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--gray-600); }
.ovl-guest-note strong { color: var(--navy); }
.ovl-later {
  display: block; margin: 14px auto 0; border: 0; background: transparent;
  font-size: 13px; color: var(--gray-400); cursor: pointer; text-decoration: underline;
}
.ovl-later:hover { color: var(--gray-600); }

@media (max-width: 480px) {
  .ovl-card { padding: 32px 20px 24px; }
  .ovl-title { font-size: 20px; }
  .ovl-actions { flex-direction: column-reverse; }
  .ovl-actions .btn { width: 100%; }
}

/* Người tắt hiệu ứng chuyển động: bỏ trượt/mờ, hiện thẳng */
@media (prefers-reduced-motion: reduce) {
  .ovl, .ovl-card { transition: none; }
}

/* ==========================================================================
   Ngữ pháp / Từ vựng — 25 câu trên 1 trang (.gq)
   ========================================================================== */
.gq-form { display: flex; flex-direction: column; gap: 14px; }
.gq-item {
  background: #fff; border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-200);
  border-radius: var(--radius); padding: 16px 18px; transition: border-color .15s ease;
}
.gq-item.is-correct { border-left-color: var(--emerald); background: #F0FDF9; }
.gq-item.is-wrong { border-left-color: #DC2626; background: #FEF6F6; }

.gq-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gq-num {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 800;
}
.gq-hint { font-size: 12px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .02em; }

.gq-body { position: relative; padding-right: 26px; }
.gq-text { margin: 0 0 10px; font-size: 16px; line-height: 1.9; color: var(--gray-800); }
.gq-keyword { font-size: 19px; color: var(--navy); }
.gq-mark { position: absolute; top: 0; right: 0; font-size: 17px; font-weight: 800; }
.gq-item.is-correct .gq-mark { color: var(--emerald-600); }
.gq-item.is-wrong .gq-mark { color: #DC2626; }

.gq-select {
  padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font); background: #fff; color: var(--gray-800);
  min-width: 170px; max-width: 100%;
}
.gq-select:focus { outline: 2px solid var(--emerald); outline-offset: -1px; }

/* Ngữ pháp: 3 lựa chọn dạng nút tròn */
.gq-opts { display: flex; gap: 9px; flex-wrap: wrap; }
.gq-opt {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 16px; border: 1px solid var(--gray-200); border-radius: 999px;
  background: #fff; font-size: 15px; transition: border-color .12s ease, background .12s ease;
}
.gq-opt:hover { border-color: var(--emerald); background: var(--gray-50); }
.gq-opt input { accent-color: var(--emerald); cursor: pointer; margin: 0; }
.gq-opt:has(input:checked) { border-color: var(--emerald); background: #ECFDF5; font-weight: 600; }

.gq-tools { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .gq-item { padding: 14px; }
  .gq-text { font-size: 15px; }
  .gq-opts { flex-direction: column; align-items: stretch; }
  .gq-opt { justify-content: flex-start; }
  .gq-select { width: 100%; }
}

/* ==========================================================================
   Tài khoản trả phí (VIP)
   ========================================================================== */
.nav-vip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 12.5px; font-weight: 800; letter-spacing: .02em; text-decoration: none;
  padding: 5px 11px; border-radius: 999px;
  color: #7C2D12; background: linear-gradient(135deg, #FDE68A, #FBBF24);
  border: 1px solid #F59E0B;
}
.nav-vip:hover { filter: brightness(1.05); }

/* Nhãn khoá trên thẻ nội dung trả phí */
.card-link.is-locked { color: var(--orange); font-weight: 700; }
.card-link.is-locked:hover { text-decoration: underline; }

/* Khối "Thông tin tài khoản" ở /account */
.acc-vip.is-vip {
  border-color: #F59E0B;
  background: linear-gradient(135deg, rgba(253, 230, 138, .35), rgba(251, 191, 36, .12));
}
/* 2 mục: VIP + Ngày sử dụng hệ thống */
.acc-info-item { margin-top: 12px; }
.acc-info-item + .acc-info-item { padding-top: 14px; border-top: 1px solid rgba(0,0,0,.08); }
.acc-info-item .acc-big { font-size: 24px; }
/* Nút Nâng cấp VIP căn giữa khối */
.acc-cta-wrap { text-align: center; margin-top: 18px; }

/* Nút "Mẹo ghi nhớ" khi chưa mở khoá (tài khoản thường) */
.btn-tip.is-locked { opacity: .75; text-decoration: none; }
.btn-tip.is-locked:hover { opacity: 1; }

/* ===== Review tích đức ===== */
.rv-title { text-align: center; }
.rv-wrap { max-width: 900px; }
.rv-note { background: rgba(30, 58, 138, .06); border: 1px solid rgba(30, 58, 138, .16); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; color: var(--gray-800); line-height: 1.6; }
.rv-flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 15px; }
.rv-flash.is-ok { background: rgba(16, 185, 129, .12); color: var(--emerald-600); border: 1px solid rgba(16, 185, 129, .3); }
.rv-flash.is-err { background: rgba(239, 68, 68, .1); color: #b91c1c; border: 1px solid rgba(239, 68, 68, .3); }
.rv-flash.is-note { background: rgba(30, 58, 138, .07); color: var(--navy); border: 1px solid rgba(30, 58, 138, .18); }
.rv-flash a { color: inherit; font-weight: 700; }

.rv-form { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.rv-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 6px; }
/* Khung "đã có N review" trên trang luyện tập */
.review-stat { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 11px 16px;
  background: linear-gradient(135deg, rgba(249,115,22,.10), rgba(249,115,22,.04));
  border: 1px solid rgba(249,115,22,.30); border-left: 4px solid var(--orange);
  border-radius: var(--radius-sm); font-size: 14.5px; color: var(--gray-800); line-height: 1.55; }
.review-stat-icon { font-size: 18px; line-height: 1.4; }
.review-stat strong { color: var(--orange-600); }
/* Chưa có review nào -> tông trung tính (xám). */
.review-stat-empty { background: var(--gray-50); border-color: var(--gray-200); border-left-color: var(--gray-300); color: var(--gray-600); }
/* Tài khoản thường -> mời nâng cấp VIP, tông navy. */
.review-stat-locked { background: linear-gradient(135deg, rgba(30,58,138,.08), rgba(30,58,138,.03)); border-color: rgba(30,58,138,.25); border-left-color: var(--navy); color: var(--gray-700); }
.review-stat-locked a { color: var(--navy); font-weight: 700; }

/* Nhãn "Key mới" (NEW) trên trang luyện — học liệu vừa được admin cập nhật. */
.new-badge {
  display: inline-block; background: var(--emerald, #10b981); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 1;
  padding: 3px 7px; border-radius: 5px; vertical-align: middle;
}
.new-key-note {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px; padding: 9px 14px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.30);
  border-left: 4px solid var(--emerald, #10b981); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-800);
}

/* ===== Học form Writing Part 4 (2 cột × 3 hàng) ===== */
.wfp-empty { padding: 30px; text-align: center; color: var(--gray-600);
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; }
.wfp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 6px; }
.wfp-controls { padding: 16px; background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 12px; margin-bottom: 20px; align-items: start; }
.wfp-cell { min-width: 0; }
.wfp-label { display: block; font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.wfp-select { width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--gray-300, #d1d5db); border-radius: var(--radius-sm, 8px); background: #fff; color: var(--gray-800); }
.wfp-topic { margin: 9px 0 0; font-size: 13px; color: var(--gray-600); }
.wfp-topic strong { color: var(--orange-600); }
.wfp-new-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: rgba(16,185,129,.15); color: var(--emerald-600); vertical-align: middle; }
.wfp-vip-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px;
  background: rgba(249,115,22,.15); color: var(--orange-600); vertical-align: middle; }
.wfp-locked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; padding: 20px; text-align: center; font-size: 14px; line-height: 1.7; color: var(--gray-700);
  background: linear-gradient(135deg, rgba(249,115,22,.06), rgba(30,58,138,.04));
  border: 1px dashed rgba(249,115,22,.4); border-radius: 10px; }
.wfp-locked-cta { display: inline-block; margin-top: 4px; padding: 7px 16px; font-weight: 700; font-size: 13.5px;
  background: var(--orange); color: #fff; border-radius: 999px; }
.wfp-locked-cta:hover { background: var(--orange-600); color: #fff; }
.wfp-forms { margin-top: 11px; }
.wfp-forms-label { display: block; font-size: 12px; color: var(--gray-500, #9ca3af); margin-bottom: 5px; }
.wfp-forms-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.wfp-form-btn { position: relative; padding: 6px 13px; font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300, #d1d5db); border-radius: 999px; transition: all .12s; }
.wfp-form-btn:hover { border-color: var(--navy); }
.wfp-form-btn.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.wfp-form-btn.is-suggested::after { content: '★'; margin-left: 5px; color: var(--orange); font-size: 11px; }
.wfp-form-btn.is-active.is-suggested::after { color: #ffd9b0; }
.wfp-bandout { font-weight: 800; color: var(--navy); }
.wfp-slider { width: 100%; accent-color: var(--navy); margin: 2px 0; }
.wfp-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--gray-500, #9ca3af); }
.wfp-hint { font-size: 13px; color: var(--gray-600); margin-top: 7px; min-height: 18px; }
.wfp-rubric { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.wfp-tag2 { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(16,185,129,.12); color: var(--emerald-600); }

.wfp-scenario { margin: 4px 0 8px; padding: 16px; background: #fff;
  border: 1px solid var(--gray-200); border-radius: 12px; }
.wfp-scenario-label { font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.wfp-scenario-text { margin: 0; font-size: 14px; line-height: 1.7; color: var(--gray-800); white-space: pre-line; }
.wfp-prompt { margin: 0 0 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.6; color: var(--gray-700);
  background: var(--gray-50); border: 1px dashed var(--gray-300, #d1d5db); border-radius: 8px; }
.wfp-prompt:empty { display: none; }

/* Chip từ khoá trích từ đề (ô cam) */
.wfp-keys { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wfp-keys:empty { display: none; }
.wfp-keys-label { font-size: 12px; color: var(--gray-500, #9ca3af); width: 100%; margin-bottom: 1px; }
.wfp-keychip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  background: rgba(249,115,22,.12); color: var(--orange-600); border: 1px solid rgba(249,115,22,.30); }
.wfp-keychip b { font-weight: 700; }

/* Nhãn cột mẫu + nút mắt che */
.wfp-sub-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spf-sub-btns { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Chú thích khung mẫu: dòng riêng, chữ thường, không in hoa/đậm */
.spf-model-note { font-size: 12px; font-weight: 400; text-transform: none; color: var(--gray-600, #4b5563); margin: 4px 0 8px; }
.wfp-eye { font-size: 12px; font-family: inherit; cursor: pointer; padding: 3px 10px; border-radius: 999px;
  background: #fff; color: var(--gray-600); border: 1px solid var(--gray-300, #d1d5db); }
.wfp-eye:hover { border-color: var(--navy); color: var(--navy); }
.wfp-eye.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.wfp-email.is-blurred { filter: blur(6px); user-select: none; pointer-events: none; }

/* Nút dịch đoạn + kết quả dịch */
.wfp-scenario-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.wfp-scenario-head .wfp-scenario-label { margin-bottom: 0; }
.wfp-sample-tools { display: flex; gap: 6px; }
.wfp-trbtn { font-size: 12px; font-family: inherit; cursor: pointer; padding: 3px 10px; border-radius: 999px;
  background: #EFF6FF; color: #1d4ed8; border: 1px solid #bfdbfe; }
.wfp-trbtn:hover:not(:disabled) { background: #DBEAFE; }
.wfp-trbtn:disabled { opacity: .5; cursor: not-allowed; }
.wfp-trans { margin-top: 8px; }
.wfp-trans-vi { display: block; padding: 10px 14px; background: #EFF6FF; border: 1px solid #bfdbfe;
  border-radius: 8px; font-size: 14px; line-height: 1.7; color: #1e3a8a; }
.wfp-trans-vi a { color: var(--navy); font-weight: 700; }
.wfp-tr-body { font-size: 15px; line-height: 1.8; color: var(--gray-800); }
.wfp-tr-body .wfp-trans-vi { background: transparent; border: 0; padding: 0; color: inherit; }
.wfp-tr-email .wfp-tr-line { margin: 0 0 4px; }
.wfp-tr-email .wfp-tr-gap { height: 10px; }
.wfp-tip { margin: 20px 0 0; padding: 10px 14px; font-size: 13px; color: var(--gray-600);
  background: var(--gray-50); border-radius: 8px; }

/* Chấm 2 email bằng AI */
.wfp-ai { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--gray-200); text-align: center; }
.wfp-ai-btn.is-locked { opacity: .9; }
.wfp-ai-note { margin: 8px 0 0; font-size: 12.5px; color: var(--gray-500, #9ca3af); }
.wfp-ai-result { margin-top: 16px; text-align: left; }
.wfp-ai-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 16px 18px; }
.wfp-ai-saved { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--gray-200); font-size: 13px; color: var(--emerald-600); }
.wfp-ai-saved a { color: var(--navy); font-weight: 700; }
.wfp-ai-msg { padding: 12px 14px; background: var(--gray-50); border-radius: 10px; font-size: 14px; color: var(--gray-700); }
.wfp-ai-err { background: rgba(239,68,68,.08); color: #b91c1c; }
.wfp-ai-err a { color: var(--navy); font-weight: 700; }
.wfp-fb-top { margin-bottom: 8px; }
.wfp-fb-band { display: inline-block; font-weight: 800; font-size: 15px; color: #fff; background: var(--navy);
  padding: 4px 14px; border-radius: 999px; }
.wfp-fb-overall { margin: 4px 0 12px; font-size: 14.5px; line-height: 1.7; color: var(--gray-800); }
.wfp-fb-block { margin-bottom: 10px; }
.wfp-fb-h { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; color: var(--gray-800); }
.wfp-fb-h.ok { color: var(--emerald-600); }
.wfp-fb-h.warn { color: var(--orange-600); }
.wfp-fb-block ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.65; color: var(--gray-700); }
.wfp-fb-emails { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 760px) { .wfp-fb-emails { grid-template-columns: 1fr; } }
.wfp-fb-email { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 10px; padding: 11px 14px;
  font-size: 13.5px; line-height: 1.6; color: var(--gray-700); }
.wfp-fb-eh { font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.wfp-ai-remain { margin-top: 12px; font-size: 13px; color: var(--gray-600); text-align: center; }

/* Lịch sử luyện form Part 4 */
.wfp-hist-item { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px; }
.wfp-hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.wfp-hist-club { font-weight: 800; font-size: 15px; color: var(--navy); }
.wfp-hist-target { font-size: 12.5px; color: var(--gray-600); }
.wfp-hist-date { margin-left: auto; font-size: 12.5px; color: var(--gray-500, #9ca3af); }
.wfp-hist-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 760px) { .wfp-hist-cols { grid-template-columns: 1fr; } }
.wfp-hist-text { white-space: pre-wrap; background: #fff; border: 1px solid var(--gray-200); border-radius: 8px;
  padding: 10px 13px; font-size: 14px; line-height: 1.7; color: var(--gray-800); margin-top: 5px; }
.wfp-hist-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--gray-200); }

/* Danh sách lịch sử (list → chi tiết) */
.wfp-hl-count { font-size: 13px; font-weight: 700; color: var(--gray-600); margin-bottom: 10px; }
.wfp-hl-list { border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; background: #fff; }
.wfp-hl-row { display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(0,2.4fr) 92px 84px 84px 148px 116px;
  padding: 13px 16px; border-top: 1px solid var(--gray-100);
  color: inherit; text-decoration: none; }
.wfp-hl-list > .wfp-hl-row:first-child { border-top: 0; }
a.wfp-hl-row:hover { background: var(--gray-50); }
.wfp-hl-thead { background: var(--gray-50); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .02em; color: var(--gray-500, #9ca3af); }
.wfp-hl-c-club { font-weight: 700; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfp-hl-c-target, .wfp-hl-c-words { font-size: 13px; color: var(--gray-600); }
.wfp-hl-c-date { font-size: 12.5px; color: var(--gray-500, #9ca3af); }
.wfp-hl-c-go { font-size: 13px; font-weight: 700; color: var(--orange-600); text-align: right; }
.wfp-hl-thead .wfp-hl-c-go { color: inherit; }
@media (max-width: 760px) {
  .wfp-hl-thead { display: none; }
  .wfp-hl-row { grid-template-columns: 1fr auto; grid-auto-rows: auto; gap: 4px 10px; padding: 14px 15px; }
  .wfp-hl-c-club { grid-column: 1 / 2; grid-row: 1; font-size: 15px; white-space: normal; }
  .wfp-hl-c-band { grid-column: 2 / 3; grid-row: 1; text-align: right; }
  .wfp-hl-c-target { grid-column: 1 / 3; grid-row: 2; }
  .wfp-hl-c-target::before { content: 'Mục tiêu: '; }
  .wfp-hl-c-words { grid-column: 1 / 3; grid-row: 3; }
  .wfp-hl-c-date { grid-column: 1 / 2; grid-row: 4; }
  .wfp-hl-c-go { grid-column: 2 / 3; grid-row: 4; }
}

.wfp-rowhead { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px;
  font-size: 16px; font-weight: 800; color: var(--gray-800); }
.wfp-tag { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.wfp-tag-accent { background: rgba(30,58,138,.10); color: var(--navy); }
.wfp-tag-warn { background: rgba(249,115,22,.14); color: var(--orange-600); }
.wfp-sub { display: block; font-size: 12.5px; font-weight: 700; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: .02em; margin-bottom: 7px; }

.wfp-textarea { width: 100%; padding: 12px 14px; font-size: 14.5px; line-height: 1.7; font-family: inherit;
  border: 1px solid var(--gray-300, #d1d5db); border-radius: 10px; resize: vertical; color: var(--gray-800); }
.wfp-textarea:focus { outline: none; border-color: var(--navy); }
.wfp-wc { margin-top: 6px; font-size: 12.5px; color: var(--gray-500, #9ca3af); text-align: right; }

/* Cho ô "Bạn viết" cao bằng khung email mẫu (grid stretch + textarea nở đầy cột) */
.wfp-grid-emails { align-items: stretch; }
.wfp-writecell, .wfp-samplecell { display: flex; flex-direction: column; }
.wfp-writecell .wfp-textarea { flex: 1 1 auto; min-height: 175px; }
.wfp-samplecell .wfp-email { flex: 1 1 auto; }

/* Dòng yêu cầu viết + nút dịch nhỏ */
.wfp-prompt-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.wfp-prompt-row .wfp-prompt { flex: 1; margin: 0; }
.wfp-prompt-row:has(.wfp-prompt:empty) { display: none; }
.wfp-trbtn-sm { flex: none; }

.wfp-samplecell .wfp-email { background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 14px 16px; font-size: 14.5px; line-height: 1.8; color: var(--gray-800); min-height: 120px; }
.wfp-email p { margin: 0 0 9px; }
.wfp-email p:last-child { margin-bottom: 0; }
.wfp-lib { background: rgba(30,58,138,.12); color: var(--navy); font-weight: 700; border-radius: 4px; padding: 0 4px; }
.wfp-kit { background: rgba(249,115,22,.13); color: var(--orange-600); font-weight: 700; border-radius: 4px; padding: 0 4px; }

.wfp-legend { margin-top: 18px; font-size: 13px; color: var(--gray-600); }
.wfp-lg { font-weight: 700; padding: 0 5px; border-radius: 4px; }
.wfp-lg-lib { background: rgba(30,58,138,.12); color: var(--navy); }
.wfp-lg-kit { background: rgba(249,115,22,.14); color: var(--orange-600); }

@media (max-width: 760px) {
  .wfp-grid { grid-template-columns: 1fr; }
}

/* Trang thiết bị đăng nhập (/account/devices) */
.acc-flash-ok { background: rgba(16,185,129,.10); border: 1px solid rgba(16,185,129,.35); color: var(--emerald-600);
  padding: 10px 14px; border-radius: var(--radius-sm, 8px); font-size: 14px; margin-bottom: 14px; }
.dev-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.dev-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 10px; }
.dev-name { font-weight: 700; font-size: 14.5px; color: var(--gray-800); }
.dev-cur { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; padding: 1px 8px;
  border-radius: 999px; background: rgba(16,185,129,.15); color: var(--emerald-600); vertical-align: middle; }
.dev-meta { font-size: 12.5px; color: var(--gray-500, #9ca3af); margin-top: 2px; }
.dev-btn { padding: 6px 14px; font-size: 13px; }
.dev-form { flex: none; margin: 0; }
.dev-form-all { margin-top: 12px; }

/* Nút Ghim (VIP) trên trang luyện */
.pin-btn {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 0 14px;
  padding: 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: #fff; color: var(--navy, #1e3a5f); border: 1.5px solid var(--gray-300, #d1d5db);
  border-radius: 999px; transition: all .12s;
}
.pin-btn:hover { border-color: var(--navy, #1e3a5f); }
.pin-btn.is-pinned { background: var(--navy, #1e3a5f); color: #fff; border-color: var(--navy, #1e3a5f); }

/* Modal chọn cách luyện (overview) */
.pm-empty-note { margin-top: 10px; padding: 9px 14px; background: rgba(249,115,22,.10);
  border: 1px solid rgba(249,115,22,.30); border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-800); }
.pm-overlay[hidden] { display: none; }
.pm-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(15,31,77,.5); padding: 18px; }
.pm-card { position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 440px;
  padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.pm-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px;
  line-height: 1; color: var(--gray-400); cursor: pointer; }
.pm-title { margin: 0 0 16px; font-size: 19px; color: var(--navy, #1e3a5f); }
.pm-options { display: flex; flex-direction: column; gap: 10px; }
.pm-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 13px 15px; border: 1.5px solid var(--gray-200, #e5e7eb); border-radius: 11px; background: #fff; transition: all .12s; }
.pm-opt:hover { border-color: var(--navy, #1e3a5f); background: rgba(30,58,138,.03); }
.pm-opt-ic { font-size: 22px; flex-shrink: 0; }
.pm-opt-txt { display: flex; flex-direction: column; gap: 2px; }
.pm-opt-txt strong { font-size: 14.5px; color: var(--gray-900, #111827); }
.pm-opt-txt small { font-size: 12.5px; color: var(--gray-500, #6b7280); }
.pm-opt.is-locked { opacity: .72; }
.pm-opt .pm-lock { margin-left: auto; font-size: 15px; }

/* Bảng Lịch sử làm bài */
.hist-table-wrap { overflow-x: auto; border: 1px solid var(--gray-200, #e5e7eb); border-radius: var(--radius-sm); }
.hist-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.hist-table th, .hist-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
.hist-table th { background: var(--gray-50, #f9fafb); font-weight: 700; color: var(--gray-600, #4b5563); white-space: nowrap; }
.hist-table tbody tr:last-child td { border-bottom: 0; }
.hist-table .ht-num { text-align: right; white-space: nowrap; }
.hist-table tr.is-weak { background: rgba(239,68,68,.05); }
.hist-weak-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: #FEE2E2; color: #991B1B; }
.hist-muted { color: var(--gray-500, #6b7280); white-space: nowrap; }

.rv-meta-2 { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.rv-opt { font-weight: 400; color: var(--gray-400); font-size: 12px; }
@media (max-width: 560px) { .rv-meta-2 { grid-template-columns: 1fr; } }
.rv-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rv-label, .rv-part-label { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.rv-input { width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; background: var(--white); box-sizing: border-box; }
/* Select địa điểm có nhãn rất dài -> cắt bằng "…" thay vì tràn ra ngoài. */
select.rv-input { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.rv-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 138, .1); }
.rv-textarea { resize: vertical; }
.rv-hint { font-size: 14px; color: var(--gray-600); margin: 14px 0; }
.rv-hint a { color: var(--navy); font-weight: 700; }

.rv-blocks { display: flex; flex-direction: column; gap: 16px; }
.rv-block { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 14px; background: var(--gray-50); }
.rv-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.rv-block-title { font-weight: 700; color: var(--navy); }
.rv-newcheck { font-size: 13px; color: var(--gray-600); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.rv-parts { display: flex; flex-direction: column; gap: 10px; }
.rv-part { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; }
.rv-part-label { text-align: right; }

.rv-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.rv-anon { font-size: 14px; color: var(--gray-800); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.btn.btn-cta[disabled] { opacity: .5; cursor: not-allowed; }

.rv-my { margin-top: 34px; }
.rv-my-title { font-size: 20px; color: var(--navy); margin-bottom: 14px; }
.rv-empty { color: var(--gray-600); }
.rv-review { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--white); }
.rv-review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rv-review-meta { font-size: 13px; color: var(--gray-600); }
.rv-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.rv-pill.is-pending { background: rgba(245, 158, 11, .15); color: #b45309; }
.rv-pill.is-approved { background: rgba(16, 185, 129, .15); color: var(--emerald-600); }
.rv-pill.is-rejected { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.rv-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-items li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.rv-item-skill { font-weight: 600; color: var(--navy); min-width: 150px; }
.rv-item-text { color: var(--gray-800); }
.rv-tag { font-size: 11px; font-weight: 700; color: var(--orange-600); background: rgba(249, 115, 22, .12); padding: 2px 8px; border-radius: 999px; }

@media (max-width: 560px) {
  .rv-part { grid-template-columns: 56px 1fr; }
  .rv-part .rv-newcheck { grid-column: 2; justify-self: start; margin-top: -2px; }
  .rv-item-skill { min-width: 0; }
}

/* ===== 2 khối cạnh nhau: Tra cứu điểm + Group Facebook (trang chủ) ===== */
.home-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: stretch; }
.home-card { display: flex; flex-direction: column; border-radius: 18px; padding: 30px 32px; box-shadow: var(--shadow); }
.home-card h2 { font-size: 23px; margin: 10px 0; }
.home-card p { margin: 0 0 14px; line-height: 1.6; }
.home-card-btn { margin-top: auto; align-self: flex-start; }
/* Khối tra cứu điểm — nền xanh navy đậm */
.home-card-score { background: linear-gradient(135deg, var(--navy), var(--navy-700)); color: #fff; }
.home-card-score .eyebrow { color: #A7F3D0; }
.home-card-score h2 { color: #fff; }
.home-card-score p { color: rgba(255,255,255,.9); }
/* Khối Facebook — giữ nền xanh nhạt như cũ */
.home-card-fb { background: linear-gradient(135deg, #EFF6FF, #E0EAFF); border: 1.5px solid #BFDBFE; }
.home-card-fb .fb-band-icon { color: var(--fb); margin-bottom: 4px; }
.home-card-fb h2 { color: var(--navy); }
.home-card-fb p { color: var(--gray-600); }
.home-card-fb .fb-band-list { margin-bottom: 16px; }
.home-card-actions { margin-top: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ===== Trang tra cứu điểm ===== */
.sc-title { text-align: center; }
.sc-wrap { max-width: 820px; }
.sc-flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 15px; }
.sc-flash.is-ok { background: rgba(16,185,129,.12); color: var(--emerald-600); border: 1px solid rgba(16,185,129,.3); }
.sc-flash.is-err { background: rgba(239,68,68,.1); color: #b91c1c; border: 1px solid rgba(239,68,68,.3); }

.sc-form { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.sc-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sc-field { display: flex; flex-direction: column; gap: 6px; }
.sc-field-grow { flex: 1 1 220px; }
.sc-label { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.sc-input { width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; box-sizing: border-box; }
.sc-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,138,.1); }
.sc-submit { height: 42px; }
.sc-date { display: flex; gap: 8px; }
.sc-date-sel { flex: 1 1 0; min-width: 70px; padding: 10px 8px; }
.sc-note { font-size: 13px; color: var(--gray-600); margin: 12px 0 0; }
.sc-muted { color: var(--gray-600); font-size: 14px; }

.sc-result { margin-top: 22px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.sc-result-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sc-result-head h2 { color: var(--navy); margin: 0; }
.sc-person { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 16px; font-size: 14px; color: var(--gray-800); }
.sc-table-wrap { overflow-x: auto; }
.sc-table { width: 100%; border-collapse: collapse; }
.sc-table th, .sc-table td { padding: 10px 14px; border: 1px solid var(--gray-200); text-align: left; }
.sc-table thead th { background: var(--gray-50); font-size: 13px; color: var(--gray-600); }
.sc-table .sc-num { text-align: center; }
.sc-table tfoot td { background: rgba(30,58,138,.05); }

.sc-notfound { margin-top: 22px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.28); border-radius: var(--radius); padding: 20px; }
.sc-register { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin-top: 8px; }
.sc-check { font-size: 14px; color: var(--gray-800); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.sc-others { margin-top: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-refresh { margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(30,58,138,.05); border: 1px dashed rgba(30,58,138,.25); border-radius: var(--radius-sm); padding: 12px 14px; }
.sc-refresh-form { margin: 0; }
.sc-captcha { margin-top: 18px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.28); border-radius: var(--radius); padding: 20px; }
.sc-captcha p { margin: 0 0 12px; }
.sc-chip { font-size: 13px; background: var(--gray-100); border-radius: 999px; padding: 4px 12px; color: var(--gray-800); }

.sc-my { margin-top: 30px; }
.sc-my-title { font-size: 20px; color: var(--navy); margin-bottom: 14px; }
.sc-watch { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--white); flex-wrap: wrap; }
.sc-watch-meta { font-size: 14px; color: var(--gray-800); }
.sc-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.sc-pill.is-wait { background: rgba(245,158,11,.15); color: #b45309; }
.sc-pill.is-ok { background: rgba(16,185,129,.15); color: var(--emerald-600); }
.sc-pill.is-err { background: rgba(239,68,68,.12); color: #b91c1c; }

/* ===== Đề hay ra gần đây (/de-hay-ra) ===== */
.ht-filter { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ht-filter-label { font-size: 14px; font-weight: 600; color: var(--gray-600); }
.ht-select { padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: var(--white); font-size: 15px; font-family: inherit; color: var(--gray-800); }
.ht-filter-note { font-size: 14px; color: var(--gray-600); }
.ht-vi { font-weight: 500; color: var(--gray-400); font-size: .8em; }

/* Bản khoá (chưa VIP) */
.ht-lock { display: flex; gap: 16px; align-items: flex-start; background: linear-gradient(135deg, rgba(30,58,138,.08), rgba(30,58,138,.02)); border: 1px solid rgba(30,58,138,.25); border-radius: var(--radius); padding: 22px; }
.ht-lock-ic { font-size: 30px; line-height: 1; }
.ht-lock-body h2 { margin: 0 0 8px; font-size: 20px; color: var(--navy); }
.ht-lock-body p { margin: 0 0 14px; color: var(--gray-600); }
.ht-lock-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ht-lock-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; }
.ht-lock-card h3 { margin: 0 0 10px; font-size: 16px; color: var(--navy); }
.ht-lock-card ul { list-style: none; margin: 0; padding: 0; }
.ht-lock-card li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--gray-600); border-bottom: 1px dashed var(--gray-200); }
.ht-lock-card li:last-child { border-bottom: none; }
.ht-lock-card li strong { color: var(--orange-600); white-space: nowrap; }

/* Khối "đã ghim" */
.ht-pinned { background: var(--white); border: 1px solid var(--gray-200); border-left: 4px solid var(--orange); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 26px; }
.ht-pinned-head h2 { margin: 0 0 10px; font-size: 18px; color: var(--navy); }
.ht-badge-count { display: inline-block; min-width: 24px; text-align: center; background: var(--orange); color: #fff; font-size: 13px; border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.ht-pinned-empty { margin: 0; font-size: 14px; color: var(--gray-600); }
.ht-pinned-group { margin-top: 12px; }
.ht-pinned-skill { font-size: 14px; color: var(--navy); }
.ht-pinned-note { color: var(--gray-600); font-weight: 400; }
.ht-pinned-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ht-pinned-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--gray-50); border-radius: var(--radius-sm); padding: 8px 12px; }
.ht-pinned-link { font-size: 14px; font-weight: 600; }

/* 4 khối kỹ năng */
.ht-block { margin-bottom: 34px; }
.ht-block-title { margin: 0 0 14px; font-size: 22px; color: var(--navy); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ht-block-meta { font-size: 13px; font-weight: 500; color: var(--gray-400); }
.ht-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ht-parts.is-single { grid-template-columns: 1fr; }
.ht-part { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.ht-part-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--gray-200); }
.ht-part-head h3 { margin: 0; font-size: 16px; color: var(--gray-800); }
.ht-part-link { font-size: 13px; font-weight: 600; white-space: nowrap; }
/* "Luyện câu đã ghim" là lối vào ôn tập chính -> làm nổi thành nút viền cam. */
.ht-part-link.is-pin { padding: 5px 12px; border-radius: 999px; background: rgba(249,115,22,.12);
  border: 1px solid rgba(249,115,22,.45); color: var(--orange-600); transition: all .15s ease; }
.ht-part-link.is-pin:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.ht-empty { margin: 0; font-size: 14px; color: var(--gray-400); }

.ht-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.ht-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--gray-200); }
.ht-item:last-child { border-bottom: none; }
.ht-rank { flex: 0 0 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: var(--gray-100); color: var(--gray-600); font-size: 12px; font-weight: 700; }
.ht-item.is-top .ht-rank { background: var(--orange); color: #fff; }
.ht-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ht-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ht-trend { color: var(--emerald); font-size: 12px; line-height: 1; flex: 0 0 auto;
  animation: trend-up 1.5s ease-in-out infinite; will-change: transform; }
/* Lệch pha giữa 3 hạng -> nhìn như đang "chạy lên", không nhấp nháy đồng loạt. */
.ht-item:nth-child(2) .ht-trend { animation-delay: .25s; }
.ht-item:nth-child(3) .ht-trend { animation-delay: .5s; }
@keyframes trend-up {
  0%   { transform: translateY(2px);  opacity: .35; }
  35%  { transform: translateY(-2px); opacity: 1; }
  70%  { transform: translateY(-3px); opacity: .8; }
  100% { transform: translateY(2px);  opacity: .35; }
}
@media (prefers-reduced-motion: reduce) { .ht-trend { animation: none; opacity: 1; } }
.ht-item-title { font-size: 14px; font-weight: 600; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ht-item-title:hover { color: var(--emerald-600); }
.ht-item-meta { font-size: 12px; color: var(--gray-400); }
.ht-item-meta strong { color: var(--orange-600); }

.ht-pin { flex: 0 0 auto; border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-600); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s ease; }
.ht-pin:hover { border-color: var(--orange); color: var(--orange-600); }
.ht-pin.is-pinned { background: var(--orange); border-color: var(--orange); color: #fff; }
.ht-pin:disabled { opacity: .6; cursor: default; }

.ht-foot { margin-top: 6px; font-size: 14px; color: var(--gray-600); }

@media (max-width: 640px) {
  .ht-parts { grid-template-columns: 1fr; }
  .ht-item-title { white-space: normal; }
}
.ht-item-raw { font-size: 12px; color: var(--gray-600); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Nhãn LIVE (menu + tiêu đề trang thống kê) — ý: số liệu cập nhật liên tục. */
.live-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px 1px 6px;
  border-radius: 999px; background: rgba(239,68,68,.12); color: #dc2626; font-size: 10px; font-weight: 800;
  letter-spacing: .5px; vertical-align: middle; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #dc2626; animation: live-pulse 1.6s ease-in-out infinite; }
.live-dot-nav { display: inline-block; margin-left: 5px; vertical-align: middle; }
.live-tag-lg { font-size: 12px; padding: 2px 10px 2px 8px; margin-left: 10px; }
.live-tag-lg .live-dot { width: 8px; height: 8px; }
@keyframes live-pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 50% { opacity: .45; box-shadow: 0 0 0 5px rgba(220,38,38,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ===== Trang huỷ nhận email marketing (/huy-nhan-email) ===== */
.unsub-card { max-width: 620px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); }
.unsub-card p { margin: 0 0 12px; }
.unsub-note { font-size: 14px; color: var(--gray-600); }
.unsub-form { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--gray-200); }
.unsub-form .unsub-note { margin-bottom: 8px; }
.sc-cert { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* ★ Dự báo của Key4Aptis trên bảng thống kê (khác ▲ = xu hướng từ số lượt review). */
.ht-star { color: #f59e0b; font-size: 12px; letter-spacing: 1px; flex: 0 0 auto; }

/* ===================== Thi thử (mock test) ===================== */
.mt-resume { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  background:#fff; border:2px solid var(--emerald); border-radius:var(--radius); padding:16px 20px; margin-bottom:24px; box-shadow:var(--shadow); }
.mt-muted { color:#6B7280; }
.mt-h2 { font-size:20px; margin:0 0 14px; color:var(--navy); }
.mt-structure { background:#fff; border:1px solid var(--gray-200); border-radius:16px; padding:24px 26px; box-shadow:var(--shadow); margin-bottom:28px; }
.mt-sections { list-style:none; margin:0 0 16px; padding:0; }
.mt-section-row { display:flex; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid var(--gray-100); }
.mt-section-row:last-child { border-bottom:none; }
.mt-section-icon { font-size:22px; width:30px; text-align:center; }
.mt-section-name { flex:1; }
.mt-section-name strong { color:var(--gray-800); }
.mt-section-time { font-weight:700; color:var(--navy); font-variant-numeric:tabular-nums; }
.mt-tag { display:inline-block; margin-left:8px; font-size:11.5px; font-weight:700; color:var(--orange-600);
  background:rgba(249,115,22,.10); padding:2px 8px; border-radius:999px; }
.mt-note { color:#6B7280; font-size:14px; background:var(--gray-100); border-radius:var(--radius-sm); padding:12px 14px; margin:0 0 18px; }
.mt-start-form { text-align:center; }
.btn-lg { padding:14px 34px; font-size:17px; }

.mt-history { margin-top:8px; }
.mt-history-table, .mt-result-section .review-table { width:100%; border-collapse:collapse; }
.mt-history-table th, .mt-history-table td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--gray-100); font-size:14px; }
.mt-history-table th { color:#6B7280; font-weight:600; }
.mt-pill { display:inline-block; font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; background:var(--gray-100); color:#6B7280; }
.mt-pill.is-done { background:rgba(16,185,129,.12); color:var(--emerald-600); }
.mt-pill.is-progress { background:rgba(249,115,22,.12); color:var(--orange-600); }
.mt-band { display:inline-block; font-weight:800; color:var(--navy); background:var(--gray-100); padding:2px 10px; border-radius:8px; }
.mt-link { color:var(--emerald-600); font-weight:600; }

/* Intro từng phần */
.mt-intro { display:flex; justify-content:center; padding:20px 0 60px; }
.mt-intro-card { max-width:620px; width:100%; background:#fff; border:1px solid var(--gray-200); border-radius:18px;
  padding:34px 34px 30px; box-shadow:var(--shadow-lg); text-align:center; }
.mt-intro-step { font-size:13px; font-weight:700; color:var(--orange-600); letter-spacing:.04em; text-transform:uppercase; }
.mt-intro-icon { font-size:52px; margin:8px 0 4px; }
.mt-intro-title { font-size:28px; margin:0 0 14px; color:var(--navy); }
.mt-intro-en { font-size:16px; color:var(--gray-800); margin:0 0 6px; }
.mt-intro-vi { font-size:14px; color:#6B7280; margin:0 0 18px; }
.mt-intro-facts { list-style:none; display:flex; flex-wrap:wrap; justify-content:center; gap:10px 22px; padding:0; margin:0 0 20px; font-size:14px; }
.mt-intro-warn { background:#FEF3C7; border:1px solid #FCD34D; color:#92400E; border-radius:var(--radius-sm); padding:12px 14px; font-size:13.5px; margin-bottom:22px; text-align:left; }
.mt-intro-actions { margin:0; }

/* Trang làm bài */
.mt-steps { margin-bottom:14px; }
.mt-items { display:flex; flex-direction:column; gap:18px; }
.mt-item { background:#fff; border:1px solid var(--gray-200); border-radius:14px; padding:20px 22px; box-shadow:var(--shadow); }
.mt-q-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.mt-q-num { display:inline-flex; align-items:center; justify-content:center; min-width:26px; height:26px; padding:0 7px;
  background:var(--navy); color:#fff; border-radius:999px; font-weight:700; font-size:13px; }
.mt-q-num.sm { min-width:20px; height:20px; font-size:11px; }
.mt-q-tag { font-size:11.5px; font-weight:700; color:#6B7280; background:var(--gray-100); padding:2px 9px; border-radius:999px; }
.mt-q-text { font-size:16px; color:var(--gray-800); margin:0 0 12px; line-height:1.6; }
.mt-opts { display:flex; flex-direction:column; gap:8px; }
.mt-opt { display:flex; align-items:center; gap:10px; padding:9px 13px; border:1.5px solid var(--gray-200); border-radius:10px; cursor:pointer; transition:.12s; }
.mt-opt:hover { border-color:var(--navy); background:var(--gray-100); }
.mt-opt input { accent-color:var(--navy); }
.mt-part-title { font-size:18px; color:var(--navy); margin:0 0 4px; }
.mt-part-instr { font-size:14px; color:#6B7280; margin:0 0 14px; }
.mt-mcq { padding:6px 0; }
.mt-mcq + .mt-mcq { border-top:1px dashed var(--gray-200); margin-top:10px; padding-top:14px; }

.mt-selrows { display:flex; flex-direction:column; gap:12px; }
.mt-selrow { display:flex; align-items:center; gap:12px; }
.mt-selrow-block { flex-direction:column; align-items:stretch; gap:6px; padding:10px 0; border-bottom:1px solid var(--gray-100); }
.mt-sel-label { font-weight:700; color:var(--navy); min-width:80px; }
.mt-sel-text { color:var(--gray-800); }
.mt-select, .mt-input { padding:8px 12px; border:1.5px solid var(--gray-200); border-radius:8px; font-size:15px; background:#fff; }
.mt-select:focus, .mt-input:focus, .mt-textarea:focus { outline:none; border-color:var(--navy); }
.mt-textarea { width:100%; padding:10px 12px; border:1.5px solid var(--gray-200); border-radius:8px; font-size:15px; font-family:inherit; resize:vertical; margin-bottom:10px; }
.mt-input { width:100%; }

.lis-audio { width:100%; margin:6px 0 14px; }

.mt-spk-imgs { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.mt-spk-img { max-width:100%; width:320px; border-radius:10px; border:1px solid var(--gray-200); }
.mt-spk-subs { margin:6px 0 12px; padding-left:22px; line-height:1.8; }
.mt-recorder { display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:var(--gray-100); border-radius:10px; padding:12px 14px; }
.mt-rec-status { font-size:13.5px; color:#6B7280; }
.mt-rec-play { height:34px; }

.mt-wrt-part { margin-bottom:18px; }
.mt-wrt-h { font-size:15px; color:var(--navy); margin:0 0 8px; }
.mt-wrt-q { display:block; margin-bottom:10px; }
.mt-wrt-q span { display:block; font-size:14px; color:var(--gray-800); margin-bottom:4px; }

.mt-run-hint { font-size:14px; color:#6B7280; flex:1; }
.rex-bar-na span { background:var(--gray-200) !important; }
.mt-band-note { font-size:13px; color:#6B7280; text-align:center; margin:14px 0 20px; }
.mt-result-section { margin-bottom:18px; }
.mt-result-block { margin-top:14px; }
.mt-block-head { margin-bottom:6px; font-size:14px; color:var(--gray-800); }

/* ---- Thi thử: danh sách đề (card grid) ---- */
.mt-exam-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:22px; margin-bottom:8px; }
.mt-exam-card { display:flex; flex-direction:column; background:#fff; border:1px solid var(--gray-200);
  border-radius:16px; padding:22px 22px 20px; box-shadow:var(--shadow); transition:transform .14s, box-shadow .14s, border-color .14s; }
.mt-exam-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:var(--emerald); }
.mt-exam-tags { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.mt-exam-type { font-size:12.5px; font-weight:700; color:var(--emerald-600);
  background:rgba(16,185,129,.10); padding:4px 12px; border-radius:999px; }
.mt-exam-badge { font-size:11.5px; font-weight:800; letter-spacing:.03em; padding:4px 11px; border-radius:999px; }
.mt-exam-badge.is-free { color:var(--emerald-600); background:rgba(16,185,129,.12); }
.mt-exam-badge.is-pro { color:#fff; background:var(--orange); }
.mt-exam-title { font-size:24px; font-weight:800; color:var(--navy); margin:0 0 6px; }
.mt-exam-sub { font-size:14.5px; color:#6B7280; margin:0 0 14px; line-height:1.5; }
.mt-exam-meta { font-size:13.5px; color:#6B7280; margin:0 0 18px; font-variant-numeric:tabular-nums; }
.mt-exam-form { margin:auto 0 0; display:flex; flex-direction:column; gap:9px; }
.mt-exam-btn { width:100%; padding:13px 18px; font-size:15.5px; font-weight:700; }
.mt-exam-btn-guided { font-size:14.5px; }
.mt-exam-btn.is-locked { background:var(--gray-100); color:#6B7280; border:1px solid var(--gray-200); }
.mt-exam-btn.is-locked:hover { background:var(--gray-200); color:var(--navy); }

.mt-empty { text-align:center; background:#fff; border:1px dashed var(--gray-200); border-radius:16px; padding:44px 24px; color:#6B7280; }
.mt-empty-icon { font-size:44px; margin-bottom:10px; }

@media (max-width:900px){ .mt-exam-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .mt-exam-grid { grid-template-columns:1fr; } }

/* ---- Thi thử: header căn giữa ---- */
.mt-head-title { text-align:center; text-transform:uppercase; letter-spacing:.02em; }
.page-head .mt-head-lead { text-align:center; max-width:760px; margin:10px auto 0; color:var(--navy); font-weight:700; }

/* Popup "Chú ý" (intro chế độ hướng dẫn) */
.mt-tips-open { margin-bottom:16px; }
.mt-tips-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center;
  background:rgba(15,23,42,.55); padding:20px; }
.mt-tips-modal[hidden] { display:none; }
.mt-tips-box { position:relative; background:#fff; border-radius:16px; max-width:520px; width:100%;
  padding:26px 28px; box-shadow:var(--shadow-lg); text-align:left; }
.mt-tips-close { position:absolute; top:12px; right:14px; background:none; border:none; font-size:26px; line-height:1;
  color:#9CA3AF; cursor:pointer; }
.mt-tips-close:hover { color:var(--navy); }
.mt-tips-title { font-size:19px; color:var(--navy); margin:0 0 14px; }
.mt-tips-list { margin:0 0 14px; padding-left:20px; line-height:1.8; color:var(--gray-800); }
.mt-tips-list li { margin-bottom:6px; }
.mt-tips-note { font-size:13px; color:#6B7280; background:var(--gray-100); border-radius:8px; padding:10px 12px; margin:0; }

/* ================= Thi thử: layout phần thi (progress + header + intro) ================= */
/* --- Thanh tiến trình 5 kỹ năng --- */
.mock-progress { display:flex; align-items:center; gap:14px; padding:12px 28px 0; }
.mock-progress-bar { display:flex; gap:6px; flex:1; max-width:560px; }
.mock-seg { flex:1; height:6px; border-radius:999px; background:var(--gray-200); }
.mock-seg.is-done { background:var(--navy); }
.mock-seg.is-current { background:var(--emerald); }
.mock-progress-label { font-size:13px; font-weight:700; color:var(--gray-600); white-space:nowrap; }

/* --- Header phần thi --- */
.mock-top { display:flex; align-items:center; gap:16px; background:var(--navy); color:#fff;
  padding:14px 28px; margin-top:12px; position:sticky; top:0; z-index:50; }
.mock-top-left { display:flex; flex-direction:column; line-height:1.25; flex:1; }
.mock-top-skill { font-size:13px; color:rgba(255,255,255,.75); }
.mock-top-step { font-size:17px; font-weight:800; }
.mock-top .exam-timer { color:#fff; flex:0 0 auto; }
.mock-top .exam-timer strong { color:#fff; }
.mock-exit { display:inline-flex; align-items:center; gap:6px; background:rgba(255,255,255,.14);
  color:#fff; padding:9px 18px; border-radius:999px; font-weight:700; font-size:14px; }
.mock-exit:hover { background:rgba(255,255,255,.26); color:#fff; }

/* --- Nội dung màn giới thiệu --- */
.mock-intro { max-width:820px; }
.mock-eyebrow { font-size:14px; color:var(--gray-600); margin:0 0 6px; }
.mock-intro-title { font-size:34px; font-weight:800; color:var(--navy); margin:0 0 8px; }
.mock-intro-sub { font-size:16px; color:var(--gray-600); margin:0 0 28px; }
.mock-stats { display:flex; gap:56px; margin:0 0 30px; flex-wrap:wrap; }
.mock-stat { display:flex; flex-direction:column; gap:4px; }
.mock-stat-label { font-size:13.5px; color:var(--gray-600); }
.mock-stat-value { font-size:20px; font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; }
.mock-section-h { font-size:17px; font-weight:800; color:var(--navy); margin:0 0 12px; }
.mock-desc-card { background:#F8FAFC; border:1px solid var(--gray-200); border-radius:14px; padding:20px 22px; margin:0 0 22px; }
.mock-desc-en { font-size:15px; color:var(--gray-800); margin:0 0 6px; font-weight:600; }
.mock-desc-vi { font-size:14.5px; color:var(--gray-600); margin:0; line-height:1.6; }
.mock-mic { margin-top:18px; padding-top:18px; border-top:1px dashed var(--gray-200); }
.mock-mic-title { font-weight:800; color:var(--navy); margin-bottom:4px; }
.mock-mic-hint { font-size:13.5px; color:var(--gray-600); margin:0 0 12px; line-height:1.55; }
.mock-mic-status { margin-left:12px; font-size:14px; font-weight:700; }
.mock-mic-status.is-ok { color:var(--emerald-600); }
.mock-mic-status.is-err { color:#DC2626; }
.mock-tips-open { margin-top:16px; }
.mock-warn { background:rgba(249,115,22,.08); border:1px solid rgba(249,115,22,.28); color:#9A3412;
  border-radius:12px; padding:14px 16px; font-size:14px; line-height:1.55; margin:0 0 24px; }
.mock-intro-actions { margin:0; }

@media (max-width:600px){
  .mock-progress { padding:10px 16px 0; }
  .mock-top { padding:12px 16px; }
  .mock-intro-title { font-size:27px; }
  .mock-stats { gap:32px; }
}

/* --- Màn hướng dẫn (kiểu đề thật) --- */
.mock-brief-wrap { display:flex; justify-content:center; padding:6px 0 40px; }
.mock-brief-card { background:#fff; border:1px solid var(--gray-200); border-radius:16px; box-shadow:var(--shadow);
  max-width:840px; width:100%; padding:34px 40px; }
.mock-brief-title { font-size:22px; font-weight:800; color:var(--navy); margin:0 0 16px; }
.mock-brief-head { font-weight:800; color:var(--gray-800); margin:0 0 10px; }
.mock-brief-lines p { color:var(--gray-600); line-height:1.65; margin:0 0 10px; font-size:15.5px; }
.mock-brief-lines p:last-child { margin-bottom:0; }

/* --- Thanh công cụ dưới cùng --- */
.mock-toolbar { position:fixed; left:0; right:0; bottom:0; z-index:60; background:#fff; border-top:3px solid var(--navy);
  display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 24px; }
.mock-tools { display:flex; gap:10px; }
.mock-nav { display:flex; align-items:center; gap:12px; }
.mock-tool { width:42px; height:42px; border-radius:50%; border:1px solid var(--gray-200); background:#fff;
  color:var(--gray-600); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; padding:0; }
.mock-tool:hover { border-color:var(--navy); color:var(--navy); }
.mock-tool svg { width:20px; height:20px; }
.mock-tool-exit:hover { border-color:#DC2626; color:#DC2626; }
.mock-nav-btn { padding:11px 22px; font-size:15px; }
.mock-nav-btn:disabled { opacity:.45; cursor:not-allowed; }
.mock-next-form { margin:0; }
@media (max-width:600px){
  .mock-toolbar { padding:8px 14px; gap:8px; }
  .mock-nav { gap:8px; }
  .mock-nav-btn { padding:10px 14px; font-size:14px; }
}

/* --- Drawer (danh sách phần / thông tin) --- */
.mock-overlay { position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:70; }
.mock-overlay[hidden] { display:none; }
.mock-drawer { position:fixed; top:0; left:0; bottom:0; width:340px; max-width:86vw; background:#fff; z-index:80;
  box-shadow:var(--shadow-lg); display:flex; flex-direction:column; }
.mock-drawer[hidden] { display:none; }
.mock-drawer-head { display:flex; align-items:center; justify-content:space-between; padding:18px 20px;
  border-bottom:1px solid var(--gray-200); font-weight:800; color:var(--navy); }
.mock-drawer-close { background:none; border:none; font-size:26px; line-height:1; color:#9CA3AF; cursor:pointer; }
.mock-drawer-close:hover { color:var(--navy); }
.mock-drawer-body { padding:18px 20px; overflow:auto; }
.mock-info-brand img { height:30px; margin-bottom:20px; }
.mock-info-row { display:flex; flex-direction:column; gap:2px; border-left:3px solid var(--gray-200); padding:2px 0 2px 12px; margin-bottom:14px; }
.mock-info-k { font-size:12.5px; color:var(--gray-600); }
.mock-info-v { font-weight:700; color:var(--navy); }
.mock-parts { list-style:none; margin:0; padding:0; }
.mock-part { display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:10px; margin-bottom:6px; color:var(--gray-800); }
.mock-part.is-current { background:rgba(16,185,129,.10); }
.mock-part.is-done { color:var(--gray-600); }
.mock-part-no { width:26px; height:26px; border-radius:50%; background:var(--gray-100); color:var(--gray-600);
  display:inline-flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; flex:0 0 auto; }
.mock-part.is-current .mock-part-no { background:var(--emerald); color:#fff; }
.mock-part.is-done .mock-part-no { background:var(--navy); color:#fff; }
.mock-part-label { flex:1; font-weight:600; }
.mock-part-now { font-size:12px; color:var(--emerald-600); font-weight:700; }

/* ================= Thi thử: SPEAKING (kịch bản như thi thật) ================= */
.mock-spk { max-width:1180px; margin:0 auto; }

/* Overlay bắt đầu */
.mock-spk-gate { position:fixed; inset:0; z-index:100; background:rgba(248,250,252,.97);
  display:flex; align-items:center; justify-content:center; padding:24px; }
.mock-spk-gate[hidden] { display:none; }
.mock-spk-gate-card { background:#fff; border:1px solid var(--gray-200); border-radius:18px; box-shadow:var(--shadow-lg);
  max-width:460px; width:100%; padding:36px 32px; text-align:center; }
.mock-spk-gate-icon { font-size:44px; margin-bottom:10px; }
.mock-spk-gate-title { font-size:22px; font-weight:800; color:var(--navy); margin:0 0 8px; }
.mock-spk-gate-sub { color:var(--gray-600); font-size:14.5px; line-height:1.6; margin:0 0 22px; }

/* Màn Prompt */
.mock-spk-prompt { display:flex; justify-content:center; padding:6px 0 40px; }
.mock-spk-prompt[hidden] { display:none; }
.mock-spk-prompt-title { font-size:22px; font-weight:800; color:var(--navy); margin:0 0 16px; }
.mock-spk-prompt-text { color:var(--gray-800); line-height:1.7; font-size:16px; margin:0 0 14px; white-space:pre-line; }
.mock-spk-prompt-note { color:var(--gray-600); font-size:15px; margin:0; }

/* Màn câu hỏi + ghi âm */
.mock-spk-run { display:flex; gap:24px; align-items:flex-start; padding:6px 0 60px; }
.mock-spk-run[hidden] { display:none; }
.mock-spk-card { background:#fff; border:1px solid var(--gray-200); border-radius:16px; box-shadow:var(--shadow); }
.mock-spk-left { flex:1; min-height:360px; padding:26px 30px; }
.mock-spk-side { width:320px; flex:0 0 320px; padding:26px 24px; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:18px; }
.mock-spk-eyebrow { font-size:13.5px; color:var(--gray-600); margin-bottom:4px; }
.mock-spk-qtitle { font-size:20px; font-weight:800; color:var(--navy); margin-bottom:18px; }
.mock-spk-images { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.mock-spk-images img { max-width:100%; width:300px; border-radius:10px; border:1px solid var(--gray-200); }
.mock-spk-images[hidden] { display:none; }
.mock-spk-question { font-size:17px; color:var(--gray-800); line-height:1.6; margin:0; }

/* Part 4: khối chủ đề (3 câu) */
.mock-spk-topic[hidden] { display:none; }
.mock-spk-topic { background:#F8FAFC; border:1px solid var(--gray-200); border-radius:12px; padding:18px 22px; }
.mock-spk-topic-h { font-weight:800; color:var(--navy); margin-bottom:10px; }
.mock-spk-topic-list { margin:0 0 16px; padding-left:20px; line-height:1.85; color:var(--gray-800); }
.mock-spk-topic-list li { margin-bottom:4px; }
.mock-spk-topic-note { font-weight:700; color:var(--gray-800); margin:0; }

/* Part 4: đếm ngược chuẩn bị */
.mock-spk-prep[hidden] { display:none; }
.mock-spk-prep { display:flex; flex-direction:column; align-items:center; gap:14px; }
.mock-spk-prep-title { font-weight:800; color:var(--navy); }
.mock-spk-prep .mock-spk-rec-mic { color:var(--navy); }
.mock-spk-prep-count { font-size:30px; font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; }

/* Trạng thái "đang nghe" */
.mock-spk-listen[hidden], .mock-spk-rec[hidden] { display:none; }
.mock-spk-listen { display:flex; flex-direction:column; align-items:center; gap:8px; }
.mock-spk-speaker { width:64px; height:64px; border-radius:50%; background:var(--gray-100); color:var(--navy);
  display:flex; align-items:center; justify-content:center; }
.mock-spk-speaker svg { width:30px; height:30px; }
.mock-spk-listen-title { font-weight:800; color:var(--navy); }
.mock-spk-listen-sub { font-size:13px; color:var(--gray-600); line-height:1.5; }

/* Trạng thái "đang ghi âm" */
.mock-spk-rec { display:flex; flex-direction:column; align-items:center; gap:14px; }
.mock-spk-rec-title { font-weight:800; color:var(--navy); }
@property --pct { syntax:'<percentage>'; inherits:false; initial-value:0%; }
.mock-spk-rec-ring { width:150px; height:150px; border-radius:50%; position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  background:conic-gradient(var(--navy) var(--pct,0%), var(--gray-200) 0);
  transition:--pct .95s linear; }
.mock-spk-rec-ring::before { content:''; position:absolute; inset:8px; border-radius:50%; background:#fff; }
.mock-spk-rec-ring > * { position:relative; z-index:1; }
.mock-spk-rec-mic { color:var(--navy); }
.mock-spk-rec-mic svg { width:22px; height:22px; }
.mock-spk-rec-count { font-size:30px; font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; }
.mock-spk-rec-wave { display:flex; align-items:center; justify-content:center; gap:3px; height:26px; }
.mock-spk-rec-wave span { width:3px; height:20px; background:var(--navy); border-radius:2px;
  transform:scaleY(.25); transform-origin:center; animation:mockWave .9s ease-in-out infinite; }
@keyframes mockWave { 0%,100% { transform:scaleY(.25); } 50% { transform:scaleY(1); } }
@media (prefers-reduced-motion: reduce){ .mock-spk-rec-wave span { animation:none; transform:scaleY(.5); } }
.mock-spk-finish { width:100%; padding:13px; font-weight:700; }
.mock-spk-finish:disabled { opacity:.5; cursor:not-allowed; }

/* Nút Báo lỗi nổi */
.mock-report { position:fixed; left:22px; bottom:74px; z-index:55; display:inline-flex; align-items:center; gap:7px;
  background:#fff; border:1px solid var(--gray-200); border-radius:999px; padding:9px 16px; font-weight:700;
  font-size:13.5px; color:var(--navy); box-shadow:var(--shadow); cursor:pointer; }
.mock-report:hover { border-color:var(--navy); }

/* [DEV] Thanh nhảy nhanh giữa các kỹ năng (chỉ hiện khi dev) */
.mock-testnav { position:fixed; bottom:76px; left:50%; transform:translateX(-50%); z-index:65;
  display:flex; align-items:center; gap:5px; background:#FEF3C7; border:1px dashed #D97706;
  border-radius:999px; padding:5px 10px; box-shadow:var(--shadow); font-size:13px; }
.mock-testnav-tag { font-weight:800; color:#B45309; font-size:11px; letter-spacing:.04em; }
.mock-testnav a { color:#92400E; font-weight:700; text-decoration:none; padding:4px 9px; border-radius:999px; }
.mock-testnav a:hover { background:#FDE68A; }

@media (max-width:820px){
  .mock-spk-run { flex-direction:column; }
  .mock-spk-side { width:100%; flex:none; }
}

/* ================= Thi thử: LISTENING (làm từng câu) ================= */
.lis-wrap { max-width:1080px; margin:0 auto; }
.lis-topbar { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:22px; }
.lis-part { font-weight:800; color:var(--navy); font-size:16px; }
.lis-qnum { color:var(--gray-600); font-size:14px; margin-top:2px; }
.lis-topbar-right { display:flex; align-items:center; gap:22px; }
.lis-bookmark { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--gray-200); background:#fff;
  border-radius:999px; padding:9px 16px; font-weight:700; color:var(--gray-600); cursor:pointer; }
.lis-bookmark:hover { border-color:var(--navy); color:var(--navy); }
.lis-bookmark.is-on { color:#DC2626; border-color:#DC2626; }
.lis-bookmark.is-on svg { fill:#DC2626; }
.lis-timer { text-align:right; line-height:1.2; }
.lis-timer span { font-size:26px; font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; }
.lis-timer small { display:block; font-size:12px; color:var(--gray-600); }

.lis-page[hidden] { display:none; }
.lis-question { font-size:17px; color:var(--gray-800); line-height:1.6; margin:0 0 14px; }
.lis-audio-row { display:flex; align-items:center; gap:14px; margin:0 0 20px; }
.lis-play { display:inline-flex; align-items:center; gap:8px; background:none; border:none; color:var(--navy);
  font-weight:700; cursor:pointer; padding:0; }
.lis-play .lis-play-label { text-decoration:underline; }
.lis-play.is-playing { color:var(--emerald-600); }
.lis-play.is-spent { color:#9CA3AF; cursor:not-allowed; }
.lis-play.is-spent .lis-play-label { text-decoration:none; }
.lis-play-left { font-size:12.5px; color:var(--gray-600); }

/* Trắc nghiệm A/B/C dạng bảng */
.lis-mcq { border:1px solid var(--gray-200); border-radius:12px; overflow:hidden; margin-bottom:8px; }
.lis-opt { display:flex; align-items:stretch; cursor:pointer; border-top:1px solid var(--gray-200); }
.lis-opt:first-child { border-top:none; }
.lis-opt input { position:absolute; opacity:0; width:0; height:0; }
.lis-opt-key { flex:0 0 64px; display:flex; align-items:center; justify-content:center; font-weight:800;
  color:var(--navy); border-right:1px solid var(--gray-200); background:#F8FAFC; }
.lis-opt-text { padding:15px 18px; color:var(--gray-800); }
.lis-opt:hover { background:var(--gray-100); }
.lis-opt:has(input:checked) { background:rgba(30,58,138,.06); }
.lis-opt:has(input:checked) .lis-opt-key { background:var(--navy); color:#fff; }

.lis-subq { margin-bottom:20px; }
.lis-subq-text { font-weight:600; color:var(--gray-800); margin:0 0 10px; }
.lis-subq-num { display:inline-flex; width:24px; height:24px; border-radius:50%; background:var(--navy); color:#fff;
  align-items:center; justify-content:center; font-size:12px; font-weight:800; margin-right:6px; }

.lis-selrows { display:flex; flex-direction:column; gap:12px; }
.lis-selrow { display:flex; align-items:center; gap:14px; }
.lis-selrow-block { flex-direction:column; align-items:stretch; gap:8px; background:#F8FAFC;
  border:1px solid var(--gray-200); border-radius:10px; padding:12px 14px; }
.lis-sel-label { font-weight:700; color:var(--navy); min-width:100px; }
.lis-sel-text { color:var(--gray-800); }
.lis-select { padding:9px 12px; border:1px solid var(--gray-200); border-radius:8px; font-size:14px; background:#fff; }

/* Drawer danh sách câu */
.lis-qlist-tabs { display:flex; gap:8px; padding:14px 20px 14px; border-bottom:1px solid var(--gray-200); }
.lis-qtab { background:var(--gray-100); border:none; border-radius:999px; padding:7px 14px; font-weight:700;
  font-size:13px; color:var(--gray-600); cursor:pointer; }
.lis-qtab.is-active { background:var(--navy); color:#fff; }
.lis-qlist { list-style:none; margin:0; padding:0; }
.lis-qitem { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--gray-200);
  border-radius:10px; margin-bottom:8px; cursor:pointer; }
.lis-qitem:hover { border-color:var(--navy); }
.lis-qitem.is-current { border-color:#DC2626; background:rgba(220,38,38,.04); }
.lis-qitem-no { font-weight:800; color:var(--navy); }
.lis-qitem-mid { flex:1; display:flex; flex-direction:column; gap:2px; }
.lis-qitem-part { font-size:13px; color:var(--gray-800); font-weight:600; }
.lis-qitem-status { font-size:12px; color:var(--gray-600); }
.lis-qitem-status.is-done { color:var(--emerald-600); }
.lis-qitem-bm { color:#DC2626; }

@media (max-width:600px){
  .lis-topbar { flex-direction:column; }
  .lis-topbar-right { width:100%; justify-content:space-between; }
}

/* ---- Grammar & Vocabulary (task matching) ---- */
.gv-tag { display:inline-block; background:var(--gray-100); color:var(--navy); font-weight:700; font-size:13px;
  padding:5px 13px; border-radius:999px; margin-bottom:14px; }
.gv-example { display:flex; align-items:center; gap:10px; padding-bottom:16px; margin-bottom:18px; border-bottom:1px solid var(--gray-200); }
.gv-ex-label { color:var(--gray-600); font-size:13px; margin-right:6px; }
.gv-ex-box { background:#F8FAFC; border:1px solid var(--gray-200); border-radius:8px; padding:8px 16px; color:var(--gray-600); }
.gv-op { color:var(--gray-600); font-weight:700; }
.gv-rows { display:flex; flex-direction:column; gap:14px; }
.gv-row { display:flex; align-items:center; gap:12px; }
.gv-left { flex:0 0 auto; width:210px; background:#fff; border:1px solid var(--gray-200); border-radius:10px;
  padding:11px 15px; color:var(--gray-800); font-weight:600; }
.gv-row-def .gv-left { flex:1 1 auto; width:auto; font-weight:500; }
.gv-row-gap { flex-wrap:wrap; }
.gv-gap-text { color:var(--gray-800); }
.gv-select { min-width:210px; }
@media (max-width:600px){
  .gv-row { flex-wrap:wrap; }
  .gv-left, .gv-select { width:100%; min-width:0; flex:1 1 100%; }
}

/* ================= Thi thử: READING (làm từng phần) ================= */
.rd-page { max-width:860px; margin:0 auto; }
.lis-instruction { background:#F8FAFC; border:1px solid var(--gray-200); border-radius:12px;
  padding:15px 20px; font-weight:700; color:var(--gray-800); line-height:1.55; margin:0 0 24px; }
.rd-topic { font-size:20px; font-weight:800; color:var(--navy); margin:0 0 18px; }

/* ---- Part 1: điền từ ---- */
.rgap-list { display:flex; flex-direction:column; gap:16px; }
.rgap-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; color:var(--gray-800); font-size:16px; line-height:1.7; }
.rgap-given { display:inline-block; background:var(--gray-100); border:1px solid var(--gray-200); color:var(--gray-600);
  border-radius:8px; padding:8px 18px; font-weight:600; }
.rgap-select { min-width:120px; }

/* ---- Part 2 & 3: sắp xếp câu (kéo thả) ---- */
.rord { display:flex; align-items:stretch; gap:0; border:1px solid var(--gray-200); border-radius:16px;
  background:#fff; box-shadow:var(--shadow); overflow:hidden; }
.rord-slots { flex:1 1 46%; display:flex; flex-direction:column; gap:14px; padding:22px; }
.rord-slot { position:relative; min-height:66px; border:2px dashed var(--gray-200); border-radius:12px;
  display:flex; align-items:center; padding:8px 14px 8px 46px; transition:border-color .12s, background .12s; }
.rord-slot.is-over { border-color:var(--navy); background:rgba(30,58,138,.05); }
.rord-slot.is-filled { border-style:solid; border-color:var(--gray-200); background:#fff; }
.rord-slotno { position:absolute; left:16px; top:50%; transform:translateY(-50%); font-weight:800; color:var(--gray-600); font-size:15px; }
.rord-divider { flex:0 0 1px; background:var(--gray-200); }
.rord-pool { flex:1 1 54%; display:flex; flex-direction:column; gap:12px; padding:22px; background:#F8FAFC; }
.rord-card { display:flex; align-items:flex-start; gap:10px; background:#fff; border:1px solid var(--gray-200);
  border-radius:12px; padding:13px 15px; cursor:grab; box-shadow:var(--shadow); color:var(--gray-800); line-height:1.5; }
.rord-slot .rord-card { width:100%; box-shadow:none; cursor:grab; }
.rord-card.is-dragging { opacity:.5; }
.rord-card.is-sel { border-color:var(--navy); box-shadow:0 0 0 2px rgba(30,58,138,.18); }
.rord-grip { color:var(--gray-300); font-weight:800; letter-spacing:-2px; line-height:1.4; user-select:none; }
.rord-card-text { flex:1; }
@media (max-width:720px){ .rord { flex-direction:column; } .rord-divider { display:none; } }

/* ---- Part 4: ghép ý kiến với người ---- */
.rmatch-people { background:#fff; border:1px solid var(--gray-200); border-radius:16px; box-shadow:var(--shadow);
  padding:8px 22px; margin-bottom:22px; }
.rmatch-person { padding:16px 0; border-top:1px solid var(--gray-100); }
.rmatch-person:first-child { border-top:none; }
.rmatch-plabel { font-weight:800; color:var(--navy); margin-bottom:6px; }
.rmatch-ptext { color:var(--gray-800); line-height:1.6; margin:0; }
.rmatch-qs { background:#fff; border:1px solid var(--gray-200); border-radius:16px; box-shadow:var(--shadow); padding:8px 22px; }
.rmatch-qrow { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0;
  border-top:1px solid var(--gray-100); }
.rmatch-qrow:first-child { border-top:none; }
.rmatch-qtext { color:var(--gray-800); }
.rmatch-select { flex:0 0 92px; text-align:center; }

/* ---- Part 5: ghép tiêu đề cho đoạn văn ---- */
.rhead-title { font-size:24px; font-weight:800; color:var(--gray-900); margin:0 0 20px; }
.rhead-paras { display:flex; flex-direction:column; gap:16px; }
.rhead-para { border:1px solid var(--gray-200); border-radius:16px; box-shadow:var(--shadow); padding:18px 20px; background:#fff; }
.rhead-parahead { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.rhead-num { font-weight:800; color:var(--gray-700); }
.rhead-select { flex:1; max-width:420px; }
.rhead-text { color:var(--gray-800); line-height:1.65; margin:0; }
@media (max-width:600px){ .rmatch-qrow { flex-direction:column; align-items:stretch; } .rmatch-select { flex:none; } }

/* ================= Thi thử: WRITING (làm từng part) ================= */
.wrt-page { max-width:820px; margin:0 auto; }
/* Lời dẫn của part hiện đậm ở thanh trên (thay cho "Question x of y") */
.wrt-wrap .lis-qnum.wrt-lead { color:var(--gray-800); font-weight:700; font-size:15px; line-height:1.5; max-width:640px; margin-top:4px; }

.wrt-qcard { background:#F9FAFB; border:1px solid var(--gray-200); border-radius:14px; padding:18px 20px; margin-bottom:18px; }
.wrt-qtext { color:var(--gray-800); font-size:15.5px; margin:0 0 12px; }
.wrt-prompt { color:var(--gray-800); font-weight:700; margin:0 0 10px; }
.wrt-block { margin-bottom:26px; }
.wrt-textarea { width:100%; border:1px solid var(--gray-200); border-radius:12px; padding:13px 15px; font-size:15px;
  font-family:inherit; color:var(--gray-900); line-height:1.6; resize:vertical; background:#fff; }
.wrt-textarea:focus { outline:none; border-color:var(--navy); box-shadow:0 0 0 3px rgba(30,58,138,.12); }
.wrt-count { text-align:right; font-size:12.5px; color:var(--gray-600); margin-top:6px; }
.wrt-count b { color:var(--gray-800); }
.wrt-count.is-over { color:#DC2626; }
.wrt-count.is-over b { color:#DC2626; }
.wrt-scenario { background:#F9FAFB; border:1px solid var(--gray-200); border-radius:14px; padding:18px 20px;
  color:var(--gray-800); line-height:1.7; margin-bottom:26px; white-space:pre-line; }

/* ================= Thi thử: MÀN AI ĐANG CHẤM ================= */
.mgrade { display:flex; align-items:center; justify-content:center; min-height:60vh; padding:60px 20px; }
.mgrade-inner { text-align:center; max-width:560px; }
.mgrade-spinner { width:56px; height:56px; margin:0 auto 26px; border-radius:50%;
  border:4px solid var(--gray-200); border-top-color:#DC2626; animation:mgrade-spin .9s linear infinite; }
@keyframes mgrade-spin { to { transform:rotate(360deg); } }
.mgrade-title { font-size:22px; font-weight:800; color:var(--gray-900); margin:0 0 12px; }
.mgrade-progress { color:var(--gray-700); font-weight:600; margin:0 0 8px; }
.mgrade-note { color:var(--gray-500); font-size:14px; margin:0; }

/* ================= Thi thử: CHỨNG CHỈ MÔ PHỎNG ================= */
.mcert { position:relative; background:#fff; border:1px solid var(--gray-200); border-radius:20px; overflow:hidden;
  box-shadow:var(--shadow-lg, 0 12px 40px rgba(15,23,42,.10)); }
.mcert::before { content:""; position:absolute; inset:0; border:2px solid rgba(30,58,138,.10); border-radius:20px;
  margin:8px; pointer-events:none; }
.mcert-top { display:flex; justify-content:space-between; align-items:flex-start; gap:16px;
  padding:26px 30px 0; }
.mcert-brand { display:flex; align-items:center; gap:12px; }
.mcert-brand img { height:40px; width:auto; }
.mcert-brand-name { font-weight:800; color:var(--navy); font-size:17px; }
.mcert-brand-sub { color:var(--gray-500); font-size:13px; }
.mcert-kind { text-align:right; font-weight:900; letter-spacing:.08em; color:var(--navy); font-size:14px; line-height:1.25; }
.mcert-meta { display:flex; flex-wrap:wrap; gap:26px; padding:18px 30px; border-bottom:1px dashed var(--gray-200); }
.mcert-meta > div { display:flex; flex-direction:column; gap:2px; }
.mcert-k { font-size:12px; color:var(--gray-500); text-transform:uppercase; letter-spacing:.04em; }
.mcert-v { font-weight:700; color:var(--gray-900); }

.mcert-overall { text-align:center; padding:26px 20px 6px; }
.mcert-overall-label { display:block; color:var(--gray-600); font-weight:600; margin-bottom:10px; }
.mcert-overall-band { display:inline-flex; align-items:center; justify-content:center; min-width:120px; height:96px;
  padding:0 26px; border-radius:18px; font-size:52px; font-weight:900; color:#fff; background:var(--navy); }
.mcert-overall-note { display:block; color:var(--gray-500); font-size:13px; margin-top:12px; }

.mcert-skills { display:flex; flex-direction:column; gap:2px; padding:16px 30px 6px; }
.mcert-skill { display:grid; grid-template-columns:1.2fr 2fr auto; align-items:center; gap:16px; padding:13px 0;
  border-top:1px solid var(--gray-100); }
.mcert-skill:first-child { border-top:none; }
.mcert-skill-name { font-weight:700; color:var(--gray-900); display:flex; flex-direction:column; gap:3px; }
.mcert-skill-tag { font-size:11px; font-weight:600; color:var(--gray-500); }
.mcert-skill-bar { height:10px; background:var(--gray-100); border-radius:999px; overflow:hidden; }
.mcert-skill-bar > span { display:block; height:100%; border-radius:999px; background:var(--navy); }
.mcert-skill-score { display:flex; align-items:center; justify-content:flex-end; gap:12px; }
.mcert-pts { font-weight:800; color:var(--gray-900); font-variant-numeric:tabular-nums; }
.mcert-pts small { color:var(--gray-500); font-weight:600; }
.mcert-skill-na { display:flex; align-items:center; gap:12px; justify-content:flex-end; grid-column:2 / 4; }
.mcert-na-pill { background:#FEF3C7; color:#92400E; border:1px solid #FCD34D; border-radius:999px; padding:5px 12px; font-weight:700; font-size:13px; }
.mcert-na-why { color:var(--gray-500); font-size:13px; }
.mcert-foot { color:var(--gray-500); font-size:13px; line-height:1.6; padding:16px 30px 26px; margin:0; }

/* Band pill + thanh màu theo band */
.mcert-band { display:inline-flex; min-width:42px; justify-content:center; padding:5px 12px; border-radius:999px;
  font-weight:800; font-size:14px; color:#fff; background:var(--gray-400, #9CA3AF); }
.band-C1 { background:#1E3A8A; } .band-B2 { background:#10B981; } .band-B1 { background:#3B82F6; }
.band-A2 { background:#F97316; } .band-A1 { background:#9CA3AF; } .band-A0, .band-na { background:#CBD5E1; }
.band-fill-C1 { background:#1E3A8A !important; } .band-fill-B2 { background:#10B981 !important; }
.band-fill-B1 { background:#3B82F6 !important; } .band-fill-A2 { background:#F97316 !important; }
.band-fill-A1 { background:#9CA3AF !important; } .band-fill-A0, .band-fill-na { background:#CBD5E1 !important; }

/* Nhận xét AI trên trang kết quả */
.mres-h { margin:34px 0 14px; font-size:20px; font-weight:800; color:var(--gray-900); }
.mres-ai { padding:18px 20px; }
.mres-ai-overall { color:var(--gray-800); line-height:1.65; margin:12px 0 16px; }
.mres-ai-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px 26px; }
.mres-ai-col h4 { margin:0 0 8px; font-size:14px; color:var(--navy); }
.mres-ai-col ul { margin:0; padding-left:18px; color:var(--gray-700); line-height:1.6; }
.mres-ai-col li { margin-bottom:5px; }
@media (max-width:640px){
  .mcert-skill { grid-template-columns:1fr auto; }
  .mcert-skill-bar { grid-column:1 / 3; order:3; }
  .mres-ai-grid { grid-template-columns:1fr; }
}

/* ===== Nhãn HOT trên menu (mục "Ôn tập qua video") ===== */
.nav-hot {
  display: inline-block; margin-left: 4px; padding: 1px 6px; font-size: 10px; font-weight: 800;
  line-height: 1.4; letter-spacing: .5px; color: #fff; background: #F97316; border-radius: 6px;
  vertical-align: middle; box-shadow: 0 1px 3px rgba(249,115,22,.4);
}

/* ===== "Ôn tập qua video" — bố cục LMS ===== */
.vid-wrap { padding-top: 22px; padding-bottom: 40px; }
.vid-head { margin-bottom: 18px; }
.vid-title { margin: 0 0 4px; font-size: 26px; color: #1E3A8A; }
.vid-sub { margin: 0; color: #6b7280; font-size: 15px; }
.vid-empty {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 40px 20px;
  text-align: center; color: #6b7280;
}

.vid-lms { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }

/* Cột trái: danh sách */
.vid-list {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px;
  max-height: 78vh; overflow-y: auto; position: sticky; top: 84px;
}
.vid-group + .vid-group { margin-top: 8px; }
.vid-group-title {
  margin: 8px 8px 6px; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: #94a3b8;
}
.vid-items { list-style: none; margin: 0; padding: 0; }
.vid-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 10px; border: 1px solid transparent; border-radius: 10px; background: transparent;
  cursor: pointer; transition: background .15s, border-color .15s; color: #1f2937;
}
.vid-item:hover { background: #f1f5f9; }
.vid-item.is-active { background: #EFF6FF; border-color: #bfdbfe; }
.vid-item-ic { font-size: 18px; line-height: 1.4; flex: 0 0 auto; }
.vid-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vid-item-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.vid-item.is-active .vid-item-name { color: #1E3A8A; }
.vid-item-dur { font-size: 12px; color: #94a3b8; }
.vid-new {
  display: inline-block; margin-left: 4px; padding: 0 5px; font-size: 9px; font-weight: 800;
  color: #fff; background: #10B981; border-radius: 5px; vertical-align: middle;
}

/* Cột phải: khung phát */
.vid-main { min-width: 0; }
.vid-stage {
  position: relative; background: #0b1220; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
}
.vid-stage-empty { color: #cbd5e1; font-size: 15px; padding: 20px; text-align: center; }
.vid-player, .vid-frame-box, .vid-frame { width: 100%; height: 100%; display: block; }
.vid-player { object-fit: contain; background: #000; }
.vid-frame-box { position: absolute; inset: 0; }
.vid-frame { border: 0; }
.vid-now-title { margin: 16px 0 6px; font-size: 20px; color: #1E3A8A; }
.vid-now-desc { color: #374151; font-size: 15px; line-height: 1.7; white-space: pre-wrap; }

@media (max-width: 860px) {
  .vid-lms { grid-template-columns: 1fr; }
  .vid-list { position: static; max-height: none; order: 2; }
  .vid-main { order: 1; }
}

/* Ảnh minh hoạ tuỳ chọn trong overlay bài học (dùng chung khung .ovl) */
.ovl-img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin: 0 0 14px; }

/* ===== Blog "Mẹo tăng điểm" ===== */
.blog-wrap, .blog-article { padding-top: 22px; padding-bottom: 44px; }
.blog-head { margin-bottom: 16px; }
.blog-h1 { margin: 0 0 4px; font-size: 26px; color: #1E3A8A; }
.blog-sub { margin: 0; color: #6b7280; font-size: 15px; }
.blog-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.blog-tab { padding: 7px 14px; border-radius: 999px; background: #f1f5f9; color: #334155; font-weight: 600; font-size: 14px; text-decoration: none; }
.blog-tab:hover { background: #e2e8f0; }
.blog-tab.is-active { background: #1E3A8A; color: #fff; }
.blog-tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.blog-tagchip { padding: 3px 10px; border-radius: 999px; background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; font-size: 13px; text-decoration: none; }
.blog-tagchip.is-active { background: #10B981; color: #fff; border-color: #10B981; }
.blog-empty { background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 40px 20px; text-align: center; color: #6b7280; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.blog-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(2,6,23,.08); }
.blog-card-thumb { aspect-ratio: 16/9; background: #eef2f7; overflow: hidden; }
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-thumb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 44px; opacity: .5; }
.blog-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.blog-card-title { margin: 0; font-size: 16px; line-height: 1.4; color: #1E3A8A; }
.blog-card-excerpt { margin: 0; font-size: 13.5px; color: #475569; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-meta { margin-top: auto; font-size: 12px; color: #94a3b8; display: flex; gap: 8px; flex-wrap: wrap; }
.blog-card-tags { color: #10B981; }
.blog-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.blog-page-ind { color: #6b7280; font-size: 14px; }

/* Bài viết chi tiết */
.blog-article { max-width: 760px; }
.blog-crumb { margin: 0 0 12px; }
.blog-art-skill { display: inline-block; font-size: 13px; font-weight: 700; color: #10B981; margin-bottom: 6px; }
.blog-art-title { margin: 0 0 8px; font-size: 30px; line-height: 1.25; color: #1E3A8A; }
.blog-art-meta { color: #94a3b8; font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; }
.blog-art-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.blog-art-cover { width: 100%; border-radius: 14px; margin: 18px 0; display: block; }
.blog-content { font-size: 16.5px; line-height: 1.8; color: #1f2937; }
.blog-content h2 { font-size: 23px; color: #1E3A8A; margin: 28px 0 10px; }
.blog-content h3 { font-size: 19px; color: #1E3A8A; margin: 22px 0 8px; }
.blog-content p { margin: 0 0 16px; }
.blog-content ul, .blog-content ol { margin: 0 0 16px; padding-left: 24px; }
.blog-content li { margin: 4px 0; }
.blog-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; }
.blog-content video { width: 100%; border-radius: 10px; margin: 10px 0; background: #000; }
.blog-content blockquote { margin: 16px 0; padding: 10px 16px; border-left: 4px solid #10B981; background: #F0FDF4; color: #374151; border-radius: 0 8px 8px 0; }
.blog-content a { color: #1E3A8A; text-decoration: underline; }
.blog-content pre { background: #0b1220; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; }
.blog-content iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; margin: 12px 0; }
.blog-related { margin-top: 40px; border-top: 1px solid #e5e7eb; padding-top: 24px; }
.blog-related-h { font-size: 20px; color: #1E3A8A; margin: 0 0 16px; }

/* Nhãn kỹ năng trên thẻ bài (view "Tất cả") */
.blog-card-skill { color: #1E3A8A; font-weight: 700; }
