/* Bảng màu lấy từ AppColors của app (tông nắng chiều + vàng nhấn + 3 màu
   huy hiệu A/B/C) để website trông cùng một nhà với app. */
:root {
  --bg: #FBF6EE;
  --card: #FFFCF8;
  --row: #F7F5F1;
  --line: #E8E5E0;
  --text: #202A38;
  --gray: #6B6E7E;
  --muted: #A9AEB6;
  --gold: #FFB72B;
  --gold-deep: #C27C00;
  --gold-soft: #FFF0D2;
  --green: #2EA06E;
  --green-soft: #E3F5EC;
  --red: #E22828;
  --red-soft: #FDE8E8;
  --indigo: #6366F1;
  --teal: #0D9488;
  --coral: #F4725E;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(32, 42, 56, .06), 0 6px 20px rgba(32, 42, 56, .06);
  --ipa-font: "Segoe UI", "Noto Sans", "Charis SIL", "Doulos SIL", "Lucida Sans Unicode", "DejaVu Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
[hidden] { display: none !important; }

/* ---------- Khung trang ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 252, 248, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1440px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; flex: none; }
.brand img { border-radius: 10px; }
.brand b { color: var(--gold-deep); font-weight: 800; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  font-weight: 600; font-size: 14.5px; color: var(--gray);
}
.nav a:hover { background: var(--row); color: var(--text); }
.nav a.on { background: var(--gold-soft); color: var(--text); }
sup {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--coral);
  padding: 1px 6px; border-radius: 999px; margin-left: 5px; vertical-align: top;
}
.account-btn {
  flex: none; max-width: 220px; display: inline-flex; align-items: center; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  border: 1.5px solid var(--line); background: var(--card);
}
.account-btn.signed-in { border-color: var(--gold); }

.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 140px; min-height: 70vh; }
.footer {
  background: var(--card); border-top: 1px solid var(--line);
  padding: 36px 16px 130px; color: var(--gray); font-size: 14.5px;
}
.footer-in {
  max-width: 1280px; margin: 0 auto; display: grid; gap: 32px 40px; align-items: start;
  grid-template-columns: 250px minmax(0, 1fr) 230px;
}
.footer-brand img { display: block; width: 190px; height: auto; margin-bottom: 12px; }
.footer-brand p { margin: 0 0 4px; }
.footer-brand b { color: var(--text); }
.footer-links { display: flex; flex-direction: column; gap: 2px; margin-top: 10px !important; }
.footer a:hover { color: var(--gold-deep); }
.footer-title { font-size: 16px; color: var(--text); margin-bottom: 14px; }
.offices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; }
.office { font-style: normal; display: flex; flex-direction: column; gap: 4px; overflow-wrap: break-word; min-width: 0; }
.office b { color: var(--text); font-size: 15px; margin-bottom: 4px; }
/* Ô mời cà phê: tách hẳn khỏi phần giới thiệu, nằm ngoài cùng bên phải. */
.footer-coffee {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 18px 16px; border-radius: var(--radius); border: 2px dashed var(--gold); background: #FFF8E8;
}
.footer-coffee:hover { background: var(--gold-soft); }
.footer-coffee b { color: var(--text); font-size: 15.5px; }
.footer-coffee small { font-size: 13px; line-height: 1.45; }
.coffee-cup { font-size: 32px; line-height: 1; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.page-head .sub { margin: 6px 0 0; color: var(--gray); max-width: 760px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--gray); font-weight: 600; font-size: 14.5px; }
.back:hover { color: var(--text); }

.loading, .empty { color: var(--gray); padding: 32px 0; text-align: center; }
.notice {
  background: var(--gold-soft); border-radius: 12px; padding: 12px 16px; margin: 12px 0;
  font-size: 14.5px;
}
.notice-err { background: var(--red-soft); color: #8E1414; }
.grid-note { grid-column: 1 / -1; margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* ---------- Nút & ô nhập ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); font-weight: 600;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #2A1E00; }
.btn-primary:hover { background: #F5A90F; border-color: #F5A90F; }
.btn-lg { padding: 13px 24px; font-size: 17px; border-radius: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 12px; font-weight: 700; font-size: 14px; min-width: 58px;
}
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; outline: none;
}
select { width: auto; padding: 8px 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { min-height: 220px; resize: vertical; line-height: 1.7; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-deep); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h2, .card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { margin: 0 0 10px; }
.muted { color: var(--gray); font-size: 14.5px; }
.pre { white-space: pre-wrap; }

/* ---------- Trang chủ ---------- */
.hero {
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, #FFE9BF 0%, #FFD9C9 100%);
  border-radius: 24px; padding: clamp(22px, 4vw, 40px); margin-bottom: 24px;
}
.hero h1 { font-size: clamp(26px, 4.6vw, 40px); font-weight: 800; max-width: 620px; }
.hero h1 em { font-style: normal; color: #B4530A; }
.hero p { max-width: 560px; margin: 12px 0 20px; }
.streak {
  background: rgba(255, 255, 255, .75); border-radius: 20px; padding: 18px 24px; text-align: center;
  min-width: 170px; max-width: 220px;
}
.streak b { display: block; font-size: 44px; line-height: 1; color: #B4530A; }
.streak span { font-size: 14px; color: var(--gray); }

/* Dải "bài mới mỗi ngày" - điểm bán hàng chính nên cho nổi hẳn lên. */
.fresh-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, #E7FBF4 0%, #D3F4EC 100%);
  border: 2px solid var(--teal); border-radius: 20px; padding: 20px 24px; margin-bottom: 24px;
}
.fresh-banner > div:nth-child(2) { flex: 1; min-width: 240px; }
.fresh-banner h2 { font-size: clamp(19px, 2.6vw, 24px); font-weight: 800; color: #065F56; }
.fresh-banner p { margin: 6px 0 0; }
.fresh-icon { font-size: 40px; line-height: 1; animation: fresh-spin 6s linear infinite; }
@keyframes fresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fresh-icon { animation: none; } }
.fresh-stat { font-weight: 600; color: #065F56; }
.fresh-count { font-size: 26px; font-weight: 800; color: var(--teal); vertical-align: -2px; }
.fresh-links { display: flex; flex-direction: column; gap: 8px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.section-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 6px;
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
}
.section-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.section-card.featured { border-color: var(--gold); background: #FFF8E8; }
.section-icon { font-size: 30px; line-height: 1; }
.section-card b { font-size: 18px; }
.section-card p { margin: 0; color: var(--gray); font-size: 14.5px; flex: 1; }
.section-card small { color: var(--gold-deep); font-weight: 700; }

.coffee-banner {
  display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 18px 20px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 2px dashed var(--gold);
}
.coffee-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.coffee-banner small { color: var(--gray); font-size: 14.5px; }
.pay-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--row); border-radius: 12px; padding: 10px 14px; margin-top: 12px;
}
.pay-row span { display: flex; flex-direction: column; }
.pay-row code { font: 600 17px/1.4 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.qr { display: block; margin: 8px auto 4px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.support { grid-template-columns: 1fr 1fr; }
.member-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px;
}
.member-card > div { flex: 1; min-width: 200px; }
.member-card p { margin: 2px 0 0; font-size: 14.5px; }
.member-badge {
  flex: none; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 13.5px;
  background: var(--row); color: var(--gray); border: 1.5px solid var(--line);
}
/* Thành viên Pro: thẻ vàng nổi bật để thấy rõ mình khác gói thường. */
.member-card.pro {
  background: linear-gradient(135deg, #FFF3CC 0%, #FFE08A 55%, #FFC94D 100%);
  border-color: #E0A100; box-shadow: 0 6px 24px rgba(224, 161, 0, .28);
}
.member-card.pro b { font-size: 19px; }
.member-card.pro .member-badge { background: #2A1E00; color: #FFD45E; border-color: #2A1E00; }
.plan-badge {
  margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
  background: var(--row); color: var(--gray); vertical-align: 1px;
}
.plan-badge.pro { background: #2A1E00; color: #FFD45E; }
.plan-badge { flex: none; }
.acct-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.acct-icon { margin-right: 5px; flex: none; }
/* Điện thoại, đã đăng nhập: thanh trên cùng chật (logo + chuông + nút Pro), nên
   nút tài khoản thu lại thành biểu tượng ⚙ tròn; tên và huy hiệu gói vẫn xem
   được ở trang Tài khoản, còn trạng thái Pro đã có ở nút "⭐ Pro" bên cạnh. */
@media (max-width: 560px) {
  .account-btn.signed-in { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .account-btn.signed-in .acct-name, .account-btn.signed-in .plan-badge { display: none; }
  .account-btn.signed-in .acct-icon { margin: 0; font-size: 17px; }
  body.is-pro .brand::after { display: none; }
  .bell-panel { position: fixed; right: 12px; left: 12px; top: 64px; width: auto; }
}
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.steps span { padding: 6px 12px; border-radius: 999px; background: var(--row); color: var(--gray); font-size: 13.5px; font-weight: 600; }
.steps .on { background: var(--gold); color: #2A1E00; }
.steps .done { background: var(--green-soft); color: var(--green); }
.history { width: 100%; border-collapse: collapse; font-size: 15px; }
.history th, .history td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: center; }
.history th { border-top: 0; color: var(--gray); font-size: 13.5px; }
.test-card { border-style: dashed; border-color: var(--line); }
.test-card.ready { border-color: var(--teal); background: #EEFAF8; }
.test-card.ready small { color: var(--teal); }
.test-card sup { background: var(--teal); }
body.is-pro .account-btn { border-color: #E0A100; background: #FFF3CC; }
body.is-pro .brand::after {
  content: "PRO"; margin-left: 2px; padding: 1px 8px; border-radius: 999px;
  background: #2A1E00; color: #FFD45E; font-size: 11px; font-weight: 800;
}
.upgrade-link {
  flex: none; padding: 7px 14px; border-radius: 999px; white-space: nowrap; font-size: 14.5px;
  background: var(--gold); color: #2A1E00; font-weight: 700;
}
.upgrade-link:hover { background: #F5A90F; }
body.is-pro .upgrade-link { background: #2A1E00; color: #FFD45E; }
/* Chưa đủ rộng để xếp 1 hàng: menu học xuống hàng riêng, không mục nào bị che. */
.topbar.nav-wrap .topbar-in { flex-wrap: wrap; gap: 8px 12px; }
.topbar.nav-wrap .nav { order: 3; flex-basis: 100%; }
.topbar.nav-wrap .brand { flex: 1; }
.upgrade-link .short { display: none; }
@media (max-width: 560px) {
  .upgrade-link .long { display: none; }
  .upgrade-link .short { display: inline; }
}
@media (max-width: 480px) {
  .upgrade-link { padding: 6px 10px; font-size: 13px; }
  .account-btn { max-width: 120px; padding: 6px 10px; font-size: 13px; }
  .brand span { font-size: 16px; }
}
.section-title { font-size: 20px; margin: 22px 0 12px; }
.compare table { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: center; }
.compare th { border-top: 0; font-size: 14px; color: var(--gray); }
.compare td:first-child, .compare th:first-child { text-align: left; }
.compare .pro-col { background: #FFF8E8; font-weight: 600; color: var(--text); }
/* ---------- Thông báo của website (lịch cập nhật hệ thống...) ---------- */
.site-notice {
  display: flex; align-items: flex-start; gap: 12px; justify-content: center;
  background: #FFF3CC; border-bottom: 1px solid #E0A100; color: #5C4200;
  padding: 10px 16px; font-size: 14.5px;
}
.site-notice span { max-width: 1000px; }
.site-notice button { border: 0; background: none; font-size: 15px; padding: 0 4px; color: inherit; flex: none; }

/* ---------- Nói theo chủ đề ---------- */
.vocab-table { width: 100%; border-collapse: collapse; }
.vocab-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.vocab-table tr:first-child td { border-top: 0; }
.vocab-table td:first-child { width: 44px; }
.vocab-table b { display: block; }
.vocab-table i { font-family: var(--ipa-font); font-style: normal; color: var(--gray); font-size: 14.5px; }
.vocab-table small { display: block; color: var(--gray); font-size: 13.5px; }
.sample-vi { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; margin: 8px 0 4px; font-size: 16.5px; }
.sample-vi small { display: block; font-size: 12.5px; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.example span { display: block; }
/* Phần "mờ ảo" cho người chưa có Pro: chữ giả, không chọn/chép được. */
.blurred { filter: blur(5px); user-select: none; pointer-events: none; opacity: .75; margin-top: 10px; }
.blurred p { margin: 0 0 10px; letter-spacing: .02em; }
.member-card.pro-only { border-color: #E0A100; background: #FFF8E8; }
.member-card.pro-only .member-badge { background: #2A1E00; color: #FFD45E; border-color: #2A1E00; }
.switch input { width: 20px; height: 20px; }

/* ---------- Chuông thông báo + lời chúc mừng ---------- */
.bell-wrap { position: relative; flex: none; }
.bell-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; font-size: 18px;
  border: 1.5px solid var(--line); background: var(--card);
}
.bell-btn:hover { border-color: var(--gold); }
.bell-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px;
}
.bell-panel {
  position: absolute; right: 0; top: 48px; z-index: 40; width: min(340px, calc(100vw - 32px));
  max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 36px rgba(32, 42, 56, .18); padding: 14px;
}
.bell-title { display: block; margin-bottom: 8px; }
.bell-item { padding: 10px 12px; border-radius: 12px; margin-bottom: 6px; background: var(--row); }
.bell-item.unread { background: var(--gold-soft); }
.bell-item p { margin: 4px 0; font-size: 14px; }
.bell-item small { color: var(--gray); font-size: 12px; }
.celebrate {
  position: fixed; inset: 0; z-index: 60; background: rgba(32, 42, 56, .55);
  display: grid; place-items: center; padding: 16px;
}
.celebrate-card {
  max-width: 440px; text-align: center; padding: 30px 26px; border-radius: 24px;
  background: linear-gradient(135deg, #FFF8E0 0%, #FFE08A 100%); border: 2px solid #E0A100;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: celebrate-pop .35s ease-out;
}
.celebrate-card h2 { font-size: 24px; font-weight: 800; margin: 6px 0 10px; }
.celebrate-card p { margin: 0 0 20px; }
.celebrate-icon { font-size: 60px; line-height: 1; }
@keyframes celebrate-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .celebrate-card { animation: none; } }
.greeting { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.greeting input { flex: 1; min-width: 140px; max-width: 260px; padding: 7px 12px; font-size: 17px; font-weight: 600; text-align: center; }
.edit-name { border: 0; background: none; font-size: 16px; padding: 4px 6px; border-radius: 8px; opacity: .65; }
.edit-name:hover { opacity: 1; background: var(--row); }
.paypal-card summary { cursor: pointer; }
.admin-table { font-size: 14px; }
.admin-table td { text-align: left; overflow-wrap: anywhere; }
.admin-table tr.attention td { font-weight: 700; background: var(--red-soft); }
.provider-btn { width: 100%; justify-content: center; padding: 13px 18px; font-size: 16px; margin-top: 8px; background: #fff; }
.provider-icon {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: #4285F4; font-size: 14px;
}
.plan-grid { grid-template-columns: repeat(4, 1fr); }
.plan-card.lifetime { background: linear-gradient(135deg, #FFF3CC 0%, #FFE08A 100%); border-color: #E0A100; }
.plan-card.lifetime sup { background: #2A1E00; color: #FFD45E; }
.plan-price del { font-size: 15px; font-weight: 500; color: var(--gray); }
@media (max-width: 1000px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
.plan-card.mine { border-color: #E0A100; box-shadow: 0 0 0 3px rgba(255, 201, 77, .5); }
.plan-card.mine sup { background: #2A1E00; color: #FFD45E; }
.plan-card b { font-size: 18px; }
.pay-card { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 20px 28px; align-items: start; }
.pay-notes { margin: 14px 0 0; padding-left: 20px; font-size: 14.5px; color: var(--gray); }
.pay-notes li { margin-bottom: 6px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.choice-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 26px 20px; background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.choice-card:hover, .choice-card.on { border-color: var(--gold); }
.choice-card.featured { border-color: var(--gold); background: #FFF8E8; }
.choice-card b { font-size: 20px; }
.choice-card small { color: var(--gray); font-size: 14.5px; max-width: 340px; }
.choice-icon { font-size: 40px; line-height: 1; }
.hero-note { font-size: 14.5px; margin: 14px 0 0 !important; }
.footer-support { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 0; text-align: center; font-size: 13.5px; }
.footer-support b { color: var(--text); }
.footer-support a { color: var(--gold-deep); font-weight: 600; }
.profile { text-align: center; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 18px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.plan-card.on { border-color: var(--gold); background: var(--gold-soft); }
.plan-card sup { position: absolute; top: 12px; right: 12px; margin: 0; }
.plan-card small { color: var(--gray); }
.plan-price { font-size: 26px; font-weight: 800; color: var(--gold-deep); }
.plan-price small { font-size: 14px; font-weight: 500; }

/* ---------- Danh sách bài theo trình độ ---------- */
.level-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.level-tab {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 10px 8px; text-align: center; display: flex; flex-direction: column;
}
.level-tab small { color: var(--gray); font-size: 12px; }
.level-tab.on { background: var(--gold-soft); border-color: var(--gold); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lesson-card {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
  border: 1.5px solid transparent;
}
.lesson-card:hover { border-color: var(--gold); }
.lesson-no {
  flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--row);
  display: grid; place-items: center; font-weight: 700; color: var(--gray); font-size: 14px;
}
.lesson-card.done .lesson-no { background: var(--green-soft); color: var(--green); }
.lesson-body { display: flex; flex-direction: column; min-width: 0; }
.lesson-body b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-body small { color: var(--gray); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ĐỌC THEO PHIÊN ÂM ---------- */
.ipa-toolbar { display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--row); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--gray); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.ipa-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ipa-panels[data-view=en] { grid-template-columns: minmax(0, 760px); justify-content: center; }
.ipa-panels[data-view=ipa] { grid-template-columns: minmax(0, 760px); justify-content: center; }
.ipa-panels[data-view=en] .ipa-panel-ipa,
.ipa-panels[data-view=ipa] .ipa-panel-en { display: none; }

.ipa-panel { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.ipa-panel header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: #FFF8E8; border-radius: 20px 20px 0 0;
  position: sticky; top: var(--topbar-h, 57px); z-index: 5;
}
.ipa-panel-ipa header { background: #EEF0FF; }
.ipa-panel header div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ipa-panel header small { color: var(--gray); font-size: 12.5px; }

.play-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--gold); color: #2A1E00; font-size: 17px; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(255, 183, 43, .5);
}
.ipa-panel-ipa .play-btn { background: var(--indigo); color: #fff; box-shadow: 0 2px 8px rgba(99, 102, 241, .45); }
.play-btn:hover { filter: brightness(.96); }
.play-btn.big { width: 52px; height: 52px; font-size: 20px; }

.ipa-body { padding: 18px 20px 24px; font-size: clamp(19px, 2.3vw, 23px); line-height: 2.05; }
.ipa-body-ipa { font-family: var(--ipa-font); letter-spacing: .01em; }
.ipa-body p { margin: 0 0 .7em; }
.ipa-body p:last-child { margin-bottom: 0; }
.ipa-title { font-size: 1.22em; font-weight: 800; margin-bottom: .5em; line-height: 1.6; }
.ipa-body-ipa .ipa-title { font-weight: 700; }

.sent { border-radius: 8px; padding: 3px 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .2s; }
.sent.on { background: var(--gold-soft); }
.ipa-body-ipa .sent.on { background: #E6E8FF; }
.w { border-radius: 6px; padding: 2px 3px; margin: 0 -3px; cursor: pointer; transition: background .08s, color .08s; }
.w:hover { background: var(--row); }
.w.on { background: var(--gold); color: #2A1E00; }
.ipa-body-ipa .w.on { background: var(--indigo); color: #fff; }
.vi { display: none; }
.show-vi .vi {
  display: block; font: 400 15px/1.5 "Be Vietnam Pro", sans-serif; color: var(--gray);
  margin: 0 0 6px; letter-spacing: 0;
}
/* Bản phiên âm không lặp lại nghĩa tiếng Việt khi đang xem cả 2 bản. */
.ipa-panels[data-view=both] .ipa-body-ipa .vi { visibility: hidden; }

.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 252, 248, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.player-in { max-width: 860px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.player-in input[type=range] { flex: 1; min-width: 60px; accent-color: var(--gold-deep); }
.icon-btn { border: 0; background: none; font-size: 20px; width: 40px; height: 40px; border-radius: 50%; flex: none; }
.icon-btn:hover { background: var(--row); }
.time { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--gray); white-space: nowrap; }
.audio-err { color: var(--red); font-size: 13px; }

/* ---------- Trắc nghiệm ---------- */
.quiz-q { margin-bottom: 18px; }
.quiz-text { font-weight: 600; margin: 0 0 8px; }
.quiz-opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
}
.opt:hover:not(:disabled) { border-color: var(--gold); }
.opt:disabled { cursor: default; }
.opt-letter {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: var(--indigo);
}
.opt:nth-child(2) .opt-letter { background: var(--teal); }
.opt:nth-child(3) .opt-letter { background: var(--coral); }
.opt.picked { border-color: var(--gold); background: var(--gold-soft); }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt small { color: var(--gray); font-family: var(--ipa-font); margin-left: 6px; }
.explain { background: var(--row); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; font-size: 14.5px; }

/* ---------- Bài học từ vựng / cụm từ ---------- */
.lesson-flow { max-width: 620px; margin: 0 auto; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .25s; }
.phase { font-size: 13px; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .04em; }
.prompt-vi { font-size: clamp(24px, 4vw, 30px); font-weight: 800; margin: 4px 0 16px; }
.example { background: var(--row); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.example small { display: block; color: var(--gray); }
.verdict { font-weight: 700; margin: 12px 0 0; }
.verdict.ok { color: var(--green); }
.verdict.no { color: var(--red); }
.score { font-size: 54px; font-weight: 800; color: var(--gold-deep); line-height: 1.1; }
.center { text-align: center; }

/* ---------- Luyện đề / Shadowing ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.passage { font-size: 17.5px; line-height: 1.9; }
.passage p { margin: 0 0 1em; }
.rsent { border-radius: 6px; padding: 2px 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .2s; }
.rsent.seekable { cursor: pointer; }
.rsent.on { background: var(--gold-soft); }
.listen-box { margin-bottom: 12px; }
.pro-audio { display: flex; align-items: center; gap: 10px; }
.pro-audio audio { flex: 1; min-width: 0; margin: 0; }
.pro-audio .plan-badge { margin: 0; }
.pro-hint { font-size: 14px; margin: 8px 0 0; }
.gloss { border-bottom: 2px dotted var(--gold-deep); cursor: pointer; }
.gloss:hover, .gloss.open { background: var(--gold-soft); }
.gloss-pop {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  background: var(--text); color: #fff; border-radius: 16px; padding: 12px 18px;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); box-shadow: var(--shadow);
}
.gloss-pop b { font-size: 18px; }
.gloss-pop i { font-family: var(--ipa-font); font-style: normal; color: #FFD98A; }
.gloss-pop button { border: 0; border-radius: 50%; width: 36px; height: 36px; background: var(--gold); flex: none; }
.blank-row { margin-bottom: 14px; line-height: 2.2; }
.blank-row input { width: 170px; display: inline-block; padding: 5px 10px; margin: 0 4px; }
.blank-row input.right { border-color: var(--green); background: var(--green-soft); }
.blank-row input.wrong { border-color: var(--red); background: var(--red-soft); }

.sh-sent {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px;
  border: 1.5px solid transparent; margin-bottom: 6px;
}
.sh-sent.on { background: var(--gold-soft); border-color: var(--gold); }
.sh-sent .play-btn { width: 36px; height: 36px; font-size: 13px; }
.sh-main { flex: 1; min-width: 0; }
.sh-text { font-size: 17.5px; }
.sh-text.blur { filter: blur(6px); user-select: none; }
.sh-main input { margin-top: 8px; }
.diff { margin-top: 6px; font-size: 15.5px; line-height: 1.9; }
.diff .ok { color: var(--green); }
.diff .miss { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.diff .extra { color: var(--muted); text-decoration: line-through; }
audio.native { width: 100%; margin: 4px 0 12px; }

/* ---------- Viết / Nói / chấm AI ---------- */
details.guide { border-top: 1px solid var(--line); padding: 10px 0; }
details.guide summary { font-weight: 600; cursor: pointer; }
details.guide p { margin: 8px 0 0; color: var(--gray); }
.wordcount { font-size: 14px; color: var(--gray); margin-top: 6px; }
.wordcount.enough { color: var(--green); font-weight: 600; }
.band { display: flex; align-items: baseline; gap: 10px; }
.band b { font-size: 42px; color: var(--gold-deep); line-height: 1; }
.criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.criteria div { background: var(--row); border-radius: 12px; padding: 12px; font-size: 14.5px; }
.criteria b { display: flex; justify-content: space-between; gap: 8px; }
.fix { border-left: 3px solid var(--coral); padding: 2px 0 2px 12px; margin-bottom: 12px; font-size: 15px; }
.fix del { color: var(--red); }
.fix ins { color: var(--green); text-decoration: none; font-weight: 600; }
.qa { border-top: 1px solid var(--line); padding: 14px 0; }
.qa:first-of-type { border-top: 0; }
.qa-q { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.qa .btn-row { margin-top: 10px; }
.mini { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.rec { border-color: var(--red); color: var(--red); }
.transcript { min-height: 90px; margin-top: 10px; }
.rec-live {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 14px;
  background: var(--red-soft); border-radius: 12px; color: var(--red);
}
.rec-live b { font-size: 14px; white-space: nowrap; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.wave { flex: 1; min-width: 0; height: 44px; color: var(--red); }
.rec-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.grade-wrap { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.option-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-top: 8px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff;
}
.option-row:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.option-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--gold-deep); flex: none; }
.option-row span { display: flex; flex-direction: column; }
.option-row small { color: var(--gray); font-size: 13.5px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }

.auth-box { max-width: 460px; margin: 0 auto; }
.link { color: var(--gold-deep); font-weight: 600; background: none; border: 0; padding: 0; text-decoration: underline; }

/* ---------- Màn hình hẹp ---------- */
@media (max-width: 860px) {
  .ipa-panels, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 1040px) {
  .footer-in { grid-template-columns: 1fr 1fr; }
  .footer-contact { grid-column: 1 / -1; grid-row: 2; }
  .footer-baokon { justify-self: end; max-width: 260px; }
}
@media (max-width: 620px) {
  .footer-in { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .choice-grid, .pay-card { grid-template-columns: 1fr; }
  .compare th, .compare td { padding: 8px 6px; font-size: 13.5px; }
  .footer-contact { grid-row: auto; }
  .offices { grid-template-columns: 1fr; }
  .footer-baokon { justify-self: stretch; max-width: none; }
}
@media (max-width: 860px) {
  .ipa-panels[data-view=both] .ipa-body-ipa .vi { display: none; }
  .topbar-in { flex-wrap: wrap; gap: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand { flex: 1; }
  .level-tab small { display: none; }
  .hero { padding: 22px; }
  .streak { max-width: none; flex: 1; }
  .time { display: none; }
}

/* ---- Lộ trình của tôi ---- */
.roadmap-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.roadmap-stats > div { flex: 1; min-width: 96px; background: var(--row); border-radius: 12px; padding: 10px 14px; }
.roadmap-stats small { display: block; color: var(--gray); font-size: 13px; }
.roadmap-stats b { font-size: 20px; }
.level-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.level-pick .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; height: auto; padding: 12px 14px; }
.level-pick small { font-weight: 400; opacity: .8; }
.level-pick em { font-style: normal; font-size: 12.5px; font-weight: 700; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week { margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 13px; font-weight: 700; color: var(--gray); }
.cal-cell { min-height: 74px; border: 1px solid var(--line); border-radius: 12px; padding: 5px; background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.cal-cell.empty { border: 0; background: none; }
.cal-cell.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.cal-date { font-size: 13px; color: var(--gray); font-weight: 600; }
.cal-cell.today .cal-date { color: var(--gold-deep); }
.cal-tag { display: block; width: 100%; border: 0; border-radius: 8px; padding: 4px 4px; font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.25; text-align: center; cursor: pointer; background: var(--row); color: var(--gray); }
.cal-tag.done { background: var(--green-soft); color: var(--green); }
.cal-tag.current { background: var(--gold); color: #2A1E00; }
.cal-tag.locked { background: var(--row); color: var(--muted); }
.cal-tag.test { background: #EEF0FF; color: var(--indigo); }
.cal-tag.test.current { background: var(--indigo); color: #fff; }
.cal-tag.test.done { background: #EEF0FF; color: var(--indigo); opacity: .75; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.cal-legend .cal-tag { width: auto; padding: 4px 10px; cursor: default; }

.day-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.day-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); }
.day-item.done { background: var(--green-soft); border-color: transparent; }
.day-no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--gold-soft); color: var(--gold-deep); flex: none; }
.day-item.done .day-no { background: var(--green); color: #fff; }
.day-body { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.day-body small { color: var(--gray); }
.day-item .btn-row { margin: 0; }

.roadmap-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--text); color: #fff; box-shadow: 0 -4px 18px rgba(32, 42, 56, .18); }
.roadmap-bar span { display: flex; flex-direction: column; line-height: 1.3; }
.roadmap-bar small { opacity: .8; }
body.has-roadmap-bar { padding-bottom: 72px; }

@media (max-width: 560px) {
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 62px; padding: 3px; border-radius: 9px; }
  .cal-tag { font-size: 12px; padding: 4px 1px; border-radius: 6px; }
  .cal-grid .cal-word { display: none; }
}
/* ---- Chân trang pháp lý + trang Điều khoản / Bảo mật ---- */
.footer-legal { max-width: 1100px; margin: 18px auto 0; padding: 14px 16px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--gray); line-height: 1.55; }
.footer-legal p { margin: 0 0 6px; }
.footer-legal a { color: var(--gold-deep); font-weight: 600; }
.legal h2 { font-size: 18px; margin: 22px 0 6px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 20px; margin: 6px 0; }

/* Nút chọn thời hạn mua gói: 5 nút, tự xuống hàng trên màn hình hẹp */
.term-seg { display: flex; flex-wrap: wrap; }
.term-seg button { flex: 1 1 auto; }
.term-seg small { font-weight: 700; color: var(--green); }
.term-seg .on small { color: inherit; }

/* ---- Khung trượt đầu trang chủ ---- */
.hero-slider { display: grid; position: relative; margin-bottom: 18px; }
.hero-slider > .hero { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
.hero-slider > .hero.on { opacity: 1; visibility: visible; }
.hero-share { background: linear-gradient(120deg, #FFF3D6, #E9F7EF); }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; }
.hero-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(32, 42, 56, .22); cursor: pointer; }
.hero-dots button.on { width: 24px; border-radius: 99px; background: var(--gold-deep); }
.share-steps { padding-left: 22px; margin: 8px 0 0; }
.share-steps li { margin-bottom: 8px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .hero-slider > .hero { transition: none; } }
/* Thông báo trong chuông là nút bấm: bấm vào mới tính là đã đọc */
.bell-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bell-title .link { font-size: 13px; }
button.bell-item { display: block; width: 100%; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.bell-item.unread { box-shadow: inset 3px 0 0 var(--gold-deep); }
button.bell-item:hover { filter: brightness(.97); }

/* Ô giới thiệu chương trình tặng Pro ở trang Tài khoản */
.share-promo { margin-top: 16px; margin-bottom: 16px; text-align: center; background: linear-gradient(120deg, #FFF8E8, #EEF8F1); border: 1px solid #F1D9A0; }
.share-promo h2 { font-size: 17px; margin: 0 0 6px; }
.share-promo p { margin: 0 0 14px; font-size: 14.5px; }

/* Ô lời nói chỉ đọc (Mini Test): thấy chữ chạy nhưng không sửa tay được */
.transcript[readonly] { background: var(--row); cursor: default; }

/* ---- Màn hình chờ chấm Mini Test ---- */
.wait-screen { padding: 36px 22px; }
.wait-screen h2 { margin: 16px 0 6px; }
.wait-screen .progress { max-width: 420px; margin: 16px auto; }
.wait-line { color: var(--gray); min-height: 1.6em; margin: 0; }
.wait-spinner { width: 58px; height: 58px; margin: 0 auto; border-radius: 50%; border: 6px solid var(--gold-soft); border-top-color: var(--gold-deep); animation: wait-spin 1s linear infinite; }
@keyframes wait-spin { to { transform: rotate(360deg); } }
.hero-roadmap { background: linear-gradient(120deg, #EAF2FF, #FFF3D6); }
/* Đồng hồ đếm ngược của phần Viết / Nói trong Mini Test */
.test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.test-head h2 { margin: 0; }
.test-clock { font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.test-clock.low { background: var(--red-soft); color: var(--red); }

/* ---- Thách đấu + Mời bạn ---- */
.hero-duel { background: linear-gradient(120deg, #FFE9BF, #F3E8FF); }
.duel-board tr.me td { background: var(--gold-soft); font-weight: 700; }
.duel-board td:first-child { width: 44px; text-align: center; }
a.day-item { text-decoration: none; color: inherit; }
.ref-link { display: block; padding: 10px 12px; margin: 0 0 12px; border-radius: 10px; background: #fff; border: 1px dashed #E0C47A; font-size: 13.5px; word-break: break-all; }
.wrong-pick { display: block; color: var(--red); font-weight: 600; font-size: 14.5px; }

/* Thách đấu: các dạng câu hỏi */
.duel-label { color: var(--gray); font-weight: 600; margin: 4px 0 6px; }
.duel-ipa { font-family: var(--ipa-font); font-size: clamp(22px, 5vw, 30px); text-align: center; margin: 6px 0 14px; color: var(--indigo); }
.ipa-opts .opt { font-family: var(--ipa-font); }
.prize-line { margin: 8px 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); color: #5A3A00; }

/* Ô nhập mã khuyến mãi */
.promo-card h2 { margin-bottom: 10px; }
.promo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.promo-row input { flex: 1; min-width: 180px; letter-spacing: .06em; font-weight: 700; }
.promo-card .notice { margin-top: 12px; }
.plan-price del { color: var(--muted); font-size: .7em; font-weight: 500; }

/* ---- Đăng nhập / tạo tài khoản bằng tên đăng nhập ---- */
.auth-tabs { display: flex; margin: 12px 0 14px; }
.auth-tabs button { flex: 1; }
.auth-form { text-align: left; }
.auth-form .field { display: block; margin: 0 0 10px; }
.auth-form .field > span { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.auth-form .field small { display: block; margin-top: 3px; font-size: 13px; }
.auth-form input, .auth-form select { width: 100%; }
.auth-form .btn-row { align-items: center; margin-top: 12px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Bài chưa mở khoá trong danh sách */
button.lesson-card { font: inherit; text-align: left; cursor: pointer; }
.lesson-card.locked { opacity: .55; background: var(--row); }
.lesson-card.locked .lesson-no { background: none; }
.unlock-note { background: var(--gold-soft); }

.next-step { margin-top: 16px; }
.next-step .btn { margin: 6px 0 10px; }

/* Mini Test: câu điền từ, True/False/Not Given, biểu đồ Task 1, thẻ đề Nói */
.quiz input.gap-input { display: inline-block; width: 150px; min-width: 0; max-width: 60%; margin: 0 6px; padding: 5px 10px; border: 2px solid var(--line); border-radius: 8px; font: inherit; font-weight: 600; }
.gap-input:focus { outline: none; border-color: var(--gold); }
.gap-input.right { border-color: var(--green); background: var(--green-soft); }
.gap-input.wrong { border-color: var(--red); background: var(--red-soft); }
.gap-answer { margin: 6px 0 0; font-size: 14.5px; color: var(--green); }
.quiz-opts.tfng { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quiz-opts.tfng .opt { justify-content: center; text-align: center; font-weight: 700; font-size: 14px; }
.passage h3 { margin: 0 0 .8em; }
.table-scroll { overflow-x: auto; }
.task-chart { background: var(--row); border-radius: 12px; padding: 14px; margin: 12px 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; font-size: 13.5px; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 22px; margin: 10px 0 14px; border-bottom: 2px solid var(--line); }
.chart-group { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.chart-cols { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart-cols i { position: relative; flex: 1; max-width: 28px; border-radius: 4px 4px 0 0; }
.chart-cols em { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--gray); }
.chart-group small { padding: 4px 0; font-size: 12.5px; color: var(--gray); overflow: hidden; text-overflow: ellipsis; }
.task-chart .c0 { background: var(--gold); } .task-chart .c1 { background: var(--teal); }
.task-chart .c2 { background: var(--coral); } .task-chart .c3 { background: var(--gray); }
.cue-card { background: var(--gold-soft); border-radius: 12px; padding: 10px 16px; margin: 10px 0; }
.cue-card p { margin: 0 0 4px; font-weight: 600; } .cue-card ul { margin: 0; padding-left: 20px; }
.overall-band { font-size: 18px; margin: 10px 0 0; } .overall-band b { font-size: 30px; color: var(--gold-deep); }

/* Thách đấu: danh sách bảng có nút xoá */
.duel-row { display: flex; align-items: center; gap: 8px; }
.duel-row .day-item { flex: 1; min-width: 0; }
.duel-row > .btn { flex: none; }
.pending-box { display: grid; gap: 10px; justify-items: start; margin: 4px 0 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* Mini Test: bảng hướng dẫn trước mỗi phần */
.head-tools { display: inline-flex; align-items: center; gap: 8px; }
.guide-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(20, 22, 35, .55); backdrop-filter: blur(4px); animation: guide-fade .2s ease-out; }
.guide-modal { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card, #fff); border-radius: 20px;
  padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); animation: guide-rise .25s ease-out; }
.guide-top { display: flex; align-items: center; gap: 14px; }
.guide-top h2 { margin: 2px 0 0; } .guide-top small { color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.guide-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; background: var(--gold-soft); font-size: 28px; }
.guide-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.guide-facts span { padding: 6px 12px; border-radius: 999px; background: var(--row); font-size: 14px; font-weight: 600; }
.guide-facts span:first-child { background: var(--gold); color: #2A1E00; }
.guide-clock { margin: 10px 0 4px; font-size: 14px; color: var(--green); font-weight: 600; }
.guide-tips { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: tip; display: grid; gap: 10px; }
.guide-tips li { counter-increment: tip; position: relative; padding: 10px 12px 10px 46px; border-radius: 12px; background: var(--row); }
.guide-tips li::before { content: counter(tip); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.guide-tips b { display: block; margin-bottom: 2px; } .guide-tips span { font-size: 14.5px; color: var(--gray); }
.guide-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.guide-foot .check { font-size: 14px; color: var(--gray); display: inline-flex; align-items: center; gap: 8px; }
.guide-wait { font-size: 46px; margin: 4px 0 0; }
@keyframes guide-fade { from { opacity: 0; } } @keyframes guide-rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Ngữ pháp ---------- */
.review-card { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.review-card p { margin: 4px 0 0; }
.review-card.due { border: 2px solid var(--gold); background: #FFF8E8; }
.gr-section p.pre { margin-bottom: 12px; }
.gr-formulas { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.gr-formulas code {
  display: block; background: #EEF0FF; color: #2E3192; border-radius: 10px; padding: 8px 12px;
  font: 600 15px/1.5 var(--ipa-font); white-space: pre-wrap; overflow-wrap: anywhere;
}
.gr-examples { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gr-examples li { display: flex; gap: 10px; align-items: flex-start; background: var(--row); border-radius: 12px; padding: 8px 10px; }
.gr-examples li > span { display: flex; flex-direction: column; min-width: 0; }
.gr-examples b { font-weight: 600; }
.gr-examples small { color: var(--gray); font-size: 14px; }
.gr-speak { width: 34px; height: 34px; font-size: 16px; }
.gr-tips { margin: 0; padding-left: 20px; }
.gr-tips li { margin-bottom: 6px; }
.gr-prompt { font-size: 19px; line-height: 2; margin: 10px 0 14px; }
.gr-blank { display: inline-block; width: min(220px, 60vw); padding: 4px 10px; margin: 0 4px; vertical-align: baseline; }
input.right { border-color: var(--green); background: var(--green-soft); }
input.wrong { border-color: var(--red); background: var(--red-soft); }
.gr-parts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; font-size: 18px; }
.gr-part { border: 1.5px dashed var(--muted); background: #fff; border-radius: 10px; padding: 6px 12px; }
.gr-part:hover:not(:disabled) { border-color: var(--gold); border-style: solid; }
.gr-part:disabled { cursor: default; }
.gr-part.wrong { border: 2px solid var(--red); background: var(--red-soft); }
.gr-part.picked-miss { border: 2px solid var(--gold); background: var(--gold-soft); }
.gr-rewrite { display: flex; gap: 10px; align-items: center; font-size: 18px; flex-wrap: wrap; }
.gr-rewrite input { flex: 1; min-width: 200px; }
.gr-peek summary { cursor: pointer; font-weight: 600; }
.gr-peek .card { box-shadow: none; padding: 12px 0; margin: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }

/* ---------- Đề thi IELTS ---------- */
.ex-target { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.ex-target small { flex-basis: 100%; }
.ex-tabs { grid-template-columns: repeat(3, 1fr); }
.ex-list { display: grid; gap: 14px; }
.ex-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.ex-card-head { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: baseline; }
.ex-card-head b { font-size: 18px; }
.ex-done { color: var(--green); font-weight: 600; font-size: 14.5px; }
.ex-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; width: 100%; }
.ex-part { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; }
.ex-part:hover { border-color: var(--gold); }
.ex-part small { color: var(--gray); font-size: 12.5px; font-weight: 600; }
.ex-part span { font-weight: 600; font-size: 14.5px; }
.ex-part.done { border-color: var(--green); background: var(--green-soft); }
.ex-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ex-bar {
  position: sticky; top: var(--topbar-h, 57px); z-index: 6; display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap;
  background: rgba(251, 246, 238, .95); backdrop-filter: blur(6px); padding: 8px 0 10px; margin-bottom: 8px;
}
.ex-bar .btn-primary { margin-left: auto; }
.ex-timer { font-weight: 800; font-variant-numeric: tabular-nums; background: var(--gold-soft); border-radius: 999px; padding: 4px 12px; }
.ex-timer.late { background: var(--red-soft); color: var(--red); }
.ex-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ex-left { position: sticky; top: calc(var(--topbar-h, 57px) + 60px); max-height: calc(100vh - var(--topbar-h, 57px) - 80px); overflow: auto; }
.ex-mobile-seg { display: none; margin-bottom: 10px; }
.ex-passage { font-size: 16.5px; line-height: 1.8; }
.ex-text + .ex-text { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.ex-text h3 { font-size: 17px; margin-bottom: 8px; }
.ex-text p { margin: 0 0 .8em; }
.ex-para { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--indigo); color: #fff; font-size: 13px; margin-right: 4px; }
.ex-instr { font-size: 14px; color: var(--gray); margin: 0 0 10px; font-style: italic; }
.ex-title { font-size: 16px; text-align: center; margin: 4px 0 10px; }
.ex-options { background: var(--row); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14.5px; display: grid; gap: 4px; }
.ex-options b { display: inline-block; min-width: 28px; color: var(--indigo); }
.ex-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.ex-item:first-of-type { border-top: 0; }
.ex-no { width: 30px; height: 30px; border-radius: 8px; background: var(--gold-soft); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.ex-q { line-height: 1.9; }
.ex-q p { margin: 0 0 6px; }
.ex-q select { padding: 6px 10px; }
.ex-blank { display: inline-block; width: min(190px, 55vw); padding: 3px 8px; margin: 0 3px; }
.ex-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-chips .chip.on { background: var(--gold); border-color: var(--gold); }
.ex-chips .chip.right { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.ex-mcq { display: grid; gap: 6px; }
.ex-mcq .opt { padding: 8px 12px; }
.ex-fb { grid-column: 2; font-size: 14px; background: var(--row); border-radius: 10px; padding: 8px 10px; }
.ex-fb.ok b { color: var(--green); }
.ex-fb.no b { color: var(--red); }
.ex-result .score { margin: 4px 0; }
.ex-script p { margin: 0 0 8px; }
@media (max-width: 860px) {
  .ex-layout { grid-template-columns: 1fr; }
  .ex-left { position: static; max-height: none; }
  .ex-mobile-seg { display: inline-flex; }
  .ex-layout.show-passage .ex-right, .ex-layout.show-questions .ex-left { display: none; }
  .ex-tabs { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Lộ trình: mục tiêu IELTS ---------- */
.goal-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; margin-top: 12px; }
.goal-details select, .goal-details input[type=date] { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; }
.goal-card { display: flex; flex-direction: column; gap: 12px; }
.goal-head { display: flex; gap: 10px 28px; align-items: flex-end; flex-wrap: wrap; }
.goal-head div { display: flex; flex-direction: column; }
.goal-head small { color: var(--gray); font-size: 13px; }
.goal-head b { font-size: 19px; }
.goal-head .link { margin-left: auto; }
.gap-rows { display: grid; gap: 8px; }
.gap-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 120px; gap: 10px; align-items: center; font-size: 14.5px; }
.gap-bar { position: relative; height: 10px; border-radius: 99px; background: var(--line); }
.gap-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
.gap-bar em { position: absolute; top: -4px; width: 3px; height: 18px; border-radius: 2px; background: var(--indigo); transform: translateX(-1px); }
.gap-ok { color: var(--green); font-weight: 700; }
.gap-no { color: var(--coral); font-weight: 600; }
.goal-switch { border: 2px solid var(--gold); background: #FFF8E8; }

/* Danh sách tổng số bài từng mục trên dải "bài mới mỗi ngày" ở trang chủ */
.library-list { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.library-list span { background: rgba(255, 255, 255, .75); border-radius: 999px; padding: 3px 10px; font-size: 13.5px; }
.library-list b { color: #B4530A; }
