/* ===== Design tokens (sáng) ===== */
:root {
  /* màu: xanh dương theo logo trường + nhấn vàng ấm */
  --bg: #eef4f9;
  --bg-out: #dbe8f2;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --text: #0f2233;
  --muted: #4a5e70;          /* 6.4:1 trên trắng */
  --line: #dbe6ef;
  --brand: #0e6ba8;          /* chữ trắng trên nền này: 5.6:1 (AA) */
  --brand-2: #0a4f86;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1fa;
  --accent: #f5a524;         /* vàng ấm: CTA chính, streak, huy hiệu */
  --accent-2: #ffbe4d;
  --accent-soft: #fff3d9;
  --accent-ink: #4a2a00;     /* chữ trên vàng: > 7:1 */
  --accent-text: #8a4b00;    /* chữ vàng đậm trên nền nhạt */
  --rose: #e11d63;
  --ok: #15803d;
  --focus: #1d4ed8;
  /* khoảng cách theo lưới 4/8 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r: 20px; --r-sm: 14px; --r-xs: 10px; --r-pill: 999px;
  /* bóng mềm nhiều lớp */
  --shadow: 0 1px 2px rgba(15,34,51,.05), 0 4px 12px rgba(15,34,51,.05), 0 16px 32px -8px rgba(15,34,51,.08);
  --shadow-lg: 0 2px 4px rgba(10,63,110,.06), 0 12px 28px -4px rgba(10,63,110,.16), 0 32px 48px -16px rgba(10,63,110,.18);
  --shadow-up: 0 1px 2px rgba(14,107,168,.2), 0 6px 16px -2px rgba(14,107,168,.35);
  --shadow-accent: 0 1px 2px rgba(150,90,0,.2), 0 8px 18px -4px rgba(245,165,36,.55);
  /* chữ: thang 14 / 16 / 18 / 20 / 24 / 30 */
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 14px; --fs-sm: 16px; --fs-md: 18px; --fs-lg: 20px; --fs-xl: 24px; --fs-2xl: 30px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1622;
    --bg-out: #050c13;
    --surface: #12243a;
    --surface-2: #0f1f32;
    --text: #eaf3fa;
    --muted: #a9bdcf;
    --line: #23405c;
    --brand: #4db3ee;
    --brand-2: #1d7fc0;
    --brand-ink: #04233b;
    --brand-soft: #16344f;
    --accent: #fbbf4a;
    --accent-2: #ffd27a;
    --accent-soft: #3a2d10;
    --accent-ink: #3a2000;
    --accent-text: #fcd88a;
    --rose: #fb7199;
    --ok: #4ade80;
    --focus: #9cc2ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -4px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 16px 36px -8px rgba(0,0,0,.55);
    --shadow-up: 0 2px 4px rgba(0,0,0,.4), 0 8px 18px -4px rgba(77,179,238,.3);
    --shadow-accent: 0 2px 4px rgba(0,0,0,.4), 0 8px 18px -4px rgba(251,191,74,.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-md)/1.55 var(--font);
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .ring-text, .week, .bar-lbl { font-variant-numeric: tabular-nums; }

/* ===== Khung điện thoại ===== */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
@media (min-width: 520px) {
  body { background: radial-gradient(900px 500px at 20% -10%, rgba(14,107,168,.25), transparent), var(--bg-out); }
  .app { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(10,40,70,.25); }
}
main { padding: 0 var(--s4) calc(112px + env(safe-area-inset-bottom)); display: grid; gap: var(--s6); }

/* hiệu ứng xuất hiện xếp lớp */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
main > * { animation: rise .55s var(--ease) both; }
main > :nth-child(2) { animation-delay: .08s; } main > :nth-child(3) { animation-delay: .14s; }
main > :nth-child(4) { animation-delay: .2s; } main > :nth-child(5) { animation-delay: .26s; }
main > :nth-child(6) { animation-delay: .32s; } main > :nth-child(7) { animation-delay: .38s; }

/* ===== Header ===== */
.hero {
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  margin: 0 calc(var(--s4) * -1); padding: var(--s5) var(--s4) 72px;
  background:
    radial-gradient(120% 80% at 100% 0%, #1b8fd6 0%, transparent 55%),
    linear-gradient(160deg, #1179bb 0%, #0e6ba8 40%, #0a3f6e 100%);
  border-radius: 0 0 32px 32px; display: grid; gap: var(--s4);
}
@media (prefers-color-scheme: dark) {
  .hero { background: radial-gradient(120% 80% at 100% 0%, #1a6aa0 0%, transparent 55%), linear-gradient(160deg, #165d8f 0%, #10466f 45%, #0a2740 100%); }
}
/* vòng cung sáng ở mép dưới */
.hero::after {
  content: ""; position: absolute; z-index: -1; left: -20%; right: -20%; bottom: -150px; height: 220px;
  border-radius: 50%; border-top: 1px solid rgba(255,255,255,.22);
  background: radial-gradient(60% 60% at 50% 0%, rgba(255,255,255,.1), transparent 70%);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bokeh { position: absolute; border-radius: 50%; filter: blur(2px); }
.b1 { width: 120px; height: 120px; top: -30px; left: 38%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%); }
.b2 { width: 70px; height: 70px; top: 120px; left: -16px; background: radial-gradient(circle, rgba(245,165,36,.32), transparent 70%); }
.b3 { width: 46px; height: 46px; top: 54px; right: 34%; background: radial-gradient(circle, rgba(255,255,255,.2), transparent 70%); }
.laurel { position: absolute; top: -34px; right: -52px; width: 230px; height: 230px; stroke: #fff; opacity: .16; }
.laurel .arc { stroke-width: 1; stroke-dasharray: 2 6; }
.laurel .stem { stroke-width: 2; }
.laurel .leaves { fill: #fff; stroke: none; }

.brand { display: flex; align-items: center; gap: var(--s3); }
.logo-wrap {
  flex: none; width: 64px; height: 64px; border-radius: 50%; padding: 2px; display: grid; place-items: center;
  background: conic-gradient(from 200deg, var(--accent), #fff 35%, #fff 65%, var(--accent));
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.logo { width: 60px; height: 60px; border-radius: 50%; background: #fff; object-fit: contain; padding: 4px; }
.hero h1 { display: grid; line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.h1-a { font-size: 22px; }
.h1-b { font-size: 22px; color: #ffd27a; }   /* vàng sáng trên xanh: > 3:1 cho chữ lớn đậm */

.hello { display: grid; gap: 2px; }
.date { font-size: var(--fs-xs); font-weight: 500; opacity: .85; text-transform: capitalize; }
.greeting { font-size: var(--fs-xl); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.tagline { font-size: var(--fs-sm); opacity: .92; }

.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; translate: 0 -50%; color: var(--brand-2); pointer-events: none; }
.search input {
  width: 100%; height: 52px; padding: 0 16px 0 48px; border: 0;
  border-radius: var(--r-pill); background: rgba(255,255,255,.96); color: #0f2233; font-size: var(--fs-sm);
  box-shadow: 0 2px 4px rgba(0,0,0,.1), 0 10px 24px -6px rgba(5,30,55,.35);
}
.search input::placeholder { color: #4a5e70; }
.search input:focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }

/* ===== Thẻ chung ===== */
.card { background: var(--surface); border-radius: var(--r); padding: var(--s5) var(--s4); box-shadow: var(--shadow); border: 1px solid var(--line); }
h2 { font-size: var(--fs-lg); line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); flex-wrap: wrap; }
.sec-head p { font-size: var(--fs-xs); color: var(--muted); }
.app-version { text-align: center; font-size: var(--fs-xs); color: var(--muted); margin: 16px 0 8px; font-variant-numeric: tabular-nums; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.chip { font-size: var(--fs-xs); font-weight: 600; padding: 2px 10px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-2); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .chip { color: var(--brand); } }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }

/* ===== Nút ===== */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border-radius: var(--r-sm); border: 2px solid transparent;
  font-size: var(--fs-md); font-weight: 700; line-height: 1.2; -webkit-user-select: none; user-select: none;
  transition: transform .14s var(--ease), background .2s, box-shadow .2s, filter .2s;
}
.btn svg { width: 24px; height: 24px; flex: none; }
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(180deg, #1584c9, var(--brand)); color: var(--brand-ink); box-shadow: var(--shadow-up); }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--brand); } }
.btn-secondary { background: var(--surface); color: var(--brand-2); border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
@media (prefers-color-scheme: dark) { .btn-secondary { color: var(--brand); } }
.btn-accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: var(--shadow-accent); }
.btn-accent svg { transition: transform .2s var(--ease); }
.btn-accent:hover svg { transform: translateX(3px); }
.btn[aria-pressed="true"] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
.btn-secondary[aria-pressed="true"] { background: var(--brand-soft); }
.btn-sm { min-height: 48px; font-size: var(--fs-sm); padding: 0 18px; }

/* gợn sóng khi chạm */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .22; transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ===== Tiếp tục học ===== */
.resume {
  position: relative; z-index: 1; margin-top: -64px; display: grid; gap: var(--s3);
  box-shadow: var(--shadow-lg); border-color: transparent; padding: var(--s4);
}
.resume-top { display: flex; gap: var(--s3); align-items: center; }
.resume-ico { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.resume-ico svg { width: 30px; height: 30px; }
.resume-txt { min-width: 0; }
.resume h2 { font-size: var(--fs-lg); line-height: 1.25; }
.resume-role { font-size: var(--fs-xs); color: var(--muted); }
.bar { height: 10px; border-radius: var(--r-pill); background: var(--brand-soft); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2aa3e3, var(--brand)); transition: width .9s var(--ease) .3s; }
.resume-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: calc(var(--s1) * -1); }
.resume-meta b { color: var(--text); }
.resume .btn { width: 100%; font-size: var(--fs-lg); }

/* ===== Câu của ngày ===== */
.daily {
  display: grid; gap: var(--s2); position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(140% 90% at 100% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    radial-gradient(100% 70% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  box-shadow: var(--shadow-lg);
}
/* họa tiết chấm mờ */
.daily::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background: radial-gradient(color-mix(in srgb, var(--brand) 22%, transparent) 1px, transparent 1.5px) 0 0 / 16px 16px;
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 45%); mask-image: linear-gradient(200deg, #000, transparent 45%);
}
.quote { position: absolute; z-index: -1; right: 12px; bottom: 76px; width: 84px; height: 84px; fill: var(--brand); stroke: none; opacity: .07; }
.daily-head { display: flex; align-items: flex-start; gap: var(--s2); }
.daily-title { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.eyebrow-ico { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text); }
.eyebrow-ico svg { width: 20px; height: 20px; color: var(--accent); }
.icon-btns { margin-left: auto; display: flex; gap: var(--s1); margin-right: -6px; }
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); transition: background .2s, color .2s, transform .14s var(--ease);
}
.icon-btn:hover { background: var(--brand-soft); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 24px; height: 24px; }
.fav[aria-pressed="true"] { color: var(--rose); }
.fav[aria-pressed="true"] svg { fill: currentColor; animation: pop .45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.35); } }

.en { font-size: var(--fs-2xl); line-height: 1.22; font-weight: 800; letter-spacing: -.015em; color: var(--brand-2); text-wrap: pretty; margin-top: var(--s1); transition: color .3s; }
@media (prefers-color-scheme: dark) { .en { color: var(--text); } }
.en mark {
  color: inherit; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 45%, transparent) 58%);
  border-radius: 2px; padding: 0 1px;
}
.ipa { display: flex; gap: var(--s2); align-items: baseline; color: var(--muted); font-size: var(--fs-sm); font-style: italic; }
.ipa-lbl { flex: none; font-style: normal; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-2); }
@media (prefers-color-scheme: dark) { .ipa-lbl { color: var(--brand); } }
.vi { font-size: var(--fs-md); font-weight: 600; padding: var(--s2) var(--s3); margin-top: var(--s1); border-radius: var(--r-xs); background: color-mix(in srgb, var(--accent-soft) 80%, transparent); border-left: 4px solid var(--accent); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s2); }
.btns .btn { padding: 0 var(--s2); gap: var(--s2); white-space: nowrap; }
.btns .btn-primary { min-height: 60px; font-size: var(--fs-lg); }
.btns .btn-secondary { font-size: 17px; }
.btns .btn-secondary svg { width: 22px; height: 22px; }
.speaking .en { color: var(--brand); }
/* sóng âm: luôn hiện nhẹ, chuyển động khi đang phát */
.wave { display: inline-flex; align-items: center; gap: 3px; height: 20px; opacity: .65; }
.wave b { width: 3px; height: 100%; border-radius: 2px; background: currentColor; }
.wave b:nth-child(1) { scale: 1 .35; } .wave b:nth-child(2) { scale: 1 .75; } .wave b:nth-child(3) { scale: 1 1; }
.wave b:nth-child(4) { scale: 1 .6; } .wave b:nth-child(5) { scale: 1 .3; }
.btn[aria-pressed="true"] .wave { opacity: 1; }
.btn-primary[aria-pressed="true"] > svg { display: none; }   /* nhường chỗ cho chữ "Đang phát…" + sóng */
.btn[aria-pressed="true"] .wave b { animation: bar .9s ease-in-out infinite; }
.btn[aria-pressed="true"] .wave b:nth-child(2n) { animation-delay: -.45s; }
.btn[aria-pressed="true"] .wave b:nth-child(3) { animation-delay: -.2s; }
@keyframes bar { 50% { transform: scaleY(.35); } }
.notice { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--fs-sm); line-height: 1.45; color: var(--accent-text); background: var(--accent-soft); padding: var(--s3); border-radius: var(--r-sm); margin-top: var(--s1); }
.notice[hidden] { display: none; }
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }

