/* Bổ sung cho Tabler – giữ ít, thống nhất. */
:root { --ok: #2fb344; --bad: #d63939; --warn: #f59f00; --info: #4263eb; }
body { font-size: 14px; }
.brand-mark { background: #1f5fa8; color: #fff; font-weight: 800; border-radius: 6px; padding: 2px 7px; margin-right: 6px; font-size: 13px; }
.brand-logo { height: 22px; width: auto; margin-right: 10px; }
code { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--tblr-font-monospace); font-size: 12.5px; }
.truncate { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi { font-size: 28px; font-weight: 700; line-height: 1.1; }

/* ─── Người học ─── */
.problem-table td { vertical-align: middle; }
.problem-table .st { width: 28px; text-align: center; font-weight: 700; }
.st-pass { color: var(--ok); } .st-try { color: var(--bad); }
.statement { white-space: pre-wrap; font-size: 15px; line-height: 1.6; }
.timer-box { font-family: var(--tblr-font-monospace); font-size: 28px; font-weight: 700; letter-spacing: 1px; }
.timer-box.soon { color: var(--warn); } .timer-box.late { color: var(--bad); }
.sticky-side { position: sticky; top: 72px; }
.q-card .form-check { padding: 8px 12px 8px 36px; border: 1px solid var(--tblr-border-color); border-radius: 6px; margin-bottom: 6px; }
.q-card .form-check.correct { border-color: var(--ok); background: rgba(47,179,68,.08); }
.q-card .form-check.wrong { border-color: var(--bad); background: rgba(214,57,57,.07); }
.q-card img.q-img { max-width: 100%; max-height: 420px; border: 1px solid var(--tblr-border-color); border-radius: 6px; margin: 8px 0; }
.level-step { border-left: 4px solid var(--tblr-border-color); }
.level-step.DONE { border-left-color: var(--ok); } .level-step.READY { border-left-color: #ae3ec9; }
.level-step.PRACTICE { border-left-color: var(--info); } .level-step.WAIT_CONFIRM { border-left-color: var(--warn); }
.heat { text-align: center; font-weight: 600; }
.result { border: 1px solid var(--tblr-border-color); border-left: 4px solid var(--bad); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; background: #fff; }
.result.ok { border-left-color: var(--ok); }

/* ─── Bảng so sánh kết quả: cột Đáp án ẩn mặc định ─── */
.cmp td.ans .val { display: none; }
.cmp td.ans .mask { display: inline; letter-spacing: 2px; }
.cmp.show-ans td.ans .val { display: inline; }
.cmp.show-ans td.ans .mask { display: none; }
.cmp .ans-toggle .i-eye { display: none; }
.cmp.show-ans .ans-toggle .i-eye { display: inline; }
.cmp.show-ans .ans-toggle .i-eye-off { display: none; }
.cmp td.ans { color: #1f7a30; }

/* ─── Lịch chọn ngày (flatpickr) theo màu Tabler ─── */
.flatpickr-calendar { font-family: inherit; box-shadow: 0 10px 30px rgba(15,23,42,.15); border: 1px solid var(--tblr-border-color); border-radius: 10px; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--tblr-primary); border-color: var(--tblr-primary); }
.flatpickr-day.today { border-color: var(--tblr-primary); }
.flatpickr-current-month { font-size: 15px; }
.flatpickr-weekday { color: var(--tblr-secondary); font-weight: 600; }
.flatpickr-input.form-control[readonly] { background-color: #fff; cursor: pointer; }

/* ═══ Giao diện học viên (bản mới) ═══════════════════════════════════════════
   Một font (Plus Jakarta Sans), nền xám nhạt, thẻ trắng bo 20px.
   Chữ/số được bao: hoặc tròn hẳn (pill, vòng tròn) hoặc vuông – không bo theo chữ. */
body:not(.adm-body) {
  --ux-ink: #101828; --ux-text: #344054; --ux-muted: #475467; --ux-faint: #667085; --ux-line: #E4E7EC; --ux-line-2: #EAECF0;
  --ux-ground: #F6F7F9; --ux-fill: #EAECF0; --ux-soft: #F2F4F7;
  --ux-pri: #1F5FA8; --ux-pri-d: #174A84; --ux-pri-soft: #EAF1FB; --ux-ring: #B8CDEB;
  --ux-ok: #067647; --ux-ok-soft: #ECFDF3; --ux-warn: #B54708; --ux-warn-dot: #DC6803; --ux-warn-soft: #FFFAEB;
  --ux-bad: #B42318; --ux-bad-soft: #FEF3F2;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--ux-ground); color: var(--ux-ink);
}
body:not(.adm-body) .page, body:not(.adm-body) .page-wrapper { background: transparent; }

/* Thanh trên cùng */
.ux-nav { background: #fff; border-bottom: 1px solid var(--ux-line); min-height: 64px; }
.ux-brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; color: var(--ux-ink); }
.ux-brand:hover { text-decoration: none; color: var(--ux-ink); }
.ux-brand img { height: 28px; width: auto; }
.ux-brand-lg { display: flex; justify-content: center; font-size: 24px; }
.ux-brand-lg img { height: 36px; }
.ux-nav .navbar-nav .nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ux-muted); }
.ux-nav .navbar-nav .nav-link:hover { color: var(--ux-ink); background: var(--ux-soft); }
.ux-nav .navbar-nav .nav-item.active .nav-link { background: var(--ux-pri-soft); color: var(--ux-pri-d); }
.ux-nav .nav-item.active::after, .ux-nav .nav-item.active:after { display: none !important; }
.ux-nav .dropdown > .nav-link, .ux-nav .dropdown > .nav-link:hover { background: transparent; min-height: 0; border-radius: 0; }
.ux-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #E04F16; color: #fff;
  font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.ux-avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--ux-soft); color: var(--ux-text); font-weight: 800; }

/* Khung nội dung */
.ux { font-size: 16px; line-height: 1.5; display: flex; flex-direction: column; gap: 24px; padding-bottom: 48px; }
.ux-h1 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.ux-card { background: #fff; border: 1px solid var(--ux-line); border-radius: 20px; padding: 40px 48px; }
.ux-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; background: var(--ux-soft); color: var(--ux-text); white-space: nowrap; }
.ux-pill.pri { background: var(--ux-pri-soft); color: var(--ux-pri-d); }
.ux-pill.ok { background: var(--ux-ok-soft); color: var(--ux-ok); }
.ux-pill.warn { background: var(--ux-warn-soft); color: var(--ux-warn); }
.ux-pill.bad { background: var(--ux-bad-soft); color: var(--ux-bad); }
.ux-ic { flex: none; width: 48px; height: 48px; border-radius: 999px; background: var(--ux-soft); color: var(--ux-text);
  display: inline-flex; align-items: center; justify-content: center; }
.ux-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid #D0D5DD; background: #fff; color: var(--ux-ink); font-size: 15px; font-weight: 600; }
.ux-btn:hover { background: var(--ux-ground); color: var(--ux-ink); text-decoration: none; }
.ux-btn.pri { background: var(--ux-pri); border-color: var(--ux-pri); color: #fff; }
.ux-btn.pri:hover { background: var(--ux-pri-d); border-color: var(--ux-pri-d); color: #fff; }
.ux-link { font-size: 14px; font-weight: 600; color: var(--ux-pri); padding: 0 6px; }
.ux a:focus-visible, .ux button:focus-visible, .ux select:focus-visible, .ux input:focus-visible { outline: 3px solid var(--ux-ring); outline-offset: 2px; }

/* Thẻ tóm tắt + số lớn (gọn để nhường chỗ cho danh sách) */
.ux-card.ux-hero { padding: 24px 32px; }
.ux-hero { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: stretch; }
.ux-hero-main { flex: 0 1 340px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.ux-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ux-figure b { font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.ux-figure span { font-size: 17px; font-weight: 600; color: var(--ux-muted); }
.ux-facts { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 15px; color: var(--ux-muted); }
.ux-facts b { color: var(--ux-ink); }

/* Tiêu đề nhỏ + dòng chú thích đổi theo chuột: cao/rộng cố định → đổi chữ không làm xô lệch biểu đồ */
.ux-side-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ux-side-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.ux-tip { min-height: 20px; font-size: 13px; color: var(--ux-muted); overflow-wrap: anywhere; }

/* Biểu đồ đường: số bài đã làm gần đây */
.ux-line { flex: 1 1 240px; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.ux-line .ux-tip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ux-line-plot { position: relative; flex: 1 1 auto; min-height: 96px; padding-left: 22px; }
.ux-line-y { position: absolute; left: 0; font-size: 11px; font-weight: 600; color: var(--ux-faint); line-height: 1; }
.ux-line-y.top { top: 0; } .ux-line-y.zero { bottom: 0; }
.ux-line-area { position: absolute; inset: 5px 0 5px 22px; border-bottom: 1px solid var(--ux-line); }
.ux-line-area::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--ux-line-2); }
.ux-line-area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ux-line-area .area { fill: var(--ux-pri); opacity: .1; }
.ux-line-area .stroke { fill: none; stroke: var(--ux-pri); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ux-line-hit { position: absolute; top: 0; bottom: 0; transform: translateX(-50%); cursor: default; }
.ux-line-hit:hover { background: linear-gradient(var(--ux-line), var(--ux-line)) center / 1px 100% no-repeat; }
.ux-line-hit i { position: absolute; left: 50%; width: 10px; height: 10px; transform: translate(-50%, -50%);
  border-radius: 999px; background: var(--ux-pri); box-shadow: 0 0 0 2px #fff; opacity: 0; }
.ux-line-hit i.end, .ux-line-hit:hover i { opacity: 1; }

/* Lịch hoạt động kiểu GitHub: lưới chiếm trọn chiều cao, chữ nằm bên cạnh */
.ux-heat { flex: none; display: flex; gap: 16px; align-items: stretch; }
.ux-heat-side { width: 150px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.ux-heat-side .ux-tip { min-height: 40px; }
.ux-heat-grid { display: flex; gap: 6px; }
.ux-heat-days { display: flex; flex-direction: column; gap: 3px; padding-top: 17px; }
.ux-heat-days span { width: 22px; height: 18px; line-height: 18px; font-size: 11px; font-weight: 600; color: var(--ux-faint); }
.ux-heat-weeks { display: flex; gap: 3px; }
.ux-heat-col { display: flex; flex-direction: column; gap: 3px; width: 18px; }
.ux-heat-col .m { height: 14px; line-height: 14px; font-size: 11px; font-weight: 600; color: var(--ux-muted); white-space: nowrap; }
.ux-cell { display: block; width: 18px; height: 18px; border-radius: 4px; background: #EEF1F5; }
.ux-cell.l1 { background: #9DB9E0; } .ux-cell.l2 { background: #6A95CF; }
.ux-cell.l3 { background: #3D72B8; } .ux-cell.l4 { background: #1A4E8C; }
.ux-cell.out { background: transparent; }
.ux-cell.future { background: transparent; box-shadow: inset 0 0 0 1px var(--ux-line); }
.ux-cell.today { box-shadow: inset 0 0 0 2px var(--ux-ink); }
.ux-heat-weeks .ux-cell[data-tip]:hover { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px var(--ux-ink); }
.ux-heat-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--ux-faint); }
.ux-heat-legend .ux-cell { width: 11px; height: 11px; border-radius: 3px; }

/* Tìm kiếm & lọc – 1 dòng, cùng kiểu với thanh chọn level */
.ux-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.ux-seg { flex: none; display: inline-flex; background: var(--ux-fill); border-radius: 10px; padding: 4px; gap: 2px; }
.ux-seg label { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; margin: 0; border-radius: 7px;
  font-size: 14px; font-weight: 600; color: var(--ux-muted); cursor: pointer; user-select: none; }
.ux-seg label:hover { color: var(--ux-ink); }
.ux-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ux-seg label:has(input:checked) { background: #fff; color: var(--ux-pri); font-weight: 700; box-shadow: 0 1px 2px rgba(16,24,40,.12), 0 1px 3px rgba(16,24,40,.08); }
.ux-seg label:has(input:focus-visible) { outline: 3px solid var(--ux-ring); outline-offset: 1px; }
.ux-search { position: relative; flex: 1 1 220px; min-width: 180px; margin: 0; }
.ux-search .ico { position: absolute; left: 14px; top: 13px; color: var(--ux-faint); pointer-events: none; }
.ux-search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 0; border-radius: 10px; background: var(--ux-fill); font: inherit; font-size: 14px; color: var(--ux-ink); }
.ux-search input:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ux-pri); }
.ux-select { position: relative; flex: none; margin: 0; }
.ux-select select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 36px 0 14px; border: 0; border-radius: 10px;
  background: var(--ux-fill); font: inherit; font-size: 14px; font-weight: 600; color: var(--ux-text); cursor: pointer; }
.ux-select .ico { position: absolute; right: 12px; top: 14px; pointer-events: none; color: var(--ux-muted); }
/* đang lọc → viền xanh (tính bằng CSS nên đúng cả khi đổi lọc không tải lại trang) */
.ux-select:not(:has(option[value=""]:checked)) select, .ux-toggle:has(input:checked) {
  background: #fff; color: var(--ux-pri); box-shadow: inset 0 0 0 1.5px var(--ux-pri); }
.ux-results { transition: opacity .15s; }
.ux-results.htmx-request { opacity: .55; }
.ux-results-bar { display: flex; align-items: center; gap: 12px; margin: 0 4px 12px; font-size: 14px; color: var(--ux-muted); }
.ux-toggle { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin: 0; border-radius: 10px;
  background: var(--ux-fill); font-size: 14px; font-weight: 600; color: var(--ux-text); cursor: pointer; user-select: none; }
.ux-toggle input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--ux-pri); }

/* Danh sách bài */
.ux-list { background: #fff; border: 1px solid var(--ux-line); border-radius: 20px; padding: 8px 32px 16px; }
.ux-group { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 24px 16px 8px; }
.ux-group h2 { margin: 0; font-size: 19px; font-weight: 800; }
.ux-group span { font-size: 14px; color: var(--ux-muted); }
.ux-group b { color: var(--ux-ink); }
/* Tiêu đề phụ trong 1 level: gom bài theo phân hệ SAP */
.ux-subgroup { display: flex; align-items: center; gap: 8px; padding: 14px 16px 4px; font-size: 13px; font-weight: 700;
  color: var(--ux-muted); text-transform: uppercase; letter-spacing: .03em; }
.ux-subgroup .code { padding: 1px 7px; border-radius: 6px; background: #EEF2F7; color: var(--ux-ink); letter-spacing: 0; }
.ux-row { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 16px; color: var(--ux-ink); }
.ux-row:hover { background: #F9FAFB; color: var(--ux-ink); text-decoration: none; }
.ux-row:hover .ux-row-title { color: var(--ux-pri); }
.ux-row-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ux-row-title { font-size: 17px; font-weight: 700; }
.ux-row-meta { font-size: 14px; color: var(--ux-muted); }
.ux-row .chev { flex: none; color: #98A2B3; display: inline-flex; }
.ux-status { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 8px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.ux-status .dot { width: 22px; height: 22px; border-radius: 999px; box-sizing: border-box; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ux-status .dot .ico { vertical-align: 0; stroke-width: 3; }
.ux-status.pass { background: var(--ux-ok-soft); color: var(--ux-ok); }
.ux-status.pass .dot { background: var(--ux-ok); }
.ux-status.try { background: var(--ux-warn-soft); color: var(--ux-warn); }
.ux-status.try .dot { background: var(--ux-warn-dot); }
.ux-status.none { background: var(--ux-soft); color: var(--ux-muted); }
.ux-status.none .dot { border: 1.5px dashed #98A2B3; }
.ux-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 56px 24px; }

/* Nút tròn chứa icon, nút cỡ lớn, chữ phụ */
.ux-round { flex: none; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--ux-line); background: #fff; color: var(--ux-text);
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0; cursor: pointer; }
.ux-round.soft { border-color: transparent; background: var(--ux-soft); cursor: default; }
.ux-round.pri { border-color: transparent; background: var(--ux-pri-soft); color: var(--ux-pri-d); cursor: default; }
.ux-round.lg { width: 48px; height: 48px; }
.ux-round:is(button, a):hover { background: var(--ux-ground); }
.ux-btn.lg { min-height: 56px; padding: 0 32px; font-size: 16px; }
.ux-muted { color: var(--ux-muted); }
.ux-meta { font-size: 15px; color: var(--ux-muted); }
.ux-pill-ic { width: 22px; height: 22px; margin-left: -8px; border-radius: 999px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ux-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--ux-muted); }
.ux-back:hover { color: var(--ux-ink); text-decoration: none; }
.ux-back .ux-round { width: 36px; height: 36px; }

/* Trang đề bài */
.ux-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ux-problem { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.ux-problem-head { display: flex; flex-direction: column; gap: 8px; }
.ux-problem .ux-h1 { font-size: 32px; line-height: 1.25; }
.ux-stats { display: flex; flex-wrap: wrap; gap: 20px 56px; }
.ux-stats > div { display: flex; flex-direction: column; }
.ux-stats span { font-size: 14px; color: var(--ux-muted); }
.ux-stats b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.ux-note { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ux-muted); }
.ux-note b { color: var(--ux-ink); }
.ux-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 28px; border-top: 1px solid var(--ux-line-2); }
.ux-attempts { flex: 1 1 300px; min-width: 0; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.ux-attempts-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 8px 8px; }
.ux-attempts-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.ux-attempts-head span { font-size: 14px; color: var(--ux-muted); } .ux-attempts-head b { color: var(--ux-ink); }
.ux-att { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 16px; color: var(--ux-ink); }
.ux-att:hover { background: #F9FAFB; color: var(--ux-ink); text-decoration: none; }
.ux-att-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ux-att-body b { font-size: 15px; font-weight: 700; }
.ux-att-body span { font-size: 13px; color: var(--ux-muted); }
.ux-att-pct { flex: none; font-size: 17px; font-weight: 800; }
.ux-att-pct.ok { color: var(--ux-ok); } .ux-att-pct.warn { color: var(--ux-warn); } .ux-att-pct.bad { color: var(--ux-bad); }
.ux-att-pct.none { font-size: 13px; font-weight: 600; color: var(--ux-faint); }
.ux-att-empty { padding: 8px; }

/* Hộp chọn cách làm bài */
.ux-modal .modal-content { border: 0; border-radius: 24px; padding: 32px; gap: 20px; box-shadow: 0 24px 48px -12px rgba(16,24,40,.25); font-size: 16px; }
.ux-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ux-modal-head h2 { margin: 0; font-size: 24px; font-weight: 800; }
.ux-choices { display: flex; flex-direction: column; gap: 12px; }
.ux-choice { display: flex; align-items: center; gap: 16px; margin: 0; padding: 16px 20px; border-radius: 20px; border: 1.5px solid var(--ux-line); cursor: pointer; }
.ux-choice:hover { border-color: #98A2B3; }
.ux-choice > input, .ux-chip > input[type=radio] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ux-choice .ux-round { border-color: transparent; background: var(--ux-soft); cursor: pointer; }
.ux-choice-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ux-choice-body b { font-size: 17px; font-weight: 800; }
.ux-choice-body span { font-size: 14px; color: var(--ux-muted); }
.ux-radio { flex: none; width: 24px; height: 24px; border-radius: 999px; border: 1.5px solid #D0D5DD; box-sizing: border-box; background: #fff; }
.ux-choice:has(input:checked) { border-color: var(--ux-pri); background: var(--ux-pri-soft); }
.ux-choice:has(input:checked) .ux-round { background: var(--ux-pri); color: #fff; }
.ux-choice:has(input:checked) .ux-radio { border: 7px solid var(--ux-pri); }
.ux-choice:has(input:focus-visible), .ux-chip:has(input:focus-visible) { outline: 3px solid var(--ux-ring); outline-offset: 2px; }
.ux-mins { display: none; flex-direction: column; gap: 10px; }
.ux-modal form:has(input[name=timed][value="1"]:checked) .ux-mins { display: flex; }
.ux-mins-title { font-size: 14px; font-weight: 700; color: var(--ux-text); }
.ux-mins-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ux-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; margin: 0; border-radius: 999px;
  border: 1.5px solid #D0D5DD; font-size: 15px; font-weight: 700; color: var(--ux-text); cursor: pointer; box-sizing: border-box; }
.ux-chip:has(input[type=radio]:checked) { border-color: var(--ux-pri); background: var(--ux-pri); color: #fff; }
.ux-chip-input { font-weight: 600; color: var(--ux-muted); cursor: text; }
.ux-chip-input input { width: 52px; border: 0; outline: none; background: transparent; font: inherit; font-weight: 700; color: var(--ux-ink); text-align: right; }
.ux-chip-input:has(input:not(:placeholder-shown):valid), .ux-chip-input:focus-within { border-color: var(--ux-pri); }
.ux-modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.ux-modal .ux-btn:focus-visible, .ux-modal .ux-round:focus-visible { outline: 3px solid var(--ux-ring); outline-offset: 2px; }

/* ─── Màn làm bài ─────────────────────────────────────────────────────────── */
.ux-bar { background: #fff; border-bottom: 1px solid var(--ux-line); z-index: 1020; }
.ux-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.ux-bar-in .ux-round { width: 44px; height: 44px; }
.ux-bar-title { flex: 1 1 240px; min-width: 0; }
.ux-bar-title .eyebrow { font-size: 13px; font-weight: 600; color: var(--ux-pri); }
.ux-bar-title .t { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ux-bar-progress { flex: 0 1 200px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ux-muted); }
.ux-bar-progress > div { display: flex; justify-content: space-between; } .ux-bar-progress b { color: var(--ux-ink); }
.ux-bar-track { height: 6px; border-radius: 99px; background: var(--ux-line-2); overflow: hidden; }
.ux-bar-track i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ux-pri); transition: width .2s; }
.ux-timer { display: inline-flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ux-ink); }
.ux-timer:has(.soon) { color: var(--ux-warn); }
.ux-timer:has(.late) { color: var(--ux-bad); }
.ux-attempt { padding-top: 8px; }
.ux-statement { white-space: pre-wrap; font-size: 18px; line-height: 1.7; color: var(--ux-text); }
.ux-statement.sm { font-size: 15px; line-height: 1.6; color: var(--ux-muted); padding-bottom: 8px; }
.ux-start { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 56px 24px; }
.ux-pill-dot { width: 22px; height: 22px; margin-left: -8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--ux-muted); }
.ux-pill.ok .ux-pill-dot { background: var(--ux-ok); } .ux-pill.bad .ux-pill-dot { background: var(--ux-bad); }
.ux-pill-dot .ico { stroke-width: 3; }
/* Thông báo sau khi nộp / lỗi – cùng kiểu thẻ bo tròn */
body:not(.adm-body) .page-body .alert { border: 0; border-radius: 16px; padding: 14px 48px 14px 20px; font-size: 15px; font-weight: 600; box-shadow: none; }
body:not(.adm-body) .page-body .alert-success { background: var(--ux-ok-soft); color: var(--ux-ok); }
body:not(.adm-body) .page-body .alert-danger { background: var(--ux-bad-soft); color: var(--ux-bad); }
body:not(.adm-body) .page-body .alert-warning { background: var(--ux-warn-soft); color: var(--ux-warn); }
body:not(.adm-body) .page-body .alert-info { background: var(--ux-pri-soft); color: var(--ux-pri-d); }

/* Câu hỏi */
.ux-quiz { align-items: flex-start; }
.ux-quiz-main { flex: 999 1 600px; min-width: 0; padding: 16px 48px 32px; display: flex; flex-direction: column; }
.ux-q { display: flex; flex-direction: column; gap: 18px; padding: 28px 0; border-top: 1px solid var(--ux-line-2); scroll-margin-top: 96px; }
.ux-quiz-main > .ux-q:first-of-type, .ux-quiz-main > .ux-statement + .ux-q { border-top: 0; }
.ux-quiz[data-view=card] .ux-q:not(.is-current) { display: none; }
.ux-quiz[data-view=card] .ux-q { border-top: 0; }
.ux-quiz[data-view=card] .ux-q-title h2 { font-size: 28px; line-height: 1.35; }
.ux-quiz[data-view=card] .ux-qnum { width: 52px; height: 52px; font-size: 22px; background: var(--ux-pri); color: #fff; border-color: var(--ux-pri); }
.ux-q-head { display: flex; align-items: flex-start; gap: 16px; }
.ux-qnum { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid #D0D5DD; background: #fff; color: var(--ux-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; box-sizing: border-box; }
.ux-qnum.ok { background: var(--ux-ok); border-color: var(--ux-ok); color: #fff; }
.ux-qnum.bad { background: var(--ux-bad); border-color: var(--ux-bad); color: #fff; }
.ux-q-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.ux-q-title h2 { margin: 0; font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: -.01em; white-space: pre-wrap; }
.ux-meta.bad { color: var(--ux-bad); font-weight: 700; }
.ux-flag { width: 44px; height: 44px; color: var(--ux-muted); }
.ux-q.flag .ux-flag { border-color: #FDB022; background: var(--ux-warn-soft); color: var(--ux-warn-dot); }
.ux-q.flag .ux-flag .ico { fill: currentColor; }
.ux-q-img { max-width: 100%; max-height: 420px; border-radius: 16px; border: 1px solid var(--ux-line); align-self: flex-start; }
/* Phương án xếp dọc; quá 5 phương án mới chia cột đều (VD 6 → 2 cột 3-3), đọc theo cột A→E rồi F… */
.ux-opts { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), auto);
  grid-auto-flow: column; gap: 10px; padding-left: 60px; max-width: calc(640px * var(--cols, 1) + 60px); }
.ux-quiz[data-view=card] .ux-opts { padding-left: 0; gap: 12px; max-width: none; }
.ux-opt { position: relative; display: flex; align-items: center; gap: 14px; min-height: 56px; margin: 0; padding: 8px 20px 8px 10px; border-radius: 28px;
  border: 1.5px solid var(--ux-line); background: #fff; font-size: 16px; font-weight: 500; cursor: pointer; transition: border-color .12s, background .12s; }
.ux-quiz[data-view=card] .ux-opt { min-height: 64px; border-radius: 32px; font-size: 18px; }
.ux-opt:not(.static):hover { border-color: #98A2B3; }
.ux-opt > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ux-letter { flex: none; width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid #D0D5DD; background: #fff; color: var(--ux-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; box-sizing: border-box; }
.ux-opt-text { flex: 1 1 auto; min-width: 0; }
.ux-opt:has(input:checked) { border-color: var(--ux-pri); background: var(--ux-pri-soft); font-weight: 600; }
.ux-opt:has(input:checked) .ux-letter { background: var(--ux-pri); border-color: var(--ux-pri); color: #fff; }
.ux-opt:has(input:focus-visible) { outline: 3px solid var(--ux-ring); outline-offset: 2px; }
.ux-opt.static { cursor: default; }
.ux-opt.ok { border-color: #47CD89; background: var(--ux-ok-soft); font-weight: 600; }
.ux-opt.ok .ux-letter { background: var(--ux-ok); border-color: var(--ux-ok); color: #fff; }
.ux-opt.bad { border-color: #FDA29B; background: var(--ux-bad-soft); font-weight: 600; }
.ux-opt.bad .ux-letter { background: var(--ux-bad); border-color: var(--ux-bad); color: #fff; }
.ux-opt-tag { flex: none; font-size: 13px; font-weight: 700; color: var(--ux-ok); }
.ux-input { display: block; width: 100%; max-width: 440px; height: 52px; padding: 0 24px; border-radius: 999px; border: 1.5px solid #D0D5DD;
  background: #fff; font: inherit; font-size: 17px; font-weight: 600; color: var(--ux-ink); box-sizing: border-box; }
.ux-input:focus { outline: none; border-color: var(--ux-pri); box-shadow: 0 0 0 3px var(--ux-ring); }
.ux-input.area { height: auto; min-height: 52px; padding: 14px 22px; border-radius: 26px; font-size: 15px; font-weight: 500; resize: vertical; }
.ux-q .ux-input { margin-left: 60px; max-width: 420px; width: calc(100% - 60px); }
.ux-quiz[data-view=card] .ux-q .ux-input { margin-left: 0; width: 100%; height: 64px; font-size: 20px; }
.ux-q-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--ux-line-2); }
.ux-q-foot [hidden] { display: none !important; }
.ux-q-foot [data-last] { margin-left: auto; }
.ux-btn[disabled] { opacity: .4; cursor: default; }
.ux-btn .ico { margin: 0; }

/* Cột danh sách câu */
.ux-qside { flex: 1 1 260px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 92px; }
.ux-qside h2 { margin: 0; font-size: 15px; font-weight: 700; }
.ux-seg.wide { display: flex; }
.ux-seg.wide label { flex: 1 1 0; justify-content: center; gap: 6px; padding: 0 10px; white-space: nowrap; }
.ux-qnav { display: flex; flex-wrap: wrap; gap: 10px; }
.ux-qbtn { position: relative; width: 46px; height: 46px; border-radius: 999px; border: 1.5px solid #D0D5DD; background: #fff; color: var(--ux-text);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; padding: 0; }
.ux-qbtn:hover { border-color: #98A2B3; }
.ux-qbtn.done { background: var(--ux-pri); border-color: var(--ux-pri); color: #fff; }
.ux-qbtn.cur { box-shadow: 0 0 0 4px #CFDDF0; border-color: var(--ux-pri); }
.ux-qbtn.flag::after { content: ""; position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 999px; background: var(--ux-warn-dot); border: 2px solid #fff; box-sizing: border-box; }
.ux-qbtn.warn { border-color: #FEC84B; background: var(--ux-warn-soft); color: var(--ux-warn); width: 44px; height: 44px; }
.ux-qbtn:focus-visible { outline: 3px solid var(--ux-ring); outline-offset: 2px; }
.ux-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ux-muted); }
.ux-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ux-legend i { width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid #D0D5DD; box-sizing: border-box; }
.ux-legend i.done { background: var(--ux-pri); border-color: var(--ux-pri); }
.ux-legend i.flag { background: var(--ux-warn-dot); border-color: var(--ux-warn-dot); }
.ux-cf-stats { display: flex; gap: 32px; }
.ux-cf-stats > div > span { display: block; font-size: 14px; color: var(--ux-muted); }
.ux-cf-stats b { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ux-cf-missing { display: flex; flex-direction: column; gap: 10px; }
.ux-cf-missing .t { font-size: 14px; font-weight: 700; color: var(--ux-warn); }
.ux-cf-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* Kết quả trắc nghiệm */
.ux-cols-chart { min-width: 260px; }
.ux-cols { position: relative; display: flex; gap: 12px; height: 150px; padding-bottom: 26px; border-bottom: 0; }
.ux-cols::before { content: ""; position: absolute; left: 0; right: 0; bottom: 26px; border-top: 1px solid var(--ux-line); }
.ux-cols-pass { position: absolute; left: 0; right: 0; bottom: calc(26px + (100% - 26px) * var(--p, .7)); border-top: 1.5px dashed var(--ux-text); z-index: 1; pointer-events: none; }
.ux-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ux-col .bar-wrap { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.ux-col .bar { position: relative; display: block; width: 24px; border-radius: 4px 4px 0 0; background: #C7D7EE; }
.ux-col.cur .bar { background: var(--ux-pri); }
.ux-col .bar em { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding-bottom: 4px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--ux-muted); white-space: nowrap; }
.ux-col.cur .bar em { color: var(--ux-ink); }
.ux-col .lbl { height: 18px; font-size: 12px; font-weight: 600; color: var(--ux-muted); white-space: nowrap; }
.ux-col.cur .lbl { color: var(--ux-ink); font-weight: 800; }
.ux-review { padding: 28px 48px 16px; }
.ux-review-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 8px; }
.ux-review-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.ux-review-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.ux-review[data-filter=ok] .ux-q[data-ok=bad], .ux-review[data-filter=bad] .ux-q[data-ok=ok] { display: none; }
.ux-review .ux-q { border-top: 1px solid var(--ux-line-2); }
.ux-empty-row { display: none; padding: 40px 0; text-align: center; color: var(--ux-muted); border-top: 1px solid var(--ux-line-2); }
.ux-review[data-filter=ok]:not(:has(.ux-q[data-ok=ok])) .ux-empty-row,
.ux-review[data-filter=bad]:not(:has(.ux-q[data-ok=bad])) .ux-empty-row { display: block; }
.ux-review .ans-only { display: none; }
.ux-review.show-ans .ans-only { display: flex; }
.ux-review.show-ans .ux-opt.right { border-style: dashed; border-color: #47CD89; }
.ux-review.show-ans .ux-opt.right .ux-letter { border-color: #47CD89; color: var(--ux-ok); }
.ux-text-ans { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 60px; }
.ux-ans-pill { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 24px; border-radius: 999px; font-size: 17px; font-weight: 700; border: 1.5px solid var(--ux-line); }
.ux-ans-pill.ok { background: var(--ux-ok-soft); border-color: #47CD89; }
.ux-ans-pill.bad { background: var(--ux-bad-soft); border-color: #FDA29B; }
.ux-ans-pill.right { border-style: dashed; border-color: #47CD89; color: var(--ux-ok); }
.ux-ans-pill em { font-style: normal; font-size: 13px; }
.ux-expl { gap: 10px; padding-left: 60px; font-size: 15px; color: var(--ux-muted); }
.ux-expl .ico { color: var(--ux-warn-dot); margin-top: 1px; }
.ux-note-sm { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.ux-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; color: var(--ux-text); cursor: pointer; user-select: none; }
.ux-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ux-switch .track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #98A2B3; transition: background .15s; }
.ux-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.25); transition: left .15s; }
.ux-switch input:checked + .track { background: var(--ux-pri); }
.ux-switch input:checked + .track::after { left: 21px; }
.ux-switch input:focus-visible + .track { outline: 3px solid var(--ux-ring); outline-offset: 2px; }

/* Thực hành SAP */
.ux-col-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.ux-col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 92px; }
.ux-task { display: flex; flex-direction: column; gap: 24px; }
.ux-task .ux-h1 { font-size: 28px; }
.ux-code-box { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 24px 28px; border-radius: 20px; background: var(--ux-ground); }
.ux-code-box .l { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.ux-code-box span { font-size: 14px; color: var(--ux-muted); }
.ux-code-box b { font-size: 44px; line-height: 1.15; font-weight: 800; letter-spacing: .04em; color: var(--ux-pri); }
.ux-code-box .ux-btn.done { border-color: #47CD89; color: var(--ux-ok); }
.ux-code-box .ux-btn span { font-size: 15px; color: inherit; }
.ux-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ux-params > div { padding: 10px 16px; border-radius: 16px; border: 1px solid var(--ux-line); }
.ux-params span { display: block; font-size: 13px; color: var(--ux-muted); }
.ux-params b { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.ux-res { display: flex; flex-direction: column; }
.ux-res-panel[hidden] { display: none; }
.ux-res-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ux-res-head .t { font-size: 15px; font-weight: 700; color: var(--ux-muted); }
.ux-res-fig { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ux-res-fig b { font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -.035em; margin-right: 4px; }
.ux-submit, .ux-subs { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.ux-subs { padding: 24px 16px; gap: 4px; }
.ux-submit h2, .ux-subs h2 { margin: 0; font-size: 19px; font-weight: 800; }
.ux-subs h2 { margin: 0 12px 8px; font-size: 17px; }
.ux-submit form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.ux-submit .ux-input { max-width: none; }
.ux-label { margin: 6px 0 -2px; font-size: 14px; font-weight: 700; color: var(--ux-text); }
.ux-btn.block { width: 100%; min-height: 52px; margin-top: 6px; }
.ux-muted.sm { font-size: 13px; } .center { text-align: center; }
.ux-sub { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 0; border-radius: 16px; background: transparent; font: inherit; color: var(--ux-ink); text-align: left; cursor: pointer; }
.ux-sub:hover { background: var(--ux-ground); }
.ux-sub.on { background: var(--ux-pri-soft); }
.ux-sub .ux-round { border-color: transparent; background: var(--ux-soft); font-weight: 800; cursor: pointer; }
.ux-sub.on .ux-round { background: var(--ux-pri); color: #fff; }
.ux-sub .b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ux-sub .b b { font-size: 15px; } .ux-sub .b small { font-size: 13px; color: var(--ux-muted); } .ux-sub .b small.pri { color: var(--ux-pri); font-weight: 700; }
.ux-sub .p { flex: none; font-size: 17px; font-weight: 800; }
.ux-sub .p.ok { color: var(--ux-ok); } .ux-sub .p.warn { color: var(--ux-warn); } .ux-sub .p.bad { color: var(--ux-bad); }
.ux-sub:focus-visible { outline: 3px solid var(--ux-ring); outline-offset: 2px; }

/* ─── Kỳ thi ─────────────────────────────────────────────────────────────── */
.ux-live { flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--ux-bad-soft); display: inline-flex; align-items: center; justify-content: center; }
.ux-live i { width: 12px; height: 12px; border-radius: 999px; background: #E04F16; animation: ux-pulse 1.6s ease-in-out infinite; }
@keyframes ux-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ux-live i { animation: none; } }
.ux-bar-title .eyebrow.live { color: #B93815; font-weight: 700; }
.ux-live-dot { width: 8px; height: 8px; border-radius: 999px; background: #17B26A; }
.ux-ic.pri { background: var(--ux-pri-soft); color: var(--ux-pri-d); }
.ux-btn.sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.ux-row.live { background: #F5F9FF; }
.ux-row.live:hover { background: var(--ux-pri-soft); }
.ux-status.fail { background: var(--ux-bad-soft); color: var(--ux-bad); }
.ux-status.fail .dot { background: var(--ux-bad); }
.ux-status.open { background: var(--ux-ok-soft); color: var(--ux-ok); }
.ux-status.open .dot { width: 10px; height: 10px; margin: 0 6px; background: #17B26A; }
.ux-actions.plain { border-top: 0; padding-top: 6px; }
.ux-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 24px; padding-top: 24px; border-top: 1px solid var(--ux-line-2); }
.ux-rules > div { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--ux-text); }
.ux-code-in { display: flex; flex-direction: column; gap: 8px; margin: 0; flex: 0 1 280px; font-size: 14px; font-weight: 700; color: var(--ux-text); }
.ux-code-in .ux-input { height: 56px; text-transform: uppercase; letter-spacing: .08em; font-size: 18px; }
.ux-code-in .ux-input::placeholder { text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 500; }
.ux-actions:has(.ux-code-in) { align-items: flex-end; }
.ux-exam-break { gap: 14px; }
.ux-meter > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; font-weight: 600; }
.ux-meter small { color: var(--ux-faint); font-weight: 600; }
.ux-meter b { font-weight: 800; }
.ux-meter-track { display: block; height: 10px; margin-top: 6px; border-radius: 999px; background: #DCE8F7; overflow: hidden; }
.ux-meter-track i { display: block; height: 100%; border-radius: 999px; background: var(--ux-pri); }
.ux-exam-row { cursor: default; }
.ux-exam-row:hover { background: transparent; }
.ux-exam-row .ux-qnum .ico { stroke-width: 3; }
.ux-qnum.cur { border-color: var(--ux-pri); color: var(--ux-pri); }
.ux-qnum.sub { background: var(--ux-pri); border-color: var(--ux-pri); color: #fff; }
.ux-exam-row.flash { background: var(--ux-warn-soft); transition: background .3s; }
.ux-exam-row form .ux-btn, .ux-exam-row > .ux-btn { min-height: 44px; }

/* Bảng so sánh (người học) */
.ux-cmp-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ux-muted); margin-bottom: 12px; }
.ux-cmp-sum span { display: inline-flex; align-items: center; gap: 4px; }
.ux-cmp-sum .ok { color: var(--ux-ok); font-weight: 700; } .ux-cmp-sum .bad { color: var(--ux-bad); font-weight: 700; }
.ux-cmp-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.ux-cmp-grid { min-width: 560px; }
.ux-cmp-row { display: grid; grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1fr) 96px; align-items: center; column-gap: 16px; padding: 12px 14px; border-radius: 16px; margin-top: 6px; }
.ux-cmp.has-ans .ux-cmp-row { grid-template-columns: 40px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 96px; }
.ux-cmp-row.head { margin-top: 0; padding-top: 0; padding-bottom: 10px; border-radius: 0; border-bottom: 1px solid var(--ux-line-2); font-size: 13px; font-weight: 700; color: var(--ux-muted); }
.ux-cmp-row.bad { background: var(--ux-bad-soft); }
.ux-cmp-row.info { background: var(--ux-warn-soft); }
.ux-cmp-row .r { text-align: right; }
.ux-cmp-anshead { display: inline-flex; align-items: center; gap: 8px; }
.ux-round.sm { width: 30px; height: 30px; }
.ux-cmp .i-on { display: none; } .ux-cmp.show-ans .i-on { display: inline-flex; } .ux-cmp.show-ans .i-off { display: none; }
.ux-cmp.show-ans [data-ans-toggle] { border-color: var(--ux-pri); background: var(--ux-pri-soft); color: var(--ux-pri); }
.ux-dot { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.ux-dot .ico { stroke-width: 3; }
.ux-dot.ok { background: var(--ux-ok); } .ux-dot.bad { background: var(--ux-bad); } .ux-dot.info { background: var(--ux-warn-dot); }
.ux-cmp-what { min-width: 0; display: flex; flex-direction: column; }
.ux-cmp-what b { font-size: 15px; font-weight: 700; }
.ux-cmp-what small { font-size: 12.5px; color: var(--ux-faint); overflow-wrap: anywhere; }
.ux-cmp-what em { font-style: normal; font-weight: 700; } .ux-cmp-what em.bad { color: var(--ux-bad); }
.ux-cmp-ans, .ux-cmp-act { min-width: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.ux-cmp-ans .mask { color: #98A2B3; letter-spacing: .15em; }
.ux-cmp-ans .val { display: none; color: var(--ux-ok); }
.ux-cmp-ans .val small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ux-muted); }
.ux-cmp.show-ans .ux-cmp-ans .mask { display: none; } .ux-cmp.show-ans .ux-cmp-ans .val { display: inline; }
.ux-cmp-row.bad .ux-cmp-act { color: var(--ux-bad); } .ux-cmp-row.info .ux-cmp-act { color: var(--ux-warn); }
.ux-cmp-eff { font-size: 14px; font-weight: 800; color: var(--ux-ok); }
.ux-cmp-row.bad .ux-cmp-eff { color: var(--ux-bad); } .ux-cmp-row.info .ux-cmp-eff { color: var(--ux-warn); }
.ux-cmp-row.head .ux-cmp-eff, .ux-cmp-row.head .r { color: var(--ux-muted); font-weight: 700; }

@media (max-width: 767px) {
  .ux-quiz-main, .ux-review { padding: 8px 20px 20px; }
  .ux-opts, .ux-text-ans, .ux-expl { padding-left: 0; }
  .ux-opts { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .ux-q .ux-input { margin-left: 0; width: 100%; }
  .ux-qside, .ux-col-side { position: static; }
  .ux-bar-progress { display: none; }
  .ux-timer { font-size: 22px; }
  .ux-code-box b { font-size: 34px; }
}
@media (max-width: 767px) {
  .ux-card { padding: 24px 20px; }
  .ux-h1 { font-size: 28px; }
  .ux-card.ux-hero { padding: 20px; }
  .ux-heat { flex: 1 1 100%; flex-wrap: wrap; }
  .ux-heat-side { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .ux-heat-side .ux-tip { min-height: 20px; }
  .ux-figure b { font-size: 48px; }
  .ux-list { padding: 4px 8px 8px; }
  .ux-row { gap: 12px; padding: 12px 8px; }
  .ux-row .ux-ic { width: 40px; height: 40px; }
  .ux-row .chev { display: none; }
}

/* ─── PWA: thanh báo mất mạng / hướng dẫn cài ─────────────────────────────── */
.pwa-offline { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1090; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: #B42318; color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(16, 24, 40, .18); text-align: center; }
.pwa-offline.info { background: #101828; }
.pwa-offline[hidden] { display: none; }
