/* ===== Luyện Speaking – IELTS with Henry ===== */
:root { --nv: #14285a; --rd: #c8102e; --lv0: #eceff5; --lv1: #d9f99d; --lv2: #facc15; --lv3: #dc2626; --lv4: #7f1d1d; }
.sx-load { padding: 40px 0; color: var(--ink-soft); }
.sx-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 14px rgba(20,40,90,.05); }
.sx-tabs a { flex: 1; min-width: 130px; text-align: center; padding: 10px 12px; border-radius: 12px; font-weight: 800; color: #5a6580; text-decoration: none; }
.sx-tabs a:hover { background: #f4f6fb; color: var(--nv); }
.sx-tabs a.on { background: var(--nv); color: #fff; }
.sx-warn { background: #fff8e6; border: 1px solid #f3d38b; color: #6b4a00; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }
.sx-head h1 { margin: 0 0 6px; color: var(--nv); }
.sx-head p { margin: 0 0 14px; color: #3c4763; line-height: 1.6; max-width: 900px; }
.sx-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin: 0 0 16px; box-shadow: 0 6px 18px rgba(20,40,90,.05); }
.sx-card h2 { font-size: 1.15rem; color: var(--nv); margin: 0 0 12px; }

/* hero */
.sx-hero { display: grid; grid-template-columns: 1fr 260px; gap: 0; border-radius: 22px; overflow: hidden; margin: 0 0 16px; box-shadow: 0 14px 34px rgba(20,40,90,.16); }
.sx-hero-l { background: linear-gradient(125deg, #14285a 0%, #22408a 55%, #8a1430 125%); color: #fff; padding: 26px 28px; }
.sx-hero-l .tag { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 99px; padding: 4px 12px; font-size: .8rem; }
.sx-hero-l h1 { margin: 12px 0 8px; font-size: 1.9rem; }
.sx-hero-l p { margin: 0 0 16px; opacity: .92; line-height: 1.6; max-width: 640px; }
.sx-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn.sx-big { background: linear-gradient(135deg, #e5203f, #b00c28); color: #fff; border: 0; font-weight: 800; padding: 12px 22px; font-size: 1.02rem; border-radius: 14px; box-shadow: 0 6px 16px rgba(200,16,46,.35); }
.btn.sx-big:hover { filter: brightness(1.06); }
.btn.sx-ol { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); border-radius: 14px; font-weight: 800; }
.btn.sx-ol:hover { background: rgba(255,255,255,.1); }
.btn.sx-ol2 { background: #fff; color: var(--nv); border: 0; border-radius: 14px; font-weight: 800; }
.sx-hero-r { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; gap: 6px; }
.sx-hero-r small { color: var(--ink-soft); font-size: .8rem; }
.sx-ring { width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; font: 800 2.6rem/1 Montserrat, "Be Vietnam Pro", sans-serif; color: #fff; background: radial-gradient(circle at 30% 25%, #ff5a72, #c8102e 60%, #8a0c22); box-shadow: 0 10px 24px rgba(200,16,46,.3), inset 0 -6px 0 rgba(0,0,0,.12); flex: none; }
.sx-ring.na { background: #c9cfdf; box-shadow: none; }
@media (max-width: 760px) { .sx-hero { grid-template-columns: 1fr; } .sx-hero-l h1 { font-size: 1.5rem; } }

/* độ chăm chỉ */
.sx-act { display: grid; grid-template-columns: 1fr 280px; gap: 18px; }
@media (max-width: 860px) { .sx-act { grid-template-columns: 1fr; } }
.sx-act-r { display: flex; flex-direction: column; gap: 10px; }
.sx-today { border-radius: 16px; padding: 14px; text-align: center; color: #14213d; background: var(--lv0); }
.sx-today b { display: block; font: 800 2.4rem/1 Montserrat, sans-serif; }
.sx-today.lv1 { background: var(--lv1); } .sx-today.lv2 { background: var(--lv2); }
.sx-today.lv3 { background: var(--lv3); color: #fff; } .sx-today.lv4 { background: var(--lv4); color: #fff; }
.sx-praise { margin: 0; font-weight: 700; color: #7f1d1d; background: #fff4f4; border: 1px solid #f6caca; border-radius: 12px; padding: 10px 12px; line-height: 1.5; }
.sx-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sx-mini div { background: #f5f7fc; border-radius: 12px; padding: 8px; text-align: center; }
.sx-mini b { display: block; font-size: 1.3rem; color: var(--nv); }
.sx-mini span { font-size: .72rem; color: var(--ink-soft); }
.hm-box { overflow-x: auto; }
.hm-tabs { display: inline-flex; gap: 4px; background: #f1f3fa; border-radius: 10px; padding: 4px; margin-bottom: 10px; }
.hm-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font: inherit; font-weight: 700; color: #5a6580; cursor: pointer; }
.hm-tabs button.on { background: #fff; color: var(--nv); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.hm { display: inline-block; }
.hm-mo { display: flex; gap: 3px; margin-left: 28px; font-size: .7rem; color: var(--ink-soft); }
.hm-mo span { width: 14px; white-space: nowrap; overflow: visible; }
.hm-g { display: flex; gap: 3px; }
.hm-wd { display: flex; flex-direction: column; gap: 3px; width: 25px; font-size: .66rem; color: var(--ink-soft); }
.hm-wd span { height: 14px; line-height: 14px; }
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-col i { width: 14px; height: 14px; border-radius: 4px; display: block; }
.hm-col i.fut { background: transparent; }
.hm-leg { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .74rem; color: var(--ink-soft); margin-top: 8px; }
.hm-leg i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.hm-leg small { margin-left: 6px; }
.hm-bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 16px; min-width: 100%; }
.hm-bars .hb { flex: 1; min-width: 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.hm-bars .hb i { width: 100%; border-radius: 5px 5px 2px 2px; display: block; }
.hm-bars .hb b { font-size: .68rem; color: #3c4763; }
.hm-bars .hb span { font-size: .62rem; color: var(--ink-soft); white-space: nowrap; }

/* band */
.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.sx-chips i { font-style: normal; font-weight: 700; font-size: .8rem; border-radius: 99px; padding: 3px 10px; }
.cg { background: #d1fae5; color: #065f46; } .cb { background: #dbeafe; color: #1e3a8a; } .cy { background: #fef3c7; color: #92400e; } .cr { background: #fee2e2; color: #991b1b; } .cn { background: #eef0f5; color: #6b7280; }
.sx-dot { flex: none; display: inline-grid; place-items: center; min-width: 44px; height: 44px; border-radius: 50%; font-weight: 800; font-size: 1rem; }
.sx-dot.big { min-width: 62px; height: 62px; font-size: 1.35rem; }
.sx-dot.cg { background: #10b981; color: #fff; } .sx-dot.cb { background: #2563eb; color: #fff; } .sx-dot.cy { background: #f59e0b; color: #fff; } .sx-dot.cr { background: #dc2626; color: #fff; } .sx-dot.cn { background: #c9cfdf; color: #fff; }
.sx-hist { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.sx-hist:hover { border-color: #c8102e55; background: #fffafa; }
.sx-hist > div { flex: 1; min-width: 0; }
.sx-hist b { color: var(--nv); display: block; }
.sx-hist b.q { font-weight: 600; color: #14213d; }
.sx-hist small { color: var(--ink-soft); }

/* danh mục luyện tập */
.sp-tabs { display: flex; gap: 6px; background: #eef1f8; border-radius: 14px; padding: 5px; margin: 0 0 12px; flex-wrap: wrap; }
.sp-tabs button { flex: 1; min-width: 200px; border: 0; background: none; border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 700; color: #5a6580; cursor: pointer; }
.sp-tabs button.on { background: #fff; color: var(--nv); box-shadow: 0 2px 8px rgba(20,40,90,.1); }
.sp-search { margin: 0 0 6px; }
.sp-g { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rd); margin: 18px 0 8px; }
.sp-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 900px) { .sp-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sp-list { grid-template-columns: 1fr; } }
.sp-item { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 3px; transition: transform .12s, border-color .12s, box-shadow .12s; }
.sp-item:hover { border-color: var(--rd); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(200,16,46,.1); }
.sp-item[hidden] { display: none; }
.sp-item b { font-size: .95rem; line-height: 1.35; }
.sp-item b em { font-style: normal; color: var(--rd); }
.sp-item span { font-size: .78rem; color: var(--ink-soft); }
.sp-item .ok { color: #177a46; font-style: normal; font-weight: 700; }

/* phòng thi / luyện tập */
.sx-run { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.sx-run.test, .sx-run#sx-sum { grid-template-columns: 1fr; }
@media (max-width: 920px) { .sx-run { grid-template-columns: 1fr; } }
.sx-runhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sx-runhead .eyebrow { font-weight: 800; color: var(--nv); }
.sx-part { margin-left: auto; background: var(--nv); color: #fff; border-radius: 99px; padding: 4px 12px; font-weight: 800; font-size: .85rem; }
.sx-part:empty { display: none; }
.sx-exam { display: flex; gap: 16px; align-items: flex-start; background: linear-gradient(135deg, #f4f7ff, #fff); border: 1.5px solid #d6def3; border-radius: 20px; padding: 18px; }
.sx-avatar { flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; background: #fff; border: 3px solid #d6def3; transition: border-color .2s, box-shadow .2s; }
.sx-avatar.talk { border-color: #2563eb; animation: sxTalk 1s ease-in-out infinite; }
.sx-avatar.listen { border-color: #10b981; box-shadow: 0 0 0 6px rgba(16,185,129,.18); animation: sxListen 1.4s ease-in-out infinite; }
@keyframes sxTalk { 50% { box-shadow: 0 0 0 8px rgba(37,99,235,.15); } }
@keyframes sxListen { 50% { box-shadow: 0 0 0 12px rgba(16,185,129,.08); } }
@media (prefers-reduced-motion: reduce) { .sx-avatar.talk, .sx-avatar.listen { animation: none; } }
.sx-bubble { flex: 1; min-width: 0; }
.sx-state { font-weight: 800; color: var(--nv); margin-bottom: 6px; }
.sx-state small { font-weight: 500; color: var(--ink-soft); }
.sx-q { font-size: 1.25rem; font-weight: 700; color: #14213d; line-height: 1.45; min-height: 1.4em; }
.sp-cue { background: #fff; border: 2px solid var(--nv); border-radius: 14px; padding: 12px 14px; margin: 8px 0; line-height: 1.6; }
.sp-cue b { display: block; font-size: 1.05rem; color: var(--nv); margin-bottom: 4px; }
.sp-cue ul { margin: 2px 0 4px; padding-left: 22px; }
.sp-notes { width: 100%; box-sizing: border-box; margin-top: 8px; border: 1.5px dashed #c9d3ef; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .9rem; background: #fbfcff; resize: vertical; }
#sx-timer:empty { display: none; }
#sx-timer { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx-cd b { font: 800 1.3rem Montserrat, sans-serif; color: var(--rd); font-variant-numeric: tabular-nums; }
.sx-live { margin: 12px 0; min-height: 70px; background: #fff; border: 1.5px solid #e2e6f0; border-radius: 16px; padding: 12px 14px; font-size: 1.05rem; line-height: 1.6; color: #14213d; }
.sx-type { width: 100%; box-sizing: border-box; border: 1.5px solid #d7dcec; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 1rem; }
.sx-row { display: flex; gap: 8px; margin-top: 8px; }
.sx-ctrl { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.sx-opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; color: #3c4763; margin: 6px 0; }
.sx-opt select { font: inherit; font-size: .85rem; padding: 4px 6px; border-radius: 8px; border: 1px solid #d7dcec; max-width: 260px; }
.sx-vnote { display: block; margin-top: 2px; }
.sx-prog2 { height: 6px; background: #eef0f5; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.sx-prog2 i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22408a, #c8102e); transition: width .4s; }
.sx-side { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.sx-side h3 { margin: 0 0 8px; color: var(--nv); font-size: 1rem; }
.sx-side h3 small { font-weight: 500; color: var(--ink-soft); }
.sx-side ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sx-side li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; font-size: .84rem; cursor: pointer; border: 1px solid transparent; }
.sx-side li:hover { background: #f5f7fc; }
.sx-side li.cur { border-color: var(--nv); background: #f2f5ff; }
.sx-side li em { font-style: normal; font-weight: 800; font-size: .7rem; color: var(--rd); flex: none; }
.sx-side li span:not(.sx-dot):not(.sx-spin) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-side li .sx-dot { min-width: 34px; height: 34px; font-size: .82rem; }
.sx-side li.skip span { color: #9aa3b8; }
.sx-avg { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; color: var(--nv); }
.sx-avg:empty { display: none; }
.sx-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #d6def3; border-top-color: var(--rd); animation: sxSpin .8s linear infinite; display: inline-block; vertical-align: middle; flex: none; }
@keyframes sxSpin { to { transform: rotate(360deg); } }

/* kết quả */
.sx-score { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 12px; }
.sx-score > div:last-child { flex: 1; min-width: 240px; }
.sx-score h2 { margin: 0 0 4px; color: var(--nv); }
.sx-score p { margin: 0 0 6px; line-height: 1.6; }
.sp-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 6px 18px rgba(20,40,90,.05); }
.sp-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.sp-n { font-weight: 800; color: var(--rd); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.sp-q { font-weight: 600; font-size: 1.02rem; margin: 6px 0 6px; color: #14213d; }
.sx-crit { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.sx-crit li { margin: 2px 0; }
.sx-ph { color: var(--nv); margin: 18px 0 8px; }
.sp-play { padding: 2px 8px; margin-left: 6px; font-size: .78rem; }
.sp-crit { padding-right: 60px; }
.sp-cb { position: absolute; right: 12px; top: 10px; background: var(--nv); color: #fff; border-radius: 10px; min-width: 38px; text-align: center; padding: 5px 6px; font-size: 1.25rem; font-weight: 800; }
.sp-cb.na { background: #c9cfdf; }
.sp-note { font-size: .82rem; color: var(--ink-soft); margin: 4px 0 14px; line-height: 1.55; }
.sx-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,51,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sx-mbox { background: #f6f8fc; border-radius: 18px; max-width: 760px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 18px; position: relative; }
.sx-x { position: absolute; right: 10px; top: 6px; border: 0; background: none; font-size: 28px; cursor: pointer; color: #5a6580; }

/* thi thử */
.sx-tests { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .sx-tests { grid-template-columns: 1fr; } }
.sx-test { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; text-decoration: none; background: #fff; border: 2px solid #d6def3; color: #14213d; transition: transform .12s; }
.sx-test:hover { transform: translateY(-2px); border-color: var(--nv); }
.sx-test b { font: 800 1.2rem Montserrat, sans-serif; color: var(--nv); }
.sx-test.big { background: linear-gradient(130deg, #14285a, #2a4a9a 60%, #a3122f 140%); color: #fff; border: 0; }
.sx-test.big b { color: #fff; font-size: 1.5rem; }
.sx-test small { opacity: .75; }
.sx-tips { margin: 0; padding-left: 20px; line-height: 1.8; }

/* lớp nói */
.sx-join { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx-join .input { flex: 1; min-width: 200px; text-transform: uppercase; }
.sx-ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sx-asg { display: grid; grid-template-columns: 1fr 140px auto auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; text-decoration: none; color: inherit; }
.sx-asg:hover { border-color: var(--nv); }
.sx-asg b { display: block; color: var(--nv); }
.sx-asg small { color: var(--ink-soft); }
.sx-asg > span:not(.btn) { font-size: .85rem; font-weight: 700; color: #3c4763; white-space: nowrap; }
@media (max-width: 640px) { .sx-asg { grid-template-columns: 1fr auto; } .sx-prog { grid-column: 1 / -1; } }
.sx-prog { height: 8px; background: #eef0f5; border-radius: 99px; overflow: hidden; }
.sx-prog i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #22408a); }
.sx-board { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sx-board th { text-align: left; color: var(--ink-soft); font-weight: 700; padding: 6px; border-bottom: 1px solid var(--line); }
.sx-board td { padding: 8px 6px; border-bottom: 1px solid #f0f2f7; }
.sx-board tr.me td { background: #fff7f8; font-weight: 700; }
.sx-lv { display: inline-block; min-width: 30px; text-align: center; border-radius: 8px; padding: 2px 8px; font-weight: 800; background: var(--lv0); }
.sx-lv.lv1 { background: var(--lv1); } .sx-lv.lv2 { background: var(--lv2); } .sx-lv.lv3 { background: var(--lv3); color: #fff; } .sx-lv.lv4 { background: var(--lv4); color: #fff; }
/* sửa lỗi hiển thị */
.sx-hero-l h1 { color: #fff; }
.sx-hero { grid-template-columns: minmax(0, 1fr) 260px; }
.sx-act { grid-template-columns: minmax(0, 1fr) 280px; }
.sx-run { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 860px) { .sx-act { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .sx-hero { grid-template-columns: minmax(0, 1fr); } .sx-hero-l { padding: 20px 18px; } }
@media (max-width: 920px) { .sx-run { grid-template-columns: minmax(0, 1fr); } .sx-side { position: static; max-height: none; } }
.sx-hero-l, .sx-act > *, .sx-main, .sx-side { min-width: 0; }
.sx-side li { align-items: flex-start; }
.sx-side li > span:nth-child(2) { flex: 1; min-width: 0; white-space: normal !important; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: left; line-height: 1.35; }
.sx-side li em { padding-top: 2px; }