/* ===== Tiến độ ===== */
.progress { display: grid; gap: var(--s4); }
.streak {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.streak svg { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--accent); color: #5c2d00; fill: #ffe2a8; }
.progress-body { display: flex; align-items: center; gap: var(--s4); }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 100%; height: 100%; rotate: -90deg; stroke-width: 10; }
.ring-bg { stroke: var(--brand-soft); }
.ring-fg { stroke: url(#rg); stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .9s var(--ease), stroke .3s; }
@media (prefers-color-scheme: dark) { .ring-fg { stroke: var(--brand); } }
.done .ring-fg { stroke: var(--accent); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring-text strong { font-size: 34px; font-weight: 800; color: var(--brand-2); }
.ring-text span { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .ring-text strong { color: var(--text); } }
.goal-side { display: grid; gap: var(--s3); min-width: 0; }
.goal-msg { font-size: var(--fs-sm); line-height: 1.4; color: var(--muted); }
.goal-msg b { display: block; font-size: var(--fs-lg); color: var(--text); line-height: 1.25; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 4px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; color: var(--accent-text);
  background: linear-gradient(180deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.badge svg { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--accent); color: #5c2d00; fill: #ffe2a8; stroke-width: 1.8; }
/* tuần: 7 chấm */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); padding: var(--s3) var(--s2) var(--s2); border-radius: var(--r-sm); background: var(--surface-2); }
.week li { display: grid; justify-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line); }
.dot svg { width: 16px; height: 16px; stroke-width: 3; }
.week .is-done .dot { border: 0; background: var(--brand); color: var(--brand-ink); }
.week .is-today { color: var(--text); font-weight: 800; }
.week .is-today .dot { border: 3px solid var(--accent); background: var(--accent-soft); }
.week .is-today.is-done .dot { background: var(--accent); color: #5c2d00; }

/* ===== Vai trò ===== */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.role {
  --c: #0e6ba8; --t: #dcedf8; --tt: var(--t);
  position: relative; overflow: hidden; width: 100%; height: 100%; min-height: 168px; padding: var(--s4) 14px 14px;
  text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--tt) 70%, var(--surface)), var(--surface) 55%);
  color: var(--text); border: 1px solid color-mix(in srgb, var(--c) 18%, var(--line));
  border-radius: var(--r); box-shadow: var(--shadow);
  transition: transform .15s var(--ease), border-color .2s, box-shadow .2s;
}
.role:active { transform: scale(.97); }
.role.active { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.role .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--tt); color: var(--c); flex: none; margin-bottom: 2px; }
.role .ico svg { width: 28px; height: 28px; }
.role .name { font-size: 17px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.role .desc { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.role .foot { margin-top: auto; width: 100%; display: grid; gap: 4px; padding-top: 4px; }
.bar-lbl { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; }
.bar-lbl b { color: var(--text); }
.role .bar { height: 6px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.role .bar i { background: var(--c); transition-delay: .5s; }
.role .go { position: absolute; top: 16px; right: 12px; width: 22px; height: 22px; color: var(--c); opacity: .7; }
/* thẻ gợi ý: trải ngang ở đầu lưới */
.roles .featured { grid-column: 1 / -1; }
.featured .role { min-height: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 6px; align-items: center; padding: var(--s6) 44px var(--s4) var(--s4); }
.featured .role .ico { width: 60px; height: 60px; border-radius: 18px; grid-row: span 2; margin: 0; }
.featured .role .ico svg { width: 32px; height: 32px; }
.featured .role .name { font-size: var(--fs-md); }
.featured .role .foot { grid-column: 1 / -1; padding-top: var(--s1); }
.featured .role .go { top: calc(50% + 6px); translate: 0 -50%; }
.tag-suggest { position: absolute; top: 0; right: 0; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent); padding: 3px 12px 4px 14px; border-radius: 0 var(--r) 0 var(--r-sm); }
@media (prefers-color-scheme: dark) {
  .role { --tt: color-mix(in srgb, var(--c) 28%, var(--surface)); }
  .role .ico, .role .go { color: color-mix(in srgb, var(--c) 35%, #fff); }
  .role .bar i { background: color-mix(in srgb, var(--c) 45%, #fff); }
  .role.active { border-color: color-mix(in srgb, var(--c) 45%, #fff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, #fff); }
}

/* ===== Luyện tập ===== */
.practice { display: grid; gap: var(--s3); }
.pr-btn {
  --c: #4f46e5; --t: #e6e5fb;
  position: relative; overflow: hidden; width: 100%; min-height: 80px; display: flex; align-items: center; gap: 14px; padding: var(--s3) 14px var(--s3) var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-align: left; box-shadow: var(--shadow);
  transition: transform .15s var(--ease), border-color .2s;
}
.pr-btn:active { transform: scale(.97); border-color: var(--c); }
/* ô minh họa riêng từng loại */
.art { position: relative; flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--t); color: var(--c); overflow: hidden; }
.art svg { position: relative; width: 28px; height: 28px; }
.art::before, .art::after { content: ""; position: absolute; border-radius: 6px; }
.art-cards::before { width: 26px; height: 32px; border: 2px solid currentColor; opacity: .3; rotate: -14deg; translate: -5px 1px; }
.art-cards::after { width: 26px; height: 32px; background: currentColor; opacity: .12; rotate: 10deg; translate: 6px 2px; }
.art-ear::before, .art-ear::after { inset: 8px; border-radius: 50%; border: 2px solid currentColor; opacity: .18; }
.art-ear::after { inset: 2px; opacity: .1; }
.art-heart::before { width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: .25; top: 8px; right: 9px; }
.art-heart::after { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .25; bottom: 10px; left: 9px; }
.pr-txt { min-width: 0; flex: 1; }
.pr-txt b { display: block; font-size: var(--fs-md); line-height: 1.3; }
.pr-txt small { display: block; font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.pr-go { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--c) 50%, transparent); }
.pr-go svg { width: 18px; height: 18px; stroke-width: 2.6; translate: 1px 0; fill: currentColor; }
@media (prefers-color-scheme: dark) {
  .art { background: color-mix(in srgb, var(--c) 28%, var(--surface)); color: color-mix(in srgb, var(--c) 35%, #fff); }
  .pr-go { background: color-mix(in srgb, var(--c) 40%, #fff); color: #0a1622; }
}

/* ===== Cài ứng dụng ===== */
.install {
  position: relative; display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r);
  background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 40%, var(--surface)));
  border: 1px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
}
.install[hidden] { display: none; }
.install-row { display: flex; gap: var(--s3); align-items: center; }
.install-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.install-ico svg { width: 24px; height: 24px; }
.install-txt { flex: 1; min-width: 0; }
.install h2 { font-size: var(--fs-sm); line-height: 1.3; }
.install p { color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.install .btn[hidden] { display: none; }
.ios[open] { flex-basis: 100%; }
.close { flex: none; width: 48px; height: 48px; margin: -8px -8px -8px 0; align-self: flex-start; display: grid; place-items: center; background: transparent; border: 0; border-radius: 50%; color: var(--muted); }
.close:hover, .close:active { background: var(--surface); }
.close svg { width: 22px; height: 22px; }
.ios summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: var(--fs-sm); color: var(--brand-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ios[open] summary { margin-bottom: var(--s2); }
@media (prefers-color-scheme: dark) { .ios summary { color: var(--brand); } }
.ios ol { display: grid; gap: var(--s2); counter-reset: st; }
.ios li { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-sm); line-height: 1.35; padding: var(--s2); border-radius: var(--r-sm); background: var(--surface); counter-increment: st; }
.step-ico { position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.step-ico svg { width: 22px; height: 22px; }
.step-ico::after { content: counter(st); position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--accent); color: var(--accent-ink); }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 10px;
  translate: -50% 16px; scale: .96; opacity: 0; pointer-events: none; width: max-content; max-width: min(440px, calc(100vw - 32px));
  background: #10263b; color: #fff; padding: 10px 18px 10px 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; line-height: 1.35;
  box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 16px 32px -8px rgba(0,0,0,.4);
  transition: opacity .25s, translate .35s var(--spring), scale .35s var(--spring);
}
.toast.show { opacity: 1; translate: -50% 0; scale: 1; }
.toast-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.toast-ico svg { width: 18px; height: 18px; }
.toast[data-kind="ok"] .toast-ico { background: #22c55e; color: #052e14; }
.toast[data-kind="heart"] .toast-ico { background: #fb7199; color: #3b0718; }
.toast[data-kind="party"] .toast-ico { background: var(--accent); color: #4a2a00; }
@media (prefers-color-scheme: dark) { .toast { background: #eaf3fa; color: #0f2233; } .toast-ico { background: rgba(15,34,51,.1); } }

/* ===== Pháo giấy ăn mừng ===== */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall var(--d, 1.4s) cubic-bezier(.25,.6,.4,1) forwards; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x), 70vh) rotate(var(--r)); opacity: 0; }
}

/* ===== Thanh dưới ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; translate: -50% 0; width: 100%; max-width: 480px; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px 4px env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -6px rgba(15,34,51,.1);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .tabbar { background: color-mix(in srgb, var(--surface) 85%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); }
}
.tab {
  position: relative; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; border-radius: var(--r-sm);
  transition: color .2s;
}
.tab-ico { position: relative; width: 56px; height: 32px; display: grid; place-items: center; border-radius: var(--r-pill); }
.tab-ico::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--brand-soft); scale: .3 1; opacity: 0; transition: scale .35s var(--spring), opacity .2s; }
.tab svg { position: relative; width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--brand-2); font-weight: 700; }
@media (prefers-color-scheme: dark) { .tab[aria-current="page"] { color: var(--brand); } }
.tab[aria-current="page"] .tab-ico::before { scale: 1; opacity: 1; }
.tab[aria-current="page"] svg { fill: color-mix(in srgb, currentColor 18%, transparent); }
.tab.pop svg { animation: pop .4s var(--spring); }
/* tab Luyện tập nổi bật */
.tab-main .tab-ico {
  width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; color: #fff;
  background: linear-gradient(160deg, #1b8fd6, var(--brand-2)); box-shadow: 0 0 0 4px var(--bg), var(--shadow-up);
}
.tab-main .tab-ico::before { display: none; }
.tab-main svg { fill: #ffd27a; stroke: #ffd27a; width: 24px; height: 24px; }
.tab-main { color: var(--brand-2); }
@media (prefers-color-scheme: dark) { .tab-main { color: var(--brand); } .tab-main .tab-ico { background: linear-gradient(160deg, #2a8fd0, #135c94); } }

@media (max-width: 374px) {
  .en { font-size: 26px; }
  .greeting { font-size: 22px; }
  .ring { width: 96px; height: 96px; }
  .ring-text strong { font-size: 30px; }
  .ring-text span { font-size: 13px; }
  .progress h2 { font-size: var(--fs-md); white-space: nowrap; }
  .progress-body { gap: var(--s3); }
  .role { padding-left: 12px; padding-right: 12px; }
  .role .name { font-size: 16px; }
  .btns .btn-secondary { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .confetti, .ripple { display: none; }
}
