/* Egomini soft style: Settings + Account pages */
.set-soft, .acc-soft { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.set-card { padding: 16px; }
.set-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.set-ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 14px; background: var(--tile, color-mix(in srgb, var(--accent) 14%, var(--surface))); color: var(--accent); }
.set-head h3 { margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.set-head p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--text-dim); }
.set-head .link-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; }
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; padding-top: 2px; }
.set-row.click { cursor: pointer; }
.set-row.dim { opacity: .45; }
.sr-text { min-width: 0; flex: 1; }
.sr-title { font-size: 14.5px; font-weight: 700; }
.sr-desc { margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--text-dim); }
.set-row > svg { flex-shrink: 0; color: var(--text-dim); }

/* toggle switch */
.switch { position: relative; width: 46px; height: 27px; flex-shrink: 0; padding: 0; border: 0; border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background .18s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .18s; }
.switch.on { background: var(--btn-bg, var(--accent)); }
.switch.on::after { transform: translateX(19px); }

/* stepper + fields */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); box-shadow: var(--shadow-card); cursor: pointer; }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper b { min-width: 22px; text-align: center; font-size: 16px; font-weight: 800; }
.set-field { display: flex; align-items: center; gap: 6px; }
.set-field input, .set-field select { padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-family: var(--font-ui); font-size: 14px; }
.set-field input { width: 56px; text-align: center; }
.vol-row { padding: 12px 0 2px; border-top: 1px solid var(--line); }
.vol-row .sr-title { display: flex; justify-content: space-between; }
.vol-row input[type=range] { width: 100%; margin-top: 8px; accent-color: var(--accent); }
.set-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }

/* themes */
.theme-grid { gap: 10px; margin-top: 0; }
.theme-card { padding: 10px 12px; border-radius: 16px; border: 0.5px solid var(--line); background: var(--surface); }
.theme-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.theme-card .name { font-size: 13px; }

/* account */
.acc-profile { display: flex; align-items: center; gap: 14px; padding: 18px 16px; }
.acc-avatar { position: relative; width: 62px; height: 62px; flex-shrink: 0; overflow: hidden; border-radius: 50%; border: 3px solid var(--surface); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: var(--shadow-card); }
.acc-avatar img { position: absolute; left: 50%; top: 54%; width: 84%; transform: translate(-50%, -50%); }
.acc-info { min-width: 0; flex: 1; }
.acc-name { font-size: 16.5px; font-weight: 800; overflow-wrap: anywhere; }
.acc-sub { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; color: var(--text-dim); }
.acc-sub svg { color: var(--accent); }
.acc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.acc-actions .btn { width: 100%; }
.acc-note { display: flex; gap: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.acc-note svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.acc-prog { display: flex; align-items: center; gap: 14px; padding: 16px; }
.acc-prog .pc-num { flex: 1; }

@media (min-width: 720px) {
  .set-soft, .acc-soft { max-width: 760px; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}

/* no outlines: use soft shadows / tinted fills instead */
.theme-card { border-color: transparent; box-shadow: var(--shadow-card); }
.theme-card.active { border-color: var(--accent); }
.theme-live-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  line-height: 1.3;
}
.theme-live-badge.selected {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-3, #8882));
  color: var(--accent);
}
.set-row, .vol-row { border-top-color: color-mix(in srgb, var(--line) 60%, transparent); }
.set-field input, .set-field select { border-color: transparent; }
.stepper button, .set-head .link-btn { border: 1px solid var(--line); border-color: var(--line); box-shadow: var(--shadow-card); }
.acc-avatar { border-color: transparent; }
.acc-note { border-color: transparent; }

/* vocab audio pack banner (Vocabulary tab) */
.pack-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-card); font-size: 13px; color: var(--text-dim); }
.pack-banner b { color: var(--text); }
.pack-banner > span { flex: 1; min-width: 0; }
.pack-banner.ok svg { color: var(--mint); }
.pack-banner.locked svg { color: var(--accent); }
.pack-bar { flex-basis: 100%; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 16%, transparent); overflow: hidden; }
.pack-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .25s; }

.set-select { flex-shrink: 0; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 14px var(--font-ui); }

