:root {
  --purple: #7c5cd6; --purple-d: #5b3fb0; --purple-l: #ece6ff;
  --blue: #4aa3df; --blue-l: #e3f2fc;
  --yellow: #ffd45e; --yellow-l: #fff6d6;
  --green: #3fae7a; --green-l: #e0f5ea;
  --red: #e0566b; --red-l: #fde6ea;
  --amber: #e7a21a; --amber-l: #fff0cc;
  --ink: #2a2350; --muted: #6b6690; --card: #ffffff; --bg: #f6f3ff;
  --radius: 20px; --shadow: 0 6px 20px rgba(91, 63, 176, .12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 19px; -webkit-text-size-adjust: 100%; }
html { background: linear-gradient(180deg, var(--purple-l) 0%, var(--blue-l) 55%, var(--yellow-l) 100%); min-height: 100%; }
body { margin: 0; font-family: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink);
  background: transparent; min-height: 100vh; line-height: 1.5; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem; background: #fff; box-shadow: 0 2px 10px rgba(91,63,176,.1); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 2rem; background: var(--yellow); border-radius: 14px; padding: .1rem .45rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.15rem; color: var(--purple-d); }
.brand-text small { color: var(--muted); font-size: .8rem; }
.session-bar { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }
.banner { margin: .6rem auto 0; max-width: 960px; padding: .6rem 1rem; border-radius: 14px; background: var(--amber-l); color: #7a5200; font-weight: 700; }
.banner.err { background: var(--red-l); color: #8a1f33; }
main { max-width: 960px; margin: 0 auto; padding: 1rem 1rem 3rem; outline: none; }
.footer { max-width: 960px; margin: 0 auto; padding: 0 1rem 2rem; color: var(--muted); text-align: center; }
h1 { font-size: 1.6rem; margin: .4rem 0 .2rem; color: var(--purple-d); }
h2 { font-size: 1.3rem; margin: 0 0 .6rem; color: var(--purple-d); }
h3 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 1rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 0 0 1rem; }
.card.soft { background: var(--yellow-l); box-shadow: none; }
.card.blue { background: var(--blue-l); box-shadow: none; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.unit-card { text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; border-top: 8px solid var(--purple); transition: transform .12s; }
.unit-card:hover, .unit-card:focus-visible { transform: translateY(-3px); outline: 3px solid var(--yellow); }
.unit-card:nth-child(2) { border-top-color: var(--blue); } .unit-card:nth-child(3) { border-top-color: var(--yellow); }
.unit-card:nth-child(4) { border-top-color: var(--green); } .unit-card:nth-child(5) { border-top-color: #f08bb0; }
.unit-num { display: inline-block; background: var(--purple-l); color: var(--purple-d); border-radius: 999px; padding: .1rem .7rem; font-weight: 800; font-size: .85rem; }
.unit-vi { font-size: 1.25rem; font-weight: 800; margin: .5rem 0 .1rem; }
.unit-en { color: var(--muted); font-size: 1rem; }
.dots { display: flex; gap: .3rem; margin-top: .6rem; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: #ddd8f3; } .dot.on { background: var(--green); }
.badge-done { margin-top: .5rem; display: inline-block; background: var(--green-l); color: #176e49; border-radius: 999px; padding: .1rem .7rem; font-size: .8rem; font-weight: 800; }
.unit-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.unit-nav { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.stepper { display: flex; gap: .4rem; overflow-x: auto; padding: .2rem 0 .6rem; }
.step-tab { flex: 1 0 auto; min-width: 8.2rem; border: 2px solid transparent; background: #fff; border-radius: 16px; padding: .5rem .7rem; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; box-shadow: 0 2px 8px rgba(91,63,176,.08); text-align: center; }
.step-tab .n { display: inline-block; width: 1.5rem; height: 1.5rem; line-height: 1.5rem; border-radius: 50%; background: var(--purple-l); color: var(--purple-d); margin-right: .3rem; }
.step-tab.active { border-color: var(--purple); color: var(--purple-d); background: var(--purple-l); }
.step-tab.done .n { background: var(--green); color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 3rem; padding: .55rem 1.1rem; border: 0; border-radius: 16px; font: inherit; font-weight: 800; cursor: pointer; background: var(--purple); color: #fff; box-shadow: 0 3px 0 var(--purple-d); transition: transform .08s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--purple-d); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.alt { background: var(--blue); box-shadow: 0 3px 0 #2f7fb4; }
.btn.warm { background: var(--yellow); color: #5a4300; box-shadow: 0 3px 0 #d1a62f; }
.btn.good { background: var(--green); box-shadow: 0 3px 0 #2c8860; }
.btn.danger { background: var(--red); box-shadow: 0 3px 0 #b03c4f; }
.btn.ghost { background: #fff; color: var(--purple-d); box-shadow: none; border: 2px solid var(--purple-l); }
.btn.small { min-height: 2.4rem; padding: .3rem .8rem; font-size: .9rem; border-radius: 12px; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.seg { display: inline-flex; background: var(--purple-l); border-radius: 14px; padding: .2rem; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 800; padding: .35rem .9rem; border-radius: 11px; color: var(--purple-d); cursor: pointer; min-height: 2.4rem; }
.seg button.on { background: var(--purple); color: #fff; }
.big-topic { font-size: 1.7rem; font-weight: 800; color: var(--purple-d); margin: .3rem 0; }
.question-box { font-size: 1.5rem; font-weight: 800; background: var(--yellow-l); border-radius: 16px; padding: .8rem 1rem; margin: .6rem 0; }
.hidden-q { color: var(--muted); font-size: 1.05rem; background: #f0edfa; border-radius: 16px; padding: .8rem 1rem; margin: .6rem 0; }
.model-line { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .2rem; border-bottom: 1px dashed #e4defa; }
.model-line:last-child { border-bottom: 0; }
.chip { flex: 0 0 auto; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: .15rem .65rem; background: var(--blue-l); color: #1d6a9c; white-space: nowrap; margin-top: .25rem; }
.chip.y { background: var(--yellow); color: #5a4300; } .chip.p { background: var(--purple-l); color: var(--purple-d); } .chip.g { background: var(--green-l); color: #176e49; }
.sentence { font-size: 1.25rem; font-weight: 700; flex: 1; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.tbl th, table.tbl td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid #ece8fb; }
table.tbl th { color: var(--purple-d); }
ul.notes { margin: .2rem 0; padding-left: 1.2rem; } ul.notes li { margin: .2rem 0; }
.sent-card { border: 2px solid #ece8fb; border-radius: 18px; padding: .8rem 1rem; margin: .7rem 0; background: #fff; }
.sent-card.done { border-color: var(--green); background: #fbfffd; }
.sent-text { font-size: 1.25rem; font-weight: 800; margin: 0 0 .5rem; }
.rec-panel { margin-top: .5rem; }
.rec-status { min-height: 1.6rem; font-weight: 700; color: var(--muted); margin: .4rem 0; }
.rec-status.live { color: var(--red); }
.rec-status.warn { color: #9a6200; }
.rec-status.err { color: #a02338; }
.progress { height: .8rem; border-radius: 999px; background: #e7e2fa; overflow: hidden; margin: .3rem 0 .8rem; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 999px; }
.scores { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.score-pill { background: var(--purple-l); border-radius: 14px; padding: .35rem .8rem; min-width: 6.2rem; text-align: center; }
.score-pill b { display: block; font-size: 1.35rem; color: var(--purple-d); } .score-pill small { color: var(--muted); }
.score-big { font-size: 2.6rem; font-weight: 900; color: var(--purple-d); line-height: 1; } .score-big small { font-size: 1rem; color: var(--muted); }
.words { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
.w { border-radius: 10px; padding: .1rem .5rem; font-weight: 700; } .w.good { background: var(--green-l); } .w.mid { background: var(--amber-l); } .w.bad { background: var(--red-l); }
.tag-sep { border-left: 6px solid var(--purple); padding-left: .8rem; }
.pron-card { border-left: 6px solid var(--blue); background: var(--blue-l); border-radius: 16px; padding: .8rem 1rem; margin: .6rem 0; }
.content-card { border-left: 6px solid var(--yellow); background: var(--yellow-l); border-radius: 16px; padding: .8rem 1rem; margin: .6rem 0; }
.fix { background: #fff; border-radius: 12px; padding: .5rem .8rem; margin: .4rem 0; }
.fix del { color: var(--red); } .fix ins { color: #176e49; text-decoration: none; font-weight: 800; }
textarea, input[type=text], input[type=password] { width: 100%; font: inherit; padding: .65rem .8rem; border: 2px solid #d8d1f5; border-radius: 14px; background: #fff; color: var(--ink); }
textarea { min-height: 6rem; resize: vertical; }
label { display: block; font-weight: 800; margin: .7rem 0 .25rem; }
.hint { color: var(--muted); font-size: .9rem; }
.scaffold { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: .6rem 0; }
.scaf { background: #fff; border: 2px dashed #cdbff3; border-radius: 16px; padding: .5rem .8rem; }
.scaf b { color: var(--purple-d); display: block; font-size: .85rem; } .scaf span { font-size: 1.05rem; font-weight: 700; }
.pick { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.pick button { border: 2px solid #d8d1f5; background: #fff; border-radius: 16px; padding: .5rem .9rem; font: inherit; font-weight: 800; cursor: pointer; text-align: left; min-height: 3rem; }
.pick button.on { border-color: var(--purple); background: var(--purple-l); }
.attempt { display: flex; gap: .7rem; align-items: flex-start; border: 2px solid #ece8fb; border-radius: 16px; padding: .7rem .9rem; margin: .5rem 0; background: #fff; cursor: pointer; }
.attempt.sel { border-color: var(--purple); background: var(--purple-l); }
.attempt input { width: 1.4rem; height: 1.4rem; margin-top: .25rem; accent-color: var(--purple); }
.status-ok { background: var(--green-l); color: #176e49; border-radius: 16px; padding: .8rem 1rem; font-weight: 800; }
.status-err { background: var(--red-l); color: #8a1f33; border-radius: 16px; padding: .8rem 1rem; font-weight: 700; }
.status-info { background: var(--blue-l); color: #1d557a; border-radius: 16px; padding: .6rem 1rem; font-weight: 700; }
.notice { font-size: .88rem; color: var(--muted); background: #faf8ff; border-radius: 12px; padding: .5rem .8rem; margin: .5rem 0; }
.login { max-width: 460px; margin: 1rem auto; }
.spin { display: inline-block; width: 1rem; height: 1rem; border: 3px solid #fff; border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 560px) { html { font-size: 18px; } .btn { flex: 1 1 auto; } .brand-text small { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* máy nghe + điểm cô chấm */
.heard { background: #f3fbf7; box-shadow: none; border: 2px solid var(--green-l); margin-top: .8rem; }
.heard-text { font-size: 1.05rem; font-style: italic; background: #fff; border-radius: 12px; padding: .5rem .8rem; margin: .4rem 0; }
.idea-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.idea { border-radius: 999px; padding: .15rem .7rem; font-size: .85rem; font-weight: 700; background: #eeeaf8; color: var(--muted); }
.idea.ok { background: var(--green-l); color: #176e49; }
.badge-score { margin: .5rem 0 0 .3rem; display: inline-block; background: var(--yellow-l); color: #7a5200; border-radius: 999px; padding: .1rem .7rem; font-size: .8rem; font-weight: 800; }
.home-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.result-total { text-align: center; background: var(--purple-l); color: var(--purple-d); border-radius: 18px; padding: .3rem .9rem; }
.result-total b { font-size: 2rem; line-height: 1; } .result-total small { display: block; font-weight: 800; }
.teacher-note { margin-top: .7rem; background: var(--yellow-l); border-radius: 14px; padding: .6rem .8rem; }

/* ===== Giao diện v2: gọn hơn trên điện thoại, nút thu âm nổi bật ===== */
.dots { align-items: center; } .dots-n { color: var(--muted); font-size: .78rem; font-weight: 700; margin-left: .3rem; }
.unit-arrow, .unit-pos, .sb-br { display: none; }
.step-tab .lbl { white-space: nowrap; }
/* Bước 2: câu mẫu – chip trên, câu dưới, nút loa tròn bên phải */
.model-line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: .6rem; }
.model-line .chip { margin-top: 0; }
.model-line .btn { flex: 0 0 auto; width: 2.7rem; min-width: 2.7rem; height: 2.7rem; min-height: 2.7rem; padding: 0; border-radius: 50%; }
/* Thu âm */
.rec-panel .row .btn { flex: 1 1 auto; }
.btn.big { min-height: 3.8rem; font-size: 1.2rem; border-radius: 20px; width: 100%; }
.rec-panel.big .row .btn:not(.big) { flex: 1 1 30%; }
.rec-panel[data-state=recording] .rec-status { display: flex; align-items: center; justify-content: center; gap: .5rem; background: var(--red-l);
  color: #a02338; border-radius: 16px; padding: .6rem 1rem; font-size: 1.1rem; }
.rec-panel[data-state=recording] .rec-status::before { content: ''; width: .9rem; height: .9rem; border-radius: 50%; background: var(--red); animation: pulse 1s ease-in-out infinite; }
.rec-panel.big[data-state=recording] .rec-status { font-size: 1.35rem; padding: .9rem 1rem; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
.rec-panel[data-state=busy] .rec-status { background: var(--blue-l); color: #1d557a; border-radius: 16px; padding: .6rem 1rem; }
.login .btn[type=submit] { width: 100%; }
.sent-card .rec-status:empty, .rec-status:empty { min-height: 0; margin: 0; }

@media (max-width: 560px) {
  main { padding: .7rem .75rem 2.5rem; }
  .card { padding: .95rem 1rem; border-radius: 18px; }
  /* thanh trên cùng: 1 dòng */
  .topbar { flex-wrap: nowrap; padding: .45rem .75rem; }
  .brand-mark { font-size: 1.5rem; border-radius: 12px; }
  .brand-text strong { font-size: .95rem; }
  .session-bar { gap: .4rem; font-size: .78rem; min-width: 0; }
  .session-bar > span { text-align: right; line-height: 1.15; } .sb-br { display: inline; } .sb-dot { display: none; }
  .brand { gap: .45rem; } .brand-text strong { white-space: nowrap; }
  .row .btn { flex: 1 1 40%; min-width: 0; padding-left: .6rem; padding-right: .6rem; }
  .row { align-items: stretch; }
  .rec-panel.big .row .btn.small, .rec-panel .row .btn.small { flex: 1 1 100%; min-height: 2.4rem; }
  .rec-panel.big[data-state=recording] .rec-status { font-size: 1.15rem; white-space: nowrap; }
  .session-bar .btn { flex: 0 0 auto; min-height: 2.2rem; padding: .2rem .6rem; }
  h1 { font-size: 1.4rem; }
  /* chuyển Unit: mũi tên thay cho 10 nút số */
  .unit-head { gap: .3rem; }
  .unit-nav { width: 100%; flex-wrap: nowrap; }
  .unit-nav .unum { display: none; }
  .unit-nav .btn { flex: 0 0 auto; }
  .unit-arrow { display: inline-flex; width: 2.6rem; font-size: 1.4rem; }
  .unit-pos { display: block; flex: 1; text-align: center; font-weight: 800; color: var(--purple-d); }
  /* 5 bước luôn thấy đủ */
  .stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; overflow: visible; }
  .step-tab { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem .15rem; font-size: .68rem; line-height: 1.15; border-radius: 14px; }
  .step-tab .n { margin: 0; width: 1.7rem; height: 1.7rem; line-height: 1.7rem; font-size: .85rem; }
  .step-tab .lbl { white-space: normal; text-align: center; }
  .model-line { grid-template-columns: 1fr auto; row-gap: .25rem; }
  .model-line .chip { grid-column: 1; justify-self: start; }
  .model-line .sentence { grid-column: 1; grid-row: 2; font-size: 1.15rem; }
  .model-line .btn { grid-column: 2; grid-row: 1 / span 2; }
  .scaffold { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .scaf { padding: .4rem .6rem; border-radius: 14px; } .scaf b { font-size: .75rem; } .scaf span { font-size: .92rem; }
  .big-topic { font-size: 1.45rem; }
  .question-box { font-size: 1.25rem; }
  .sent-text { font-size: 1.15rem; }
  .unit-card { padding: .85rem 1rem; } .unit-vi { font-size: 1.15rem; }
  .home-head .btn { width: 100%; }
  .scores .score-pill { flex: 1 1 0; min-width: 0; padding: .3rem .4rem; } .score-pill b { font-size: 1.15rem; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .brand-text { display: none; }
  .topbar { gap: .3rem; }
}

.result-level { display: inline-block; margin: -.2rem 0 .3rem; background: var(--green-l); color: #176e49; border-radius: 999px; padding: .1rem .8rem; font-weight: 800; font-size: .9rem; }
.rubric-mini { background: var(--yellow-l); box-shadow: none; }
.rubric-mini summary { cursor: pointer; font-weight: 800; color: #7a5200; }
.result-card .scores { flex-direction: column; gap: .35rem; }
.result-card .score-pill { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; text-align: left; flex: none; padding: .35rem .8rem; }
.result-card .score-pill b { font-size: 1.1rem; } .result-card .score-pill small { font-size: .95rem; color: var(--ink); font-weight: 700; }
/* ===== Sao, huy hiệu, tiến bộ ===== */
.unit-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.stars { letter-spacing: .1rem; font-size: 1.05rem; color: #d8d1f5; white-space: nowrap; } .stars i { font-style: normal; } .stars i.on { color: #f2a900; }
.prog-btn { flex-direction: column; gap: 0; line-height: 1.2; } .prog-btn small { font-weight: 700; font-size: .8rem; opacity: .85; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: .4rem 0 1rem; }
.tile { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: .6rem .5rem; text-align: center; }
.tile b { display: block; font-size: 1.5rem; color: var(--purple-d); line-height: 1.2; } .tile small { color: var(--muted); font-size: .8rem; font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.badge { border: 2px dashed #ddd6f5; border-radius: 16px; padding: .55rem .6rem; text-align: center; background: #faf9fe; color: var(--muted); }
.badge.on { border: 2px solid var(--yellow); background: var(--yellow-l); color: var(--ink); }
.badge .b-ic { display: block; font-size: 1.9rem; line-height: 1.2; filter: grayscale(1); opacity: .5; } .badge.on .b-ic { filter: none; opacity: 1; }
.badge b { display: block; font-size: .92rem; } .badge small { display: block; font-size: .75rem; line-height: 1.25; }
.chart-box { width: 100%; max-width: 560px; }
.prog-chart { width: 100%; height: auto; display: block; font-family: inherit; }
.prog-chart .g { stroke: #ebe7f8; stroke-width: 1; } .prog-chart .g.th { stroke: #d8d1f5; stroke-dasharray: 4 4; }
.prog-chart .ax { fill: var(--muted); font-size: 11px; } .prog-chart .thl { fill: var(--muted); font-size: 10px; }
.prog-chart .ln { fill: none; stroke: var(--purple); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.prog-chart .pt { fill: var(--purple); stroke: #fff; stroke-width: 2; } .prog-chart .hit { fill: transparent; }
.prog-chart .vl { fill: var(--ink); font-size: 12px; font-weight: 800; }
.trend { font-weight: 800; color: var(--muted); margin: .4rem 0 0; } .trend.up { color: #176e49; } .trend.down { color: #9a6200; }
.crit-bars { display: grid; gap: .45rem; margin: .3rem 0 .8rem; }
.crit { display: grid; grid-template-columns: 9.5rem 1fr 3.2rem; align-items: center; gap: .6rem; }
.c-lab { font-weight: 700; font-size: .95rem; } .c-val { text-align: right; font-weight: 800; color: var(--ink); }
.c-bar { height: .85rem; background: #efecf9; border-radius: 999px; overflow: hidden; } .c-bar i { display: block; height: 100%; background: var(--purple); border-radius: 999px; }
.crit.weak .c-lab { color: #9a6200; } .crit.weak .c-bar i { background: var(--amber); } .crit.strong .c-bar i { background: var(--green); }
.crit-bars + .status-ok, .crit-bars ~ .teacher-note { margin-top: .5rem; }
.missed { margin-top: .6rem; color: #7a5200; background: var(--amber-l); border-radius: 12px; padding: .45rem .7rem; font-size: .95rem; }
h2.sec { margin: 1.2rem 0 .6rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 50; display: flex; gap: .7rem; align-items: center;
  background: #fff; border: 3px solid var(--yellow); border-radius: 20px; box-shadow: 0 10px 30px rgba(91,63,176,.25); padding: .7rem 1rem; width: max-content; max-width: min(24rem, calc(100vw - 2rem));
  animation: pop .45s cubic-bezier(.2,1.4,.4,1); transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translate(-50%, 20px); }
.toast-icons { font-size: 2rem; }
@keyframes pop { from { transform: translate(-50%, 40px) scale(.8); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .crit { grid-template-columns: 7.2rem 1fr 2.9rem; gap: .4rem; } .c-lab { font-size: .85rem; }
  .prog-btn { width: 100%; }
}
/* bước 3: so từng từ */
.word-fb { margin-top: .6rem; background: #f8f6ff; border-radius: 14px; padding: .6rem .75rem; }
.wf-head { display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: baseline; margin-bottom: .35rem; } .wf-msg { color: var(--muted); font-weight: 700; font-size: .9rem; }
.wf-words { display: flex; flex-wrap: wrap; gap: .3rem; }
.wf { border-radius: 10px; padding: .15rem .5rem; font-weight: 800; font-size: 1.05rem; border: 0; font-family: inherit; }
.wf.ok { background: var(--green-l); color: #176e49; }
.wf.bad { background: var(--red-l); color: #a02338; cursor: pointer; box-shadow: 0 2px 0 #f0b3bf; }
/* bước 4: mức gợi ý, phỏng vấn, sửa câu */
.hint-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.lvl-seg button { display: flex; flex-direction: column; line-height: 1.1; padding: .3rem .7rem; } .lvl-seg small { font-size: .7rem; font-weight: 700; opacity: .85; }
.scaf.lv2 { display: flex; align-items: center; gap: .45rem; } .scaf .ic { font-size: 1.5rem; line-height: 1; }
.scaffold.icons { grid-template-columns: repeat(6, 1fr); } .scaf.lv3 { display: flex; justify-content: center; padding: .5rem 0; } .scaf.lv3 .ic { font-size: 2.2rem; }
.mode-seg { display: flex; width: 100%; margin: .3rem 0 .6rem; } .mode-seg button { flex: 1; min-height: 2.9rem; }
.iv-dots { display: flex; gap: .35rem; justify-content: center; margin: .3rem 0 .7rem; }
.iv-dots i { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .85rem; background: #efecf9; color: var(--muted); }
.iv-dots i.cur { background: var(--purple); color: #fff; } .iv-dots i.done { background: var(--green-l); color: #176e49; }
.iv-q { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.iv-av { font-size: 2.4rem; } .bubble { flex: 1; background: var(--purple-l); border-radius: 18px 18px 18px 4px; padding: .55rem .85rem; }
.bubble small { display: block; color: var(--muted); font-weight: 700; } .bubble b { font-size: 1.25rem; color: var(--purple-d); }
.iv-say { flex: 0 0 auto !important; width: 3rem; }
.iv-hint { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; } .iv-hint small { color: var(--muted); font-weight: 700; } .iv-hint .scaf { flex: 1; }
.iv-heard { margin-top: .5rem; background: #f8f6ff; border-radius: 12px; padding: .5rem .7rem; font-size: 1.05rem; } .iv-heard.ok { background: var(--green-l); color: #176e49; }
.iv-nav { justify-content: space-between; margin-top: .6rem; }
.levelup { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--yellow-l); border-radius: 14px; padding: .55rem .8rem; margin: .6rem 0; font-weight: 700; }
.fixes { margin-top: .7rem; border-top: 2px dashed #d8eee2; padding-top: .6rem; }
.fix-item { background: #fff; border-radius: 14px; padding: .6rem .7rem; margin-top: .5rem; }
.fix-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: 1.05rem; font-weight: 800; }
.fix-line del { color: #a02338; } .fix-line ins { color: #176e49; text-decoration: none; } .fix-line .arrow { color: var(--muted); }
.fix-res:empty { display: none; } .fix-res { margin-top: .4rem; }
@media (max-width: 560px) { .scaffold.icons { grid-template-columns: repeat(3, 1fr); } .lvl-seg { width: 100%; } .lvl-seg button { flex: 1; } .mode-seg button { font-size: .85rem; } }
.voice-btn { margin-top: .6rem; width: 100%; }
