/* Trang thi thử: bảng chọn bộ đề, khung câu hỏi, thanh giờ thi. Mọi màu lấy từ biến của kvc.css. */
.tt-dau-trang { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tt-dau-trang a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 700; text-decoration: none; color: var(--ink-2);
}
.tt-dau-trang a:hover { color: var(--accent); background: var(--tint); }
.tt-dau-trang a.tt-dk { background: var(--accent); color: var(--accent-ink); }

.tt-mo { padding-block: 40px 8px; }
.tt-mo .nhan-khoi { margin-bottom: 8px; }
.tt-mo h1 { font-size: var(--fs-xl); font-weight: 800; max-width: 24ch; }
.tt-mo .dan { color: var(--ink-2); margin-top: 12px; max-width: 64ch; }
.tt-quy-tac {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; max-width: 760px;
}
.tt-quy-tac div { border-top: 3px solid var(--accent); padding-top: 10px; min-width: 0; }
.tt-quy-tac b { display: block; font-size: var(--fs-xl); font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tt-quy-tac span { font-size: var(--fs-sm); color: var(--ink-2); }
.tt-can-cu { font-size: var(--fs-xs); color: var(--muted); margin-top: 12px; max-width: 72ch; }

.tt-khoi { padding-block: 32px 72px; }
.tt-nhom + .tt-nhom { margin-top: 28px; }
.tt-nhom h2 { font-size: var(--fs-md); font-weight: 800; margin-bottom: 12px; }
.tt-ds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tt-bo {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start;
  width: 100%; min-height: 72px; padding: 14px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r);
}
.tt-bo:hover { border-color: var(--accent); }
.tt-bo[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.tt-bo .ma { grid-row: span 2; min-height: 30px; }
.tt-bo b { font-size: var(--fs-sm); font-weight: 700; color: var(--heading); line-height: 1.35; }
.tt-bo small { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }

.tt-che-do { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.tt-che-do .nut { min-width: 160px; }
.tt-chon-bo {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 28px;
  scroll-margin-top: 96px;
}
.tt-chon-bo h2 { font-size: var(--fs-lg); font-weight: 800; }
.tt-chon-bo p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 6px; }
.tt-lich-su { font-size: var(--fs-xs); color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }

/* Khung làm bài */
.tt-bai { scroll-margin-top: calc(68px + env(safe-area-inset-top, 0px)); }
.tt-thanh {
  position: sticky; top: calc(68px + env(safe-area-inset-top, 0px)); z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.tt-thanh .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-block: 10px; }
.tt-thanh .ten { font-weight: 800; color: var(--heading); font-size: var(--fs-sm); min-width: 0; }
.tt-thanh .tien-do { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tt-gio {
  margin-left: auto; font-weight: 800; font-size: var(--fs-lg); font-variant-numeric: tabular-nums;
  color: var(--heading); padding: 4px 12px; border-radius: 8px; background: var(--tint);
}
.tt-gio.sap-het { color: var(--accent-ink); background: var(--buoy); }
.tt-thanh .nut { min-height: 44px; padding: 10px 18px; }
.tt-vach { height: 4px; background: var(--line); }
.tt-vach span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }

.tt-vung { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; padding-block: 24px 48px; align-items: start; }
.tt-cau { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-width: 0; }
.tt-cau .so { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tt-cau .mon { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.tt-cau h2 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.45; margin-top: 10px; color: var(--ink); text-wrap: pretty; }
.tt-lcs { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.tt-lc {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: center;
  width: 100%; min-height: 52px; padding: 10px 14px; text-align: left; cursor: pointer;
  font: 500 var(--fs-md) / 1.45 var(--font); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px;
}
.tt-lc:hover:not([disabled]) { border-color: var(--accent); }
.tt-lc .chu {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  font-weight: 800; font-size: var(--fs-sm); color: var(--accent); background: var(--tint);
}
.tt-lc[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.tt-lc[aria-pressed="true"] .chu { background: var(--accent); color: var(--accent-ink); }
.tt-lc.dung { border-color: var(--ok); box-shadow: 0 0 0 1.5px var(--ok) inset; }
.tt-lc.dung .chu { background: var(--ok); color: var(--accent-ink); }
.tt-lc.sai { border-color: var(--buoy); box-shadow: 0 0 0 1.5px var(--buoy) inset; }
.tt-lc.sai .chu { background: var(--buoy); color: var(--accent-ink); }
.tt-lc[disabled] { cursor: default; }
.tt-phan-hoi { margin-top: 14px; font-size: var(--fs-sm); font-weight: 700; min-height: 1.5em; }
.tt-phan-hoi.dung { color: var(--ok); }
.tt-phan-hoi.sai { color: var(--buoy); }
.tt-dieu-huong { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tt-dieu-huong .nut { min-height: 46px; }
.tt-goc { font-size: var(--fs-xs); color: var(--muted); margin-top: 14px; }

.tt-ben { display: grid; gap: 16px; min-width: 0; }
.tt-hop { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.tt-hop h3 { font-size: var(--fs-sm); font-weight: 800; margin-bottom: 10px; }
.tt-hop label { font-size: var(--fs-xs); color: var(--muted); display: block; margin-bottom: 6px; }
.tt-hop select {
  width: 100%; min-height: 44px; font: 500 1rem / 1.3 var(--font); color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.tt-dem { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.tt-dem b { display: block; font-size: var(--fs-lg); font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; }
.tt-dem span { font-size: var(--fs-xs); color: var(--muted); }
.tt-o-so { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tt-o-so button {
  min-height: 44px; border-radius: 8px; cursor: pointer; font: 700 var(--fs-xs) / 1 var(--font);
  font-variant-numeric: tabular-nums; color: var(--ink-2); background: var(--bg); border: 1.5px solid var(--line);
}
.tt-o-so button.da-lam { background: var(--tint); color: var(--accent); border-color: var(--tint); }
.tt-o-so button.dang { border-color: var(--accent); color: var(--accent); }
.tt-o-so button.dung { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); }
.tt-o-so button.sai { background: var(--buoy); border-color: var(--buoy); color: var(--on-buoy); }
.tt-xac-nhan { background: var(--tint); color: var(--ink); border-radius: 10px; padding: 14px; font-size: var(--fs-sm); font-weight: 600; display: grid; gap: 10px; }
.tt-xac-nhan div { display: flex; flex-wrap: wrap; gap: 8px; }

/* Kết quả */
.tt-kq { padding-block: 32px 72px; scroll-margin-top: calc(68px + env(safe-area-inset-top, 0px)); }
.tt-kq-dau { border-radius: 14px; padding: 24px; display: grid; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.tt-kq-dau .nhan { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.tt-kq-dau.dat .nhan { color: var(--ok); }
.tt-kq-dau.truot .nhan { color: var(--buoy); }
.tt-kq-dau h2 { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.tt-kq-dau p { color: var(--ink-2); }
.tt-kq-dau .tt-che-do { margin-top: 8px; }
.tt-sai-ds { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.tt-sai-ds li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 6px; }
.tt-sai-ds .q { font-weight: 700; color: var(--ink); }
.tt-sai-ds .chon { font-size: var(--fs-sm); color: var(--buoy); }
.tt-sai-ds .dap { font-size: var(--fs-sm); color: var(--ok); font-weight: 600; }
.tt-sai-ds .meta { font-size: var(--fs-xs); color: var(--muted); }

.tt-trong { color: var(--ink-2); font-size: var(--fs-sm); padding: 20px; border: 1.5px dashed var(--line); border-radius: 10px; }

@media (max-width: 1080px) {
  .tt-ds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-vung { grid-template-columns: 1fr; }
  .tt-o-so { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .tt-dau-trang a:not(.tt-dk) { display: none; }
  .tt-quy-tac { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tt-quy-tac b { font-size: var(--fs-lg); }
  .tt-ds { grid-template-columns: 1fr; }
  .tt-cau { padding: 16px; }
  .tt-cau h2 { font-size: var(--fs-md); }
  .tt-lc { font-size: var(--fs-sm); }
  .tt-o-so { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tt-gio { font-size: var(--fs-md); }
  .tt-thanh .ten { flex-basis: 100%; }
  .tt-che-do .nut { flex: 1 1 140px; min-width: 0; }
}

/* Cổng nhập thông tin trước khi ôn, thi */
.tt-cong { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(6, 22, 45, 0.35); }
.tt-cong::backdrop { background: rgba(6, 22, 45, 0.55); }
.tt-cong-form { display: grid; gap: 14px; padding: 24px; }
.tt-cong h2 { font-size: var(--fs-lg); font-weight: 800; color: var(--heading); }
.tt-cong-dan { font-size: var(--fs-sm); color: var(--ink-2); }
.tt-cong-loi { font-size: var(--fs-sm); font-weight: 600; color: var(--buoy); min-height: 1em; }
.tt-cong-loi:empty { display: none; }
.tt-cong-nut { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.tt-cong-bm { font-size: var(--fs-xs); color: var(--muted); }

/* Mức sẵn sàng */
.tt-san-sang { margin-top: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: grid; gap: 10px; }
.tt-ss-dau { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
.tt-ss-nhan { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.tt-ss-dau b { color: var(--heading); }
.tt-ss-thanh { height: 10px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.tt-ss-thanh span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.tt-san-sang.tot .tt-ss-thanh span { background: var(--ok); }
.tt-san-sang.yeu .tt-ss-thanh span { background: var(--buoy); }
.tt-ss-ghi { font-size: var(--fs-xs); color: var(--ink-2); }

/* Kết quả theo môn */
.tt-mon-bang { display: grid; gap: 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tt-mon-dong { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) 3.5em; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.tt-mon-dong .ten { color: var(--ink); min-width: 0; }
.tt-mon-dong .thanh { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.tt-mon-dong .thanh span { display: block; height: 100%; background: var(--ok); }
.tt-mon-dong.yeu .thanh span { background: var(--buoy); }
.tt-mon-dong .so { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--heading); }
.tt-goi-y { margin-top: 12px; padding: 16px 18px; border-radius: var(--r); background: var(--tint); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tt-goi-y p { color: var(--ink); font-weight: 600; flex: 1 1 280px; }
.tt-kq-lh { margin-top: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tt-kq-lh p { color: var(--ink-2); flex: 1 1 320px; font-size: var(--fs-sm); }
@media (max-width: 680px) { .tt-mon-dong { grid-template-columns: minmax(0, 1fr) 3.5em; } .tt-mon-dong .thanh { grid-column: 1 / -1; grid-row: 2; } }