/* Settings hub: 4 big cards */
.set-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .set-hub { grid-template-columns: 1fr; } }
.set-hub-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px; padding: 16px; text-align: left; border: 1px solid var(--line); color: var(--text); font-family: var(--font-ui); cursor: pointer; transition: transform .1s, border-color .15s; }
.set-hub-card:hover { border-color: var(--accent); }
.set-hub-card:active { transform: scale(.98); }
.set-hub-card .set-ico { width: 48px; height: 48px; border-radius: 16px; }
.shc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shc-text b { font-size: 17px; font-weight: 800; }
.shc-text small { font-size: 12.5px; line-height: 1.35; color: var(--text-dim); }
.set-hub-card > svg { flex-shrink: 0; color: var(--text-dim); }

/* Presets */
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset-row button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-family: var(--font-ui); cursor: pointer; }
.preset-row button b { font-size: 15px; font-weight: 800; }
.preset-row button small { font-size: 11.5px; color: var(--text-dim); }
.preset-row button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* Step flow 1 -> 7 */
.step-flow { list-style: none; margin: 0; padding: 0; }
.step-flow li { position: relative; display: flex; gap: 12px; }
.step-flow li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 34px; bottom: -4px; width: 2px; background: var(--line); }
.sf-num { position: relative; z-index: 1; flex-shrink: 0; width: 30px; height: 30px; margin-top: 10px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--btn-bg, var(--accent)); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.step-flow li.off .sf-num { background: var(--surface-3); color: var(--text-dim); }
.step-flow li.off .sr-text { opacity: .5; }
.sf-body { flex: 1; min-width: 0; padding-bottom: 6px; }
.step-flow .set-row { border-top: 0; padding: 10px 0; }
.sf-extra { margin: 0 0 8px; padding: 2px 12px; border-radius: 14px; background: var(--surface-2); }
.sf-extra .set-row { border-top: 1px solid var(--line); padding: 10px 0; }
.sf-extra .set-row:first-child { border-top: 0; }
/* Step 7 review settings */
.rv-set { padding: 10px 0 12px; }
.rv-set-label { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 8px; font-size: 12.5px; font-weight: 800; color: var(--text); }
.rv-set-label span { font-weight: 600; color: var(--text-dim); }
.rv-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.rv-mode { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; min-height: 104px; text-align: left; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); font-family: var(--font-ui); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.rv-mode:active { transform: scale(.97); }
.rv-mode b { margin-top: 6px; font-size: 13.5px; font-weight: 800; line-height: 1.25; }
.rv-mode small { font-size: 11.5px; line-height: 1.35; color: var(--text-dim); }
.rvm-ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); color: var(--text-dim); }
.rvm-check { position: absolute; top: 10px; right: 10px; display: flex; color: var(--text-dim); opacity: .5; }
.rv-mode.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.rv-mode.on .rvm-ico { background: var(--btn-bg, var(--accent)); color: var(--accent-ink); }
.rv-mode.on .rvm-check { color: var(--accent); opacity: 1; }
.rv-order { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.rv-order button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); font-family: var(--font-ui); font-size: 13px; font-weight: 800; cursor: pointer; }
.rv-order button.on { background: var(--btn-bg, var(--accent)); color: var(--accent-ink); }
.rv-set-hint { margin: 8px 2px 0; font-size: 12px; line-height: 1.4; color: var(--text-dim); }

.set-row.wrap { flex-wrap: wrap; }
@media (max-width: 480px) { .set-row.wrap .accent-seg { width: 100%; } .set-row.wrap .accent-seg button { flex: 1; } }

