/* ===== Trang làm bài test trình độ (/test) — theo bộ nhận diện TOEX ===== */
:root {
  --ink: #121212; --cream: #FFF6E0; --yellow: #EBC24F; --orange: #F07A3C; --moss: #5E7B3A; --sky: #86A3BB;
  --muted: #6b7280; --line: #d9d4c7;
  --paper: #faf7ee; --read-font: "Quicksand", system-ui, sans-serif; --read-size: 17px;
  --ok: #2f7d4a; --bad: #c73a2e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; font-family: "Quicksand", system-ui, sans-serif; color: var(--ink);
  background-color: var(--sky);
  background-image: radial-gradient(rgba(255,255,255,.33) 2.6px, transparent 3px); background-size: 46px 46px;
}
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }
.t-noscript { padding: 40px; text-align: center; }

/* ---------- trang chọn đề ---------- */
.t-home { max-width: 980px; margin: 0 auto; padding: 28px 16px 56px; }
.t-brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 19px; text-decoration: none; }
.t-brand img { width: 40px; height: 40px; }
.t-home-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-home-top a.t-link { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 14px; }
.t-h1 { margin: 26px 0 8px; text-align: center; font-family: "Fraunces", serif; font-weight: 900; font-size: clamp(34px, 7vw, 56px); line-height: 1.05;
  color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
.t-lead { margin: 14px auto 28px; max-width: 46ch; text-align: center; font-size: 16.5px; font-weight: 600; line-height: 1.55; }
.t-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.t-card { display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 20px; background: var(--cream); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); }
.t-card h2 { margin: 0; font-family: "Fraunces", serif; font-weight: 900; font-size: 26px; line-height: 1.15; }
.t-tag { align-self: flex-start; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 12.5px; letter-spacing: .02em; }
.t-tag.alt { background: #fff; }
.t-card ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; line-height: 1.5; }
.t-card .t-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 14.5px; cursor: pointer; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.t-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.t-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.t-btn.primary { background: var(--orange); }
.t-btn.yellow { background: var(--yellow); }
.t-btn.ghost { box-shadow: none; }
.t-resume { margin: 0 0 20px; padding: 14px 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff; border: 2px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); font-weight: 600; }
.t-note { margin: 26px auto 0; max-width: 70ch; text-align: center; font-size: 13.5px; font-weight: 600; line-height: 1.6; color: #1f2a33; }

/* ---------- khung làm bài (kiểu study4: đề bên trái, cột thời gian + lưới số câu bên phải) ---------- */
html:has(.t-exam), body:has(.t-exam) { overflow: hidden; height: 100%; }
.t-exam { display: flex; flex-direction: column; gap: 12px; height: 100vh; height: 100dvh; padding: 12px; }
.t-top { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #fff; border: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); }
.t-ib { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 12px; background: #fff; cursor: pointer; }
.t-ib:hover { background: var(--cream); }
.t-ib svg { width: 19px; height: 19px; }
.t-title { flex: none; display: flex; flex-direction: column; line-height: 1.2; max-width: 170px; }
.t-title b { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-title span { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.t-parts { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.t-ptab { flex: none; height: 34px; padding: 0 14px; border: 2px solid transparent; border-radius: 999px; background: #f1ede2; color: #4b4b45; cursor: pointer;
  font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 13px; white-space: nowrap; }
.t-ptab:hover { border-color: var(--ink); }
.t-ptab.on { background: var(--ink); color: #fff; }
.t-tools { flex: none; position: relative; display: flex; align-items: center; gap: 8px; }
.t-sws { display: inline-flex; gap: 5px; }
.t-sw { width: 22px; height: 22px; border: 2px solid rgba(18,18,18,.3); border-radius: 6px; cursor: pointer; padding: 0; }
.t-sw.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.t-sel { height: 38px; padding: 0 8px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.t-aa, .t-sidebtn { display: none; }
.t-pop { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; padding: 14px; display: grid; gap: 12px; background: #fff; border: 2px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
.t-pop[hidden] { display: none; }
.t-pop label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }

.t-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; }
.t-paper { min-height: 0; display: flex; flex-direction: column; background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); overflow: hidden; }
.t-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* audio */
.t-audio { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 2px solid var(--ink); }
.t-audio[hidden] { display: none; }
.t-play { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); cursor: pointer; }
.t-play svg { width: 18px; height: 18px; }
.t-time { flex: none; min-width: 46px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.t-prog { flex: 1; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; cursor: pointer; position: relative; overflow: hidden; }
.t-prog span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--yellow); }
.t-speed { flex: none; height: 36px; min-width: 48px; padding: 0 8px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; cursor: pointer; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 13px; }
.t-alabel { flex: none; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* cột phải */
.t-side { min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 14px; background: #fff; border: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); }
.t-sbox { display: grid; gap: 10px; padding-bottom: 12px; border-bottom: 2px dashed #e2dccb; }
.t-sbox small { font-size: 13px; font-weight: 700; color: var(--muted); }
.t-timer { display: inline-flex; align-items: center; gap: 8px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1; }
.t-timer i { width: 10px; height: 10px; border-radius: 50%; background: var(--moss); }
.t-timer.over { color: var(--bad); }
.t-timer.over i { background: var(--bad); }
.t-submit { height: 44px; border: 2px solid var(--ink); border-radius: 12px; background: var(--yellow); cursor: pointer; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .03em; box-shadow: 3px 3px 0 var(--ink); }
.t-submit:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.t-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 700; cursor: pointer; }
.t-chk input { margin: 2px 0 0; accent-color: var(--ink); }
.t-hint { margin: 0; font-size: 12.5px; line-height: 1.5; color: #b0581f; font-weight: 600; }
.t-gpart h5 { margin: 0 0 8px; font-family: "Plus Jakarta Sans", sans-serif; font-size: 14px; font-weight: 800; }
.t-gpart h5 small { font-weight: 700; color: var(--muted); }
.t-gpart.on h5 { color: #b0581f; }
.t-gnums { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; }
.t-n { height: 30px; padding: 0; border: 1.5px solid #9a9486; border-radius: 8px; background: #fff; cursor: pointer; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 12px; color: #3b3b36; }
.t-n:hover { border-color: var(--ink); }
.t-n.done { background: var(--ink); border-color: var(--ink); color: #fff; }
.t-n.flag { background: #fff1e4; border-color: var(--orange); color: #b0581f; box-shadow: inset 0 -3px 0 var(--orange); }
.t-n.done.flag { background: var(--orange); color: #fff; }
.t-n.playing { outline: 3px solid var(--yellow); outline-offset: 1px; }
.t-n.right { background: var(--ok); border-color: var(--ok); color: #fff; }
.t-n.wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
.t-n.skip { background: #fff; border-color: var(--bad); color: var(--bad); }

/* đề */
.t-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px clamp(16px, 3vw, 36px) 60px; font-family: var(--read-font); font-size: var(--read-size); line-height: 1.6; }
.t-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.t-split > .t-scroll + .t-scroll { border-left: 2px solid #e6e0d0; }
.t-phead { margin: 0 0 8px; font-family: "Plus Jakarta Sans", sans-serif; }
.t-phead b { font-size: 1.15em; }
.t-phead span { color: var(--muted); font-weight: 600; }
.t-dir { margin: 0 0 18px; padding: 10px 14px; border-left: 4px solid var(--yellow); background: rgba(235,194,79,.12); border-radius: 0 10px 10px 0; font-family: "Quicksand", sans-serif; font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.t-dim { opacity: .6; }

/* câu hỏi */
.t-q { margin: 0 0 18px; padding: 8px 10px; border-radius: 12px; scroll-margin-top: 12px; transition: background .2s; }
.t-q.is-cur { background: rgba(235,194,79,.14); }
.t-q.is-playing { background: rgba(235,194,79,.26); box-shadow: inset 4px 0 0 var(--yellow); }
.t-qhead { display: flex; gap: 10px; align-items: flex-start; }
.t-num { flex: none; min-width: 32px; height: 32px; padding: 0 6px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: #fff; cursor: pointer;
  font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 13px; color: var(--ink); }
.t-num:hover { background: #fff1e4; }
.t-num.flag { background: var(--orange); border-color: var(--orange); color: #fff; }
.t-stem { padding-top: 3px; }
.t-opts { margin: 6px 0 0 42px; display: grid; gap: 2px; }
.t-opts.row { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.t-opt { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 4px 8px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.t-opt:hover { background: rgba(18,18,18,.05); }
.t-opt input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.t-bub { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 12px; margin-top: 1px; }
.t-otext { padding-top: 1px; }
.t-opt input:checked + .t-bub { background: var(--ink); color: #fff; }
.t-opt input:checked ~ .t-otext { font-weight: 700; }
.t-opt input:focus-visible + .t-bub { outline: 3px solid var(--orange); outline-offset: 2px; }
.t-review .t-opt { cursor: default; }
.t-opt.is-ans .t-bub { background: var(--ok) !important; border-color: var(--ok); color: #fff; }
.t-opt.is-ans { background: rgba(47,125,74,.1); }
.t-opt.is-wrong .t-bub { background: var(--bad) !important; border-color: var(--bad); color: #fff; }
.t-opt.is-wrong { background: rgba(199,58,46,.08); }
.t-mark { margin: 4px 0 0 42px; font-size: 14px; font-weight: 700; }
.t-mark.ok { color: var(--ok); }
.t-mark.no { color: var(--bad); }
/* Part 1: ảnh bên trái, đáp án bên phải */
.t-pic { display: grid; grid-template-columns: minmax(0, 420px) minmax(200px, 1fr); gap: 20px; align-items: start; padding: 12px; margin-bottom: 22px; }
.t-pic .t-photo { width: 100%; height: auto; max-height: 300px; object-fit: contain; border: 2px solid var(--ink); border-radius: 12px; mix-blend-mode: multiply; background: #fff; }
.t-pic .t-opts { margin-left: 42px; }
/* Part 2: lưới gọn */
.t-p2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 18px; }
.t-p2 .t-q { margin: 0 0 6px; }
.t-p2 .t-qhead { align-items: center; }
/* Part 3, 4: mỗi đoạn hội thoại 1 khối; có bảng/biểu đồ thì bảng bên trái, câu hỏi bên phải */
.t-group { margin: 0 0 22px; padding: 10px 6px 4px; border-bottom: 2px dashed #ddd6c4; border-radius: 12px; transition: background .2s; }
.t-group:last-of-type { border-bottom: 0; }
.t-group.is-playing { background: rgba(235,194,79,.08); }
.t-g2 { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.t-gimg { position: sticky; top: 0; }
.t-ghead { margin: 0 0 8px 10px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: .78em; letter-spacing: .06em; text-transform: uppercase; color: #8a8576; }
.t-graphic { display: block; max-width: 100%; height: auto; mix-blend-mode: multiply; }
.t-gnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

/* bài đọc */
.t-passage p { margin: 0 0 .9em; }
.t-passage h4 { margin: .4em 0 .6em; font-size: 1.08em; text-align: center; }
.t-passage hr { margin: 1.4em 0; border: 0; border-top: 2px dashed #cfc7b2; }
.t-passage table { width: 100%; margin: 0 0 1em; border-collapse: collapse; font-size: .92em; }
.t-passage th, .t-passage td { padding: 6px 10px; border: 1.5px solid #8a8576; text-align: left; vertical-align: top; }
.t-passage th { background: rgba(18,18,18,.05); }
.t-passage table.t-head { width: auto; font-size: .95em; }
.t-passage table.t-head th { width: 1%; white-space: nowrap; border: 0; background: none; padding: 2px 12px 2px 0; }
.t-passage table.t-head td { border: 0; border-bottom: 1px solid #d5ccb5; padding: 2px 8px; }
.t-passage ul { margin: 0 0 .9em; padding-left: 1.3em; }
.t-passage .t-url { font-family: "Plus Jakarta Sans", sans-serif; font-size: .82em; color: #55616e; padding: 4px 12px; border: 1.5px solid #b9b1a0; border-radius: 999px; display: inline-block; }
.t-passage .t-tabs { display: flex; flex-wrap: wrap; gap: 0; }
.t-passage .t-tabs span { flex: 1; text-align: center; padding: 4px 8px; border: 1.5px solid #8a8576; }
.t-passage .t-btn2, .t-passage .t-btn { box-shadow: none; padding: 2px 10px; border-width: 1.5px; font-size: .9em; }
.t-blank { display: inline-block; min-width: 3.6em; padding: 0 .4em; margin: 0 .1em; border-bottom: 2.5px solid var(--ink); text-align: center; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: .85em; background: rgba(235,194,79,.25); border-radius: 4px 4px 0 0; cursor: pointer; }
.t-blank.filled { background: rgba(94,123,58,.18); }
.t-gtitle { margin: 0 0 14px; font-family: "Plus Jakarta Sans", sans-serif; font-size: .78em; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #8a8576; }
.t-scans img { display: block; width: 100%; height: auto; margin: 0 0 12px; mix-blend-mode: multiply; }
.t-toggle { margin: 0 0 14px; display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.t-toggle button { border: 0; background: #fff; padding: 5px 12px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 12px; cursor: pointer; }
.t-toggle button.on { background: var(--ink); color: #fff; }
.t-gnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

/* tô màu chữ */
mark.hl { color: inherit; border-radius: 2px; padding: 0 1px; }
mark.hl-1 { background: #ffe873; } mark.hl-2 { background: #b6ef9c; } mark.hl-3 { background: #a9dcff; } mark.hl-4 { background: #ffc0d5; }
mark.hl-u { background: none; text-decoration: underline 2px; text-underline-offset: 3px; }
.t-hlbar { position: fixed; z-index: 50; display: flex; gap: 6px; padding: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.t-hlbar[hidden] { display: none; }
.t-hlbar button { width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; font-weight: 800; font-size: 13px; background: #fff; }
.t-tip { position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: #FCE58E; border: 2px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); font-size: 14px; font-weight: 600; line-height: 1.5; }
.t-tip kbd { display: inline-block; min-width: 20px; padding: 0 4px; border: 1.5px solid #b49a3e; border-radius: 5px; background: #fff6cf; font-family: inherit; font-size: 12px; text-align: center; }
.t-tip .t-btn { flex: none; }

/* hộp thoại */
.t-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(18,18,18,.45); }
.t-modal[hidden] { display: none; }
.t-dialog { width: min(440px, 100%); padding: 24px; background: var(--cream); border: 2px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); text-align: center; }
.t-dialog h3 { margin: 0 0 8px; font-family: "Fraunces", serif; font-weight: 900; font-size: 26px; }
.t-dialog p { margin: 0 0 18px; font-weight: 600; line-height: 1.55; }
.t-dialog .t-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* kết quả */
.t-result { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; }
.t-score { margin-top: 18px; padding: 26px 24px; background: var(--cream); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); text-align: center; }
.t-score .t-big { font-family: "Fraunces", serif; font-weight: 900; font-size: clamp(54px, 13vw, 92px); line-height: 1; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; }
.t-score .t-big small { font-size: .38em; -webkit-text-stroke: 0; }
.t-level { display: inline-block; margin: 14px 0 6px; padding: 6px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; }
.t-score p { margin: 10px auto 0; max-width: 58ch; font-weight: 600; line-height: 1.6; }
.t-score .t-est { font-size: 13px; color: #5b5b55; }
.t-stats { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.t-stat { padding: 14px; background: #fff; border: 2px solid var(--ink); border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); }
.t-stat b { display: block; font-family: "Plus Jakarta Sans", sans-serif; font-size: 13px; color: #5b5b55; }
.t-stat strong { font-family: "Fraunces", serif; font-size: 30px; }
.t-stat .t-barr { margin-top: 8px; height: 10px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #f1ede2; }
.t-stat .t-barr span { display: block; height: 100%; background: var(--moss); }
.t-reco { margin-top: 20px; padding: 20px 22px; background: #fff; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 4px 4px 0 var(--ink); }
.t-reco h3 { margin: 0 0 8px; font-family: "Fraunces", serif; font-weight: 900; font-size: 24px; }
.t-reco p { margin: 0 0 14px; line-height: 1.6; font-weight: 600; }
.t-reco .t-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- màn nhỏ ---------- */
@media (max-width: 1280px) {
  .t-tools .wide { display: none; }
  .t-aa { display: grid; }
}
@media (max-width: 1000px) {
  .t-body { grid-template-columns: minmax(0, 1fr); }
  .t-sidebtn { display: grid; }
  .t-side { position: fixed; z-index: 45; top: 70px; right: 10px; bottom: 10px; width: min(300px, calc(100% - 20px)); transform: translateX(calc(100% + 20px)); transition: transform .25s; }
  .t-side.open { transform: none; }
  .t-pic { grid-template-columns: 1fr; }
  .t-g2 { grid-template-columns: 1fr; }
  .t-gimg { position: static; }
}
@media (max-width: 760px) {
  .t-exam { padding: 8px; gap: 8px; }
  .t-top { flex-wrap: wrap; gap: 8px; padding: 8px; }
  .t-title { display: none; }
  .t-parts { order: 5; flex: 1 1 100%; }
  .t-tools { margin-left: auto; }
  .t-split { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; } /* bài đọc rồi tới câu hỏi, cuộn chung một khung (không đè chữ) */
  .t-split > .t-scroll { overflow: visible; flex: none; min-height: auto; height: auto; padding-bottom: 24px; }
  .t-split > .t-scroll + .t-scroll { border-left: 0; border-top: 2px solid #e6e0d0; }
  .t-opts, .t-pic .t-opts, .t-mark { margin-left: 0; }
  .t-audio { gap: 8px; padding: 8px 10px; }
  .t-alabel { display: none; }
  .t-side { top: 110px; }
}
@media (max-width: 420px) {
  .t-time { min-width: 38px; font-size: 12px; }
}
/* để lại tên + số điện thoại sau khi làm bài */
.t-leadbox { background: var(--cream); } /* khung để lại tên + SĐT (trước dùng nhầm .t-lead của trang chọn đề nên bị hẹp 46ch) */
.t-leadform { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 10px; }
@media (max-width: 900px) { .t-leadform { grid-template-columns: 1fr 1fr; } }
.t-leadform input { min-width: 0; height: 46px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; font-size: 16px; font-weight: 600; box-shadow: 2px 2px 0 var(--ink); }
.t-leadform input:focus { outline: none; border-color: var(--orange); box-shadow: 3px 3px 0 var(--orange); }
.t-leadmsg { margin: 10px 0 0 !important; font-weight: 800 !important; }
.t-leadmsg.ok { color: var(--ok); }
.t-leadmsg.err { color: var(--bad); }
@media (max-width: 640px) { .t-leadform { grid-template-columns: 1fr; } }

/* ---- điểm tổng nổi bật + hiệu ứng chúc mừng ---- */
.t-score { position: relative; overflow: hidden; --c1: #F07A3C; --c2: #EBC24F; background-image: radial-gradient(circle at 50% 0, rgba(255,255,255,.7), transparent 60%); }
.t-score.lv-mat-goc { --c1: #C8561D; --c2: #EBC24F; background-color: #FFF1DD; }
.t-score.lv-co-nen { --c1: #5E7B3A; --c2: #EBC24F; background-color: #EEF4E2; }
.t-score.lv-kha { --c1: #4F7396; --c2: #86A3BB; background-color: #E6EFF6; }
.t-score.lv-tot { --c1: #A97A0B; --c2: #F07A3C; background-color: #FFF4D2; }
.t-score > :not(.t-confetti) { position: relative; z-index: 1; }
.t-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.t-congrats { margin: 0 0 4px !important; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--c1); }
.t-score .t-big { color: var(--c1); background: none; -webkit-text-fill-color: currentColor; -webkit-text-stroke: 0; text-shadow: none; filter: none; font-variant-numeric: tabular-nums; } /* 1 màu, không viền, không bóng cho dễ đọc */
.t-score .t-big small { color: #5b5b55; -webkit-text-fill-color: currentColor; -webkit-text-stroke: 0; font-size: .34em; }
.t-score .t-big.pop { animation: tPop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes tPop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: none; opacity: 1; } }
.t-score .t-level { background: var(--c1); color: #fff; font-size: 16px; padding: 8px 20px; box-shadow: 3px 3px 0 var(--ink); }
.t-score.lv-mat-goc .t-level, .t-score.lv-tot .t-level { color: var(--ink); background: var(--c2); }
.t-stat:nth-child(4n+1) .t-barr span { background: #F07A3C; } .t-stat:nth-child(4n+2) .t-barr span { background: #5E7B3A; }
.t-stat:nth-child(4n+3) .t-barr span { background: #4F7396; } .t-stat:nth-child(4n) .t-barr span { background: #C99A1B; }
@media (prefers-reduced-motion: reduce) { .t-score .t-big.pop { animation: none; } }
/* bảng tiêu đề email (To/From) trên màn nhỏ: xuống dòng thay vì tràn */
.t-passage table.t-head td { overflow-wrap: anywhere; word-break: break-word; }
/* đăng ký học ưu tiên ngay dưới điểm */
.t-reco-top { border-width: 2.5px; box-shadow: 5px 5px 0 var(--orange); }
.t-reco-top .t-btn.primary { font-size: 16px; padding: 13px 26px; }

/* ---------- đề luyện từ sách (/luyen-de) ---------- */
.t-ocrnote { margin: -4px 0 14px; padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; line-height: 1.5; color: #374151; }
.ld-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 26px; }
.ld-chips button { padding: 7px 16px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 13.5px; cursor: pointer; }
.ld-chips button.on { background: var(--ink); color: #fff; }
.ld-book { margin: 0 0 30px; }
.ld-book > h2 { margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; font-family: "Fraunces", serif; font-weight: 900; font-size: 28px; }
.ld-book > h2 small { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 14px; color: #1f2a33; }
.ld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.ld-test { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--cream); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
.ld-test h3 { margin: 0; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 18px; }
.ld-test .ld-st { margin: 0; font-size: 13.5px; font-weight: 700; color: #374151; min-height: 1.5em; }
.ld-test .ld-st b { color: var(--ink); }
.ld-test .ld-btns { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.ld-test .t-btn { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.ld-test .t-btn.primary { flex: 1 1 100%; }

/* đề sách khi chưa đăng nhập: bìa TOEX (book-cover.js) + mời đăng nhập */
.t-gate { display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: center; max-width: 820px; padding-top: 12vh; }
.t-gate-cover { display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 3px 8px 8px 3px; box-shadow: 0 16px 30px -16px rgba(20, 32, 43, .6); }
.t-gate-cover svg { display: block; width: 100%; height: 100%; }
.t-gate .t-h1 { margin-bottom: 10px; }
.t-gate .t-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 560px) { .t-gate { grid-template-columns: 1fr; padding-top: 6vh; } .t-gate-cover { width: 140px; } }
mark.hl-b { background: none; font-weight: 800; } mark.hl-i { background: none; font-style: italic; } /* 28/10: in đậm / in nghiêng trên thanh tô màu */
