/* Công cụ Bài kiểm tra — chỉ lớp .kt-* (tệp này nạp ở mọi trang). Dùng token của app.css. */
.kt-hang-nut { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.kt-len .bt { transform: rotate(180deg); }
.kt-nguy { color: var(--do); }
.kt-nguy:hover { background: var(--do-nhat); color: var(--do); }
.kt-an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kt-nhan-o { font-weight: 600; font-size: .9375rem; }

/* Danh sách câu (soạn đề, thống kê, xem bài) */
.kt-cau-ds { list-style: none; margin: 0; padding: 0; counter-reset: kt-cau; }
.kt-cau { counter-increment: kt-cau; padding: 14px 0; border-bottom: 1px solid var(--vien); }
.kt-cau:last-child { border-bottom: 0; }
.the.kt-cau { padding: 14px 16px; border-bottom: 1px solid var(--vien); border-left: 4px solid var(--vien); }
.kt-cau__dau { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.kt-cau__dau::before { content: "Câu " counter(kt-cau); font-weight: 800; color: var(--c-dam); margin-right: auto; }
.kt-cau__nd { font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.kt-cau--dung { border-left-color: var(--xanh-la) !important; }
.kt-cau--sai { border-left-color: var(--do) !important; }
.kt-cau--mot-phan { border-left-color: var(--nhan) !important; }
.kt-pa { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.kt-pa li { padding: 6px 10px; border: 1px solid var(--vien); border-radius: var(--r-nho); background: #fff; }
.kt-pa .kt-pa--dung { border-color: #9fd3ae; background: var(--xanh-la-nhat); }
.kt-pa--tk li { display: flex; justify-content: space-between; gap: 10px; }
.kt-dap-an { color: var(--xanh-la); margin: 0 0 6px; overflow-wrap: anywhere; }
.kt-tl { margin: 0 0 6px; padding: 8px 10px; background: var(--bg); border-radius: var(--r-nho); overflow-wrap: anywhere; }
.kt-them { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--vien); }
.kt-them .field { flex: 1 1 220px; }

/* Soạn câu: dòng phương án */
.kt-dong-ds { border: 1px solid var(--vien); border-radius: var(--r-nho); padding: 10px 12px 12px; margin: 0; display: grid; gap: 8px; }
.kt-dong-ds legend { font-weight: 600; font-size: .9375rem; padding: 0 4px; }
.kt-dong { display: flex; gap: 8px; align-items: center; }
.kt-dong input[type=text] { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #cfd6d1; border-radius: var(--r-nho); font: inherit; }
.kt-dong--2 input[type=text] { flex: 1 1 0; }
.kt-dung { display: flex; align-items: center; gap: 4px; font-size: .8125rem; color: var(--phu); flex: none; cursor: pointer; }
.kt-dung input { width: 20px; height: 20px; accent-color: var(--xanh-la); }
.kt-so { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--c-nhat); color: var(--c-dam); font-weight: 700; font-size: .8125rem; }
.kt-o-diem { max-width: 140px; }

/* Nhập nhanh */
.kt-van-ban { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .875rem; }
.kt-cu-phap code, .kt-vd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8125rem; background: var(--bg); border-radius: 5px; padding: 1px 4px; }
.kt-vd { display: block; padding: 10px; white-space: pre-wrap; border: 1px solid var(--vien); }
.kt-cu-phap li { margin-bottom: 6px; }

/* Phòng */
.kt-vao__in { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.kt-vao__in > div:first-child { flex: 1 1 260px; }
.kt-ma { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 900; letter-spacing: .14em; color: var(--c-dam); font-variant-numeric: tabular-nums; line-height: 1.1; margin: 2px 0 10px; }
.kt-qr { width: 160px; height: 160px; flex: none; background: #fff; border: 1px solid var(--vien); border-radius: var(--r-nho); padding: 4px; }
.kt-qr svg { width: 100%; height: 100%; display: block; }
.kt-bang { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.kt-bang th, .kt-bang td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--vien); vertical-align: top; }
.kt-bang th { font-size: .8125rem; color: var(--phu); font-weight: 700; }
.kt-bang .so { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kt-cuon { overflow-x: auto; }
.kt-so-lieu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .kt-so-lieu { grid-template-columns: repeat(4, 1fr); } }
.kt-so-lieu > div { background: var(--the); border: 1px solid var(--vien); border-top: 3px solid var(--nhan); border-radius: var(--r); padding: 12px 14px; }
.kt-so-lieu b { display: block; font-size: 1.6rem; color: var(--c-dam); font-variant-numeric: tabular-nums; }
.kt-so-lieu span { font-size: .8125rem; color: var(--phu); }
.kt-ti-le { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.kt-ti-le .thanh-tien { flex: 1; max-width: 320px; }
.kt-diem-to { font-size: 2.6rem; font-weight: 900; color: var(--c-dam); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kt-diem-to small { font-size: 1rem; font-weight: 600; color: var(--phu); }
.kt-cham { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--vien); }

/* Học sinh */
.kt-giua { text-align: center; }
.kt-giua .nut { margin-top: 10px; }
.kt-tom { display: flex; flex-wrap: wrap; gap: 6px; }
.kt-tom span { background: var(--c-nhat); color: var(--c-dam); border-radius: 999px; padding: 3px 12px; font-size: .875rem; font-weight: 700; }
.kt-huong-dan { background: var(--nhan-nhat); border-radius: var(--r-nho); padding: 10px 12px 2px; margin-bottom: 12px; }
.kt-thanh { position: sticky; top: 58px; z-index: 20; display: flex; align-items: center; gap: 10px; background: var(--the); border: 1px solid var(--vien);
  border-radius: var(--r); padding: 8px 8px 8px 14px; box-shadow: var(--bong); }
.kt-thanh__ten { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-dong-ho { font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--c-dam); background: var(--c-nhat); border-radius: 8px; padding: 2px 10px; }
.kt-dong-ho--gap { color: #fff; background: var(--do); }
.che-do-hs .kt-thanh .nut { min-height: 40px; font-size: .9375rem; }
.kt-luu { min-height: 1.4em; margin: 6px 4px; }

/* SurveyJS (chỉ trong màn làm bài; lớp gốc có thể nằm ngay trên #kt-survey): màu và chữ theo trang */
.kt-lam .sd-theme-root, .kt-lam.sd-theme-root, .kt-lam .sd-root-modern, .kt-lam.sd-root-modern {
  --sjs2-color-project-brand-600: #1d4f91;
  --sjs2-color-utility-body: transparent;
  --sjs2-typography-font-family-text: var(--font);
}
.kt-lam .katex { font-size: 1.15em; }
.kt-lam .katex .mfrac { font-size: 1.25em; }
.kt-lam .sd-root-modern::before { background: transparent; }