/* Memory strength badge (FSRS retrievability) */
.mem-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 2px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.5; }
.mem-badge.hi { color: #1f9d55; background: color-mix(in srgb, #1f9d55 15%, transparent); }
.mem-badge.mid { color: #c27c0e; background: color-mix(in srgb, #e0a020 18%, transparent); }
.mem-badge.lo { color: #d64545; background: color-mix(in srgb, #e5484d 15%, transparent); }

/* Notifications */
.nt-status { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.nt-status.ok { color: #1f9d55; }
.nt-alert { display: flex; gap: 10px; margin: 0 0 10px; padding: 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, #e5484d 40%, var(--line)); background: color-mix(in srgb, #e5484d 10%, var(--surface)); color: var(--text); }
.nt-alert > svg { flex-shrink: 0; margin-top: 2px; color: #d64545; }
.nt-alert b { display: block; font-size: 14px; margin-bottom: 3px; }
.nt-alert span { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
.set-row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.nt-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 420px; }
.nt-days button { width: 100%; max-width: 48px; aspect-ratio: 1; justify-self: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-dim); font-family: var(--font-ui); font-size: 12.5px; font-weight: 800; cursor: pointer; }
.nt-days button.on { border-color: transparent; background: var(--btn-bg, var(--accent)); color: var(--accent-ink); }
.set-row.stack .accent-seg { align-self: flex-start; }
@media (max-width: 480px) { .set-row.stack .accent-seg { align-self: stretch; } .set-row.stack .accent-seg button { flex: 1; } }
@media (max-width: 1039px) { .set-hub-card:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* Signed-in devices */
.dev-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.dev-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-main b { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-main span { font-size: 12px; color: var(--text-dim); }
.dev-row .btn { flex-shrink: 0; }
.dev-all { width: 100%; margin-top: 10px; }

/* ---------- Sidebar pages: Ôn tập, Lịch sử học, Quà tặng ---------- */
/* Same frame as the other tabs: centred column, page-head, set-card / stat-card blocks. */
.side-page { display: flex; flex-direction: column; gap: 14px; max-width: 920px; margin-left: auto; margin-right: auto; }
.side-page .stat-row { margin: 0; }
.side-page .set-card .set-head { margin-bottom: 16px; }
.side-page .review-card { margin: 0; }

/* Banner: the page's main number + action, mascot on the right (same look as the home banner) */
.sp-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 24px 26px; border-radius: 24px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--accent) 7%, var(--surface)));
  box-shadow: var(--shadow-card); }
.sp-banner.calm { background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.sb-text { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sb-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.sb-big { display: flex; align-items: baseline; gap: 10px; }
.sb-big b { font-family: var(--font-word); font-size: 56px; font-weight: 800; line-height: .95; color: var(--text); }
.sb-big span { font-size: 16px; font-weight: 700; color: var(--text); }
.sb-text p { margin: 0; max-width: 440px; font-size: 14px; line-height: 1.45; color: var(--text-dim); }
.sb-text p b { color: var(--text); }
.sb-text h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.sb-text .btn { width: auto; margin-top: 4px; padding-left: 22px; padding-right: 22px; display: inline-flex; align-items: center; gap: 8px; }
.sb-img { flex-shrink: 0; width: auto; height: 150px; object-fit: contain; transform: scaleX(-1); }

/* Streak: this week's days */
.sp-week { display: flex; gap: 8px; margin-top: 6px; }
.sw-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.sw-day i { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 2px dashed color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent-ink); }
.sw-day.on i { background: var(--accent); border: 2px solid var(--accent); }
.sw-day.today span { color: var(--accent); }
.sw-day.today:not(.on) i { border-style: solid; border-color: var(--accent); }
.sw-day.future i { opacity: .5; }

/* Bar charts */
.sp-chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 4px 2px 0; }
.sp-chart.dense { gap: 6px; }
.sp-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.sp-bar { width: 100%; max-width: 46px; display: flex; flex-direction: column; border-radius: 10px 10px 4px 4px; overflow: hidden; background: var(--accent); }
.sp-chart.dense .sp-bar { max-width: 30px; border-radius: 8px 8px 3px 3px; }
.sp-bar i { display: block; min-height: 0; }
.sp-bar i.l, .sp-legend i.l { background: var(--accent); }
.sp-bar i.r, .sp-legend i.r { background: color-mix(in srgb, var(--accent) 40%, var(--surface-2)); }
.sp-n { font-size: 12.5px; font-weight: 800; color: var(--text); min-height: 15px; }
.sp-lbl { font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.sp-chart.dense .sp-lbl { font-size: 10.5px; }
.sp-col.today .sp-lbl { color: var(--accent); font-weight: 800; }
.sp-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.sp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sp-legend i.r { margin-left: 10px; }
.sp-empty { padding: 18px; border-radius: 16px; background: var(--surface-2); color: var(--text-dim); font-size: 14px; text-align: center; }

/* Packs being learned */
.sp-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sp-pack { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.sp-pack .pk-tile { width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; font-size: 18px; }
.sp-pack em { flex-shrink: 0; font-style: normal; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 9px; display: inline-flex; align-items: center; gap: 4px; }
.sp-due { background: var(--accent); color: var(--accent-ink); }
.sp-ok { background: var(--surface-2); color: var(--text-dim); }
.sp-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-card); }

/* Recent words, grouped by day */
.sp-words { display: flex; flex-direction: column; }
.sp-day { margin: 14px 0 6px; font-size: 13px; font-weight: 800; color: var(--text-dim); }
.sp-day:first-child { margin-top: 0; }
.sp-word { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.sp-word:last-child { border-bottom: 0; }
.sw-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.sw-main b { font-family: var(--font-word); font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-word em { flex-shrink: 0; font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
.sp-word em.ok { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.sp-word em.learning { background: var(--surface-2); color: var(--text-dim); }
.sp-word small { flex-shrink: 0; width: 44px; text-align: right; font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Gifts */
.sp-gift-row { display: flex; gap: 8px; width: 100%; max-width: 460px; margin-top: 4px; }
.sp-gift-row input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 2px solid transparent; border-radius: 14px; background: var(--surface); color: var(--text); font-family: var(--font-ui); font-size: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; box-shadow: var(--shadow-card); }
.sp-gift-row input:focus { outline: 0; border-color: var(--accent); }
.sp-gift-row .btn { margin: 0; flex-shrink: 0; }
.sp-banner.gift .feedback { min-height: 0; }
.sp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sp-steps li { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.sp-steps li > span { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.sp-steps b { font-size: 14.5px; }
.sp-steps p { margin: 3px 0 0; font-size: 13px; line-height: 1.4; color: var(--text-dim); }
.side-page .vip-card { margin: 0; }

@media (max-width: 600px) {
  .sp-banner { padding: 18px; }
  .sb-img { position: absolute; right: 8px; bottom: 8px; height: 92px; opacity: .9; }
  .sb-text { padding-right: 70px; }
  .sb-big b { font-size: 44px; }
  .sp-chart { gap: 6px; height: 160px; }
  .sp-chart.dense .sp-lbl { font-size: 9px; }
  .sp-gift-row { flex-direction: column; }
}

/* Background music picker */
.mu-label { margin: 16px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.mu-list { display: flex; flex-direction: column; gap: 6px; }
.mu-row { display: flex; align-items: center; gap: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.mu-row.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.mu-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mu-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-dim); }
.mu-row.on .mu-ico { background: var(--accent); color: var(--accent-ink); }
.mu-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mu-text b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-text small { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-x { flex-shrink: 0; width: 34px; height: 34px; margin-right: 6px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text-dim); display: grid; place-items: center; cursor: pointer; }
.mu-yt { display: flex; gap: 8px; }
.mu-yt input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.mu-yt .btn { width: auto; flex-shrink: 0; }
.mu-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-dim); }
/* Hidden YouTube player for background music */
.bg-yt { position: fixed; left: -9999px; top: 0; width: 200px; height: 120px; border: 0; opacity: 0; pointer-events: none; }

/* Account tab: VIP, gift code and progress have their own sidebar pages on desktop (Quà tặng, Lịch sử học, Trang chủ),
   so they only show here on phones/tablets, where the dock has no such tabs. */
.acc-dup { display: contents; }
@media (min-width: 1040px) {
  .acc-dup { display: none; }
  .set-hub .set-hub-card:last-child,
  .set-hub-card:last-child:nth-child(odd) { grid-column: auto; }
}
/* Account: Đăng xuất and Thiết bị đã đăng nhập side by side; the device list opens in a sheet */
.acc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.acc-split .btn { width: 100%; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.dev-sheet { max-width: 480px; text-align: left; }
.dev-sheet .dev-card { padding-top: 4px; }
@media (max-width: 380px) { .acc-split { grid-template-columns: 1fr; } }
/* Account: a long email scrolls sideways on one line (marquee.js) instead of wrapping */
.acc-profile { min-width: 0; }
.acc-info { flex: 1; min-width: 0; }
.acc-name.mq { overflow-wrap: normal; word-break: normal; }
/* Gift code: the "Đổi mã" button is exactly as tall as the code box next to it */
.sp-gift-row { align-items: stretch; }
.sp-gift-row .btn { height: 48px; padding: 0 26px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 720px) { .sp-gift-row .btn { width: 100%; } }
.gift-row { align-items: stretch; }
.gift-row .btn { margin: 0; min-height: 0; display: inline-flex; align-items: center; justify-content: center; }
/* Settings → Tích hợp AI (Giao diện 2 bước tinh tế, hiện đại) */
.ai-setup-v2 { display: flex; flex-direction: column; gap: 14px; }

/* Stepper Bar */
.ai-stepper-bar { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--soft-line); border-radius: 18px; padding: 6px; box-shadow: 0 2px 8px -4px rgba(0,0,0,0.05); }
.ai-step-tab { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: none; background: transparent; cursor: pointer; text-align: left; transition: all .15s ease; color: var(--text-dim); }
.ai-step-tab:hover { background: var(--surface-2); color: var(--text); }
.ai-step-tab.active { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.ai-step-tab.done .ai-st-num { background: #10b981; color: #fff; }
.ai-st-num { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--text-dim); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; transition: all .15s; }
.ai-step-tab.active .ai-st-num { background: var(--accent); color: #fff; }
.ai-st-text { display: flex; flex-direction: column; min-width: 0; }
.ai-st-text b { font-size: 13.5px; font-weight: 700; color: inherit; line-height: 1.2; }
.ai-st-text small { font-size: 11.5px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-st-arrow { color: var(--text-dim); opacity: 0.5; padding: 0 4px; flex-shrink: 0; }

/* Status Pill */
.ai-status-pill { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--soft-line); background: var(--surface); gap: 10px; font-size: 13px; }
.ai-status-pill.ok { border-color: rgba(16, 185, 129, 0.3); background: color-mix(in srgb, #10b981 7%, var(--surface)); color: #065f46; }
.ai-status-pill.pending { border-color: rgba(245, 158, 11, 0.3); background: color-mix(in srgb, #f59e0b 6%, var(--surface)); color: #92400e; }
.ai-sp-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.ai-status-pill.ok .ai-sp-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.ai-status-pill.pending .ai-sp-dot { background: #f59e0b; }
.ai-sp-msg { flex: 1; min-width: 0; }
.ai-sp-chat-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 99px; border: 1px solid color-mix(in srgb, #10b981 40%, transparent); background: var(--surface); color: #059669; font: 700 12px var(--font-ui); cursor: pointer; transition: all .15s; flex-shrink: 0; }
.ai-sp-chat-btn:hover { background: #10b981; color: #fff; }

/* Card v2 */
.ai-card-v2 { padding: 20px; display: flex; flex-direction: column; gap: 16px; border-radius: 22px; }
.ai-cv2-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text); }
.ai-cv2-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-dim); }

/* Provider List */
.ai-provider-list { display: flex; flex-direction: column; gap: 8px; }
.ai-prov-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--soft-line); background: var(--surface); cursor: pointer; transition: all .15s ease; gap: 12px; }
.ai-prov-row:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--soft-line)); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); transform: translateX(2px); }
.ai-prov-row.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 30%, transparent); }
.ai-pr-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.ai-pr-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-prov-row.selected .ai-pr-icon { background: var(--surface); }
.ai-pr-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ai-pr-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-pr-title b { font-size: 14.5px; font-weight: 700; color: var(--text); }
.ai-prov-row.selected .ai-pr-title b { color: var(--accent); }
.ai-badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.ai-badge.free { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.ai-badge.ready { background: rgba(16, 185, 129, 0.15); color: #059669; }
.ai-pr-info small { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ai-pr-right { flex-shrink: 0; }
.ai-pr-radio { display: block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--soft-line); background: var(--surface); transition: all .15s; }
.ai-pr-radio.on { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }

.ai-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid var(--soft-line); }
.ai-cf-hint { font-size: 12px; color: var(--text-dim); line-height: 1.4; flex: 1; }
.ai-cf-hint b { color: var(--text); }
.ai-next-btn { width: auto; display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* Bước 2 Panel */
.ai-step2-topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--soft-line); }
.ai-back-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--text-dim); font: 700 13px var(--font-ui); cursor: pointer; padding: 4px 6px; border-radius: 8px; transition: all .12s; }
.ai-back-btn:hover { color: var(--accent); background: var(--surface-2); }
.ai-cur-prov-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text); }

.ai-quick-key-banner { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); gap: 10px; }
.ai-qkb-text { display: flex; flex-direction: column; min-width: 0; }
.ai-qkb-text b { font-size: 13px; color: var(--text); }
.ai-qkb-text small { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.ai-key-link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 12px var(--font-ui); text-decoration: none; flex-shrink: 0; transition: filter .15s; }
.ai-key-link-btn:hover { filter: brightness(1.1); }

.ai-form-body { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.ai-form-group { display: flex; flex-direction: column; gap: 6px; }
.ai-fg-label { display: flex; align-items: center; justify-content: space-between; }
.ai-form-group label, .ai-fg-label label { font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.ai-del-key { background: none; border: none; font-size: 11.5px; font-weight: 600; color: #dc2626; cursor: pointer; padding: 0; }
.ai-del-key:hover { text-decoration: underline; }

.ai-field-wrap { position: relative; display: flex; align-items: center; }
.ai-input-field { width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 13px; border: 1.5px solid var(--soft-line); background: var(--surface); color: var(--text); font: 600 14px var(--font-ui); outline: none; transition: border-color .15s; }
.ai-input-field:focus { border-color: var(--accent); }
.ai-field-wrap .ai-input-field { padding-right: 85px; }

.ai-field-tools { position: absolute; right: 5px; display: flex; align-items: center; gap: 2px; }
.ai-tool-btn { display: inline-flex; align-items: center; gap: 3px; padding: 5px 8px; border-radius: 7px; border: none; background: var(--surface-2); color: var(--text-dim); font: 600 11.5px var(--font-ui); cursor: pointer; transition: all .12s; }
.ai-tool-btn:hover { background: color-mix(in srgb, var(--text) 12%, var(--surface)); color: var(--text); }

.ai-select-wrap { position: relative; display: block; }
.ai-select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.ai-select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }

.ai-action-footer { margin-top: 6px; }
.ai-test-save-btn { width: 100%; height: 46px; font-size: 14.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 13px; }
.ai-test-save-btn.loading { opacity: 0.85; pointer-events: none; }
.ai-btn-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: aiSpin .6s linear infinite; }
@keyframes aiSpin { to { transform: rotate(360deg); } }

.ai-test-alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 16px; margin-top: 8px; animation: aiFadeIn .2s ease; }
.ai-test-alert.success { background: color-mix(in srgb, #10b981 12%, var(--surface)); border: 1px solid color-mix(in srgb, #10b981 35%, transparent); color: #065f46; }
.ai-test-alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.ai-ta-icon { flex-shrink: 0; margin-top: 2px; }
.ai-test-alert.success .ai-ta-icon { color: #10b981; }
.ai-test-alert.error .ai-ta-icon { color: #ef4444; }
.ai-ta-content { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.ai-ta-content b { display: block; font-size: 14px; margin-bottom: 3px; }
.ai-ta-content p { margin: 0; word-break: break-word; }
.ai-ta-actions { margin-top: 10px; }

.ai-privacy-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.ai-privacy-note svg { flex-shrink: 0; color: var(--text-dim); }

@media (max-width: 639px) {
  .ai-card-footer { flex-direction: column; align-items: stretch; }
  .ai-next-btn { width: 100%; justify-content: center; }
  .ai-quick-key-banner { flex-direction: column; align-items: stretch; }
  .ai-key-link-btn { justify-content: center; width: 100%; }
  .ai-field-wrap .ai-input-field { font-size: 16px; }
  .ai-select-wrap select { font-size: 16px; }
}

/* Settings > Lộ trình học (planSectionHTML in plan-setup.js): summary hero, then each level as a step on a timeline. */
.pl-card { display: flex; flex-direction: column; }
.pl-hero { padding: 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.pl-hero-top { display: flex; align-items: center; gap: 12px; }
.pl-hero-top h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.pl-hero-top p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }
.pl-hero-top .set-ico { background: var(--surface); }
.pl-mode { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 11px; border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--accent); }
.pl-route { display: flex; align-items: center; margin-top: 14px; }
.pl-route-lv { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-size: 13px; font-weight: 800; }
.pl-route-lv.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.pl-route-line { flex: 1; min-width: 6px; height: 2px; margin: 0 3px; border-radius: 1px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.pl-route-goal { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; margin-left: 6px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.pl-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); }
.pl-stats div { padding: 0 6px; text-align: center; }
.pl-stats div + div { border-left: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); }
.pl-stats b { display: block; font-family: var(--font-word); font-size: 18px; font-weight: 800; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.pl-stats span { font-size: 11.5px; color: var(--text-dim); }
.pl-sub { margin: 20px 6px 8px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.pl-legs { list-style: none; margin: 0; padding: 8px 12px; }
.pl-leg { position: relative; display: flex; gap: 12px; padding: 10px 4px 12px; }
.pl-leg:not(:last-child)::before { content: ''; position: absolute; left: 22px; top: 48px; bottom: -8px; width: 2px; border-radius: 1px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.pl-node { position: relative; flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; font-size: 14px; font-weight: 800; }
.pl-leg.on .pl-node { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.pl-leg-body { flex: 1; min-width: 0; }
.pl-leg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-leg-top b { font-size: 15.5px; font-weight: 800; }
.pl-now { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.pl-days { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.pl-leg-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12.5px; color: var(--text-dim); }
.pl-leg-meta b { color: var(--text); font-weight: 800; }
.pl-bar { height: 6px; margin-top: 9px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; }
.pl-bar i { display: block; height: 100%; min-width: 0; border-radius: 3px; background: var(--accent); }
.pl-done { margin-top: 4px; font-size: 11.5px; color: var(--text-dim); }
.pl-redo { width: 100%; margin-top: 14px; }
.pl-route-lv { position: relative; }
.pl-route-lv.extra { opacity: .55; }
.pl-route-line.extra { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 22%, transparent) 0 4px, transparent 4px 7px); }
.pl-goal-flag { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--surface); }
.pl-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-size: 11px; font-weight: 800; }
.pl-tag.goal { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.pl-lead { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text-dim); }
.pl-lead b { color: var(--text); font-weight: 800; }
.pl-lead + .pl-route { margin-top: 18px; }
.pl-redo { opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.pl-redo.show { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .pl-redo { transition: none; } }
.pl-hero-card { padding: 10px; }
.pl-hero-card .pl-hero { border-radius: calc(var(--radius) - 6px); }
/* The three plan stats only: Abril Fatface digits (index.html loads just these glyphs; one weight, already heavy),
   the theme's accent softened toward the surface so it tints with every theme. */
.pl-stats b { font-family: 'Abril Fatface', var(--font-word); font-size: 23.6px; font-weight: 400; letter-spacing: .01em; line-height: 1.1; color: color-mix(in srgb, var(--accent) 90%, var(--surface)); }
.pl-stats span { display: block; margin-top: 2px; font-weight: 600; }
.pl-done { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pl-done b { font-size: 12.5px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.set-gift { display: flex; flex-direction: column; gap: 14px; }
.set-gift .sp-banner { padding: 20px 18px; }
.set-gift .sb-img { display: none; }
.set-gift .sp-steps { grid-template-columns: 1fr; }

/* Học bằng Gợi ý từ (hints.js) */
.hint-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.hint-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; text-align: left; cursor: pointer; font: inherit; color: var(--text); border: 1px solid var(--soft-line); }
.hint-choice:hover { border-color: var(--accent); }
.hint-choice b { font-size: 17px; }
.hint-choice p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.hint-nav { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 14px; font-weight: 600; }
.hint-word .hw-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint-word h2 { margin: 0; font-family: var(--font-word); font-size: 30px; color: var(--text); }
.hint-say { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px; display: inline-flex; }
.hw-ipa { margin-top: 4px; color: var(--text-dim); font-size: 15px; }
.hw-vi { margin-top: 10px; font-size: 18px; font-weight: 700; color: var(--accent); }
.hw-ex { margin-top: 8px; font-style: italic; color: var(--text-dim); line-height: 1.5; }
.hint-boxes { display: flex; flex-direction: column; gap: 10px; }
.hint-box { display: flex; gap: 10px; align-items: flex-start; }
.hint-box > span { flex: none; width: 26px; height: 26px; margin-top: 8px; border-radius: 50%; background: var(--surface-2); color: var(--text-dim); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.hint-box textarea, .hint-answer input { flex: 1; width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--soft-line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.hint-box textarea:focus, .hint-answer input:focus { outline: none; border-color: var(--accent); }
.hint-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.hint-saved { color: var(--text-dim); font-size: 13px; }
.hint-step { display: flex; align-items: center; gap: 8px; margin-left: auto; font-variant-numeric: tabular-nums; }
.hint-step .btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
.hint-step .btn:disabled { opacity: .4; }
.hint-pager { display: flex; justify-content: space-between; gap: 12px; }
.hint-list { margin: 14px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; color: var(--text); }
.hint-answer { display: flex; gap: 10px; }
.hint-result { margin-top: 12px; padding: 12px 14px; border-radius: 12px; line-height: 1.5; }
.hint-result.ok { background: color-mix(in srgb, #2fb36b 14%, transparent); }
.hint-result.ok b { color: #2fb36b; }
.hint-result.bad { background: color-mix(in srgb, #e5484d 12%, transparent); }
.hint-result.bad b { color: #e5484d; }
.hint-skip { margin-top: 10px; }
.hint-done { text-align: center; }
.hint-done .hint-pager { justify-content: center; margin-top: 12px; }
.hint-share { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border: 1px solid var(--soft-line); }
.hint-share input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint-share span { display: flex; flex-direction: column; gap: 2px; }
.hint-share small { color: var(--text-dim); font-size: 13px; }
.hint-packs { display: flex; flex-direction: column; gap: 8px; }
.hint-pack { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--soft-line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hint-pack:hover:not(:disabled) { border-color: var(--accent); }
.hint-pack:disabled { opacity: .55; cursor: default; }
.hint-pack .hp-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hint-pack small { color: var(--text-dim); font-size: 13px; }
.hint-pack em { font-style: normal; font-weight: 700; color: var(--accent); }
.hb-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.hb-warn { display: none; color: #e5484d; font-size: 12.5px; }
.hint-box.bad textarea { border-color: #e5484d; }
.hint-box.bad .hb-warn { display: block; }
.hint-box .hint-say { margin-top: 6px; }
.hint-list li > span { margin-right: 4px; }
.hint-list .hint-say { vertical-align: middle; padding: 2px; }
.hint-en { color: var(--accent); }
.hint-read-all { margin-top: 12px; }
.vn-card .vn-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.vn-card input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.vn-card select { flex: 1; max-width: 340px; padding: 8px 10px; border: 1px solid var(--soft-line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.vn-bar { height: 6px; margin-top: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.vn-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.vn-status { display: block; margin-top: 10px; color: var(--text-dim); font-size: 13px; }
.hint-answer input { min-width: 0; border-color: var(--line); }
.hint-answer .btn { width: auto; flex: none; padding-left: 26px; padding-right: 26px; }
.hint-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.hint-tools .hint-known { width: auto; margin-left: auto; }
.hint-show-known { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--text-dim); cursor: pointer; }
.hint-show-known input { width: 16px; height: 16px; accent-color: var(--accent); }
.hint-miss { display: block; min-height: 18px; margin-top: 8px; color: #e5484d; font-size: 13.5px; }
.hint-tools .hint-giveup { width: auto; }
.hint-mine { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.hint-mine .hint-list { margin-top: 8px; }
.hint-answer input.shake { animation: hint-shake .35s; border-color: #e5484d; }
@keyframes hint-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.hint-count { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; visibility: hidden; }
.hint-count.on { visibility: visible; }
.hint-count.pop { animation: hint-pop .45s ease; }
@keyframes hint-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.hint-list li { border-radius: 10px; padding: 2px 6px; margin-left: -6px; transition: background .2s; }
.hint-list li.reading, .hint-ask.reading { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.hint-ask { margin: 0 0 12px; padding: 6px 8px; border-radius: 10px; font-size: 17px; color: var(--text); transition: background .2s; }
.hint-ask b { color: var(--accent); }
.hint-pack-wrap { display: flex; flex-direction: column; gap: 2px; }
.hint-restart { align-self: flex-end; font-size: 13px; padding: 2px 6px; }
.hint-answer-card.pending { display: none; }
.hint-answer-card { animation: hint-in .35s ease; }
@keyframes hint-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hint-answer .btn.wait { visibility: hidden; }
/* Học gợi ý — polish: "Lần n" badge floats in the word card (no empty gap), clearer answer box, softer retry note */
.hint-page .set-card:has(> .hint-count) { position: relative; }
.hint-count { position: absolute; top: 16px; right: 16px; margin: 0; }
.hint-word + .hint-count + .hint-list, .hint-page .hint-list { margin-top: 12px; }
.hint-answer { align-items: stretch; }
.hint-answer input { min-height: 48px; padding: 0 14px; background: var(--surface-2); border: 1.5px solid var(--line); font-size: 16px; }
.hint-answer input:disabled { opacity: .75; }
.hint-answer .btn { min-height: 48px; }
.hint-miss:empty { display: none; }
.hint-miss { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #e5484d 9%, transparent); color: var(--text); font-size: 14.5px; line-height: 1.5; }
.hint-miss b { color: #e5484d; }
.hint-miss-left { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.hint-tools { flex-wrap: wrap; }
@media (max-width: 560px) {
  .hint-word h2 { font-size: 26px; }
  .hint-ask { font-size: 16px; }
  .hint-answer .btn { padding-left: 18px; padding-right: 18px; }
  .hint-tools .btn { flex: 1 1 auto; }
}

/* Nạp siêu tốc (rapid.js) */
.rapid-card { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.rapid-ctrl { display: flex; justify-content: center; align-items: center; gap: 14px; }
.rapid-ctrl .rapid-play { flex: 0 0 auto; width: auto; min-width: 150px; padding: 10px 22px; }
.rapid-nav { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--soft-line); background: var(--surface); color: var(--text); cursor: pointer; }
.rapid-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.rapid-nav:disabled { opacity: .4; cursor: default; }
.rapid-set { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; align-items: center; font-size: 14px; color: var(--text-dim); }
.rapid-set input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.rapid-set label { display: flex; align-items: center; gap: 8px; }
