/* Trực tổng đài – TOEX English (luyện nghe TOEIC Part 3–4) */
:root {
  --kem: #FBF6EA; --the: #F6EDDB; --vien: #E2D8C0; --rung: #3A4A32; --olive: #5F6D45;
  --chu: #4A4A3E; --chu-phu: #625E51; --cam: #B25D2A; --cam-dam: #8F4519; --glacier: #86A3BB;
  --giay: #FFFCF4; --xanh-dam: #2F4A62; --do: #A0392A; --do-nen: #F7E3DC; --xanh-nen: #E6EDDA;
  --font: "Be Vietnam Pro", system-ui, sans-serif; --serif: "Lora", Georgia, serif;
  --bo: 8px; --bong: 0 10px 30px rgba(58, 74, 50, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--kem); color: var(--chu); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--xanh-dam); outline-offset: 2px; }
[hidden] { display: none !important; }
#app { min-height: 100dvh; }
.man { min-height: 100dvh; width: 100%; }

/* ---------- nút ---------- */
.nut { min-height: 44px; padding: 10px 18px; border-radius: var(--bo); border: 2px solid var(--rung); background: var(--giay); color: var(--rung); font-weight: 700; font-size: 15px; transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap; }
.nut:hover { background: #fff; }
.nut:active { transform: translateY(1px) scale(.98); }
.nut-chinh { background: var(--cam); border-color: var(--cam-dam); color: #fff; box-shadow: 0 3px 0 var(--cam-dam); }
.nut-chinh:hover { background: #BF6730; }
.nut-chinh:active { box-shadow: 0 1px 0 var(--cam-dam); transform: translateY(2px); }
.nut-phu { background: var(--giay); border-color: var(--vien); color: var(--rung); }
.nut-phu:hover { border-color: var(--olive); }
.nut-nho { min-height: 44px; padding: 6px 12px; font-size: 14px; }
.nut-rong { width: 100%; margin-top: 14px; }
.nut[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.nut-icon { width: 44px; height: 44px; border-radius: var(--bo); border: 1.5px solid rgba(251, 246, 234, .35); background: rgba(251, 246, 234, .08); color: var(--kem); display: grid; place-items: center; }
.nut-icon:hover { background: rgba(251, 246, 234, .2); }
.nut-icon .am-tat { display: none; } .nut-icon[aria-pressed="true"] .am-tat { display: block; } .nut-icon[aria-pressed="true"] .am-song { display: none; }
.nut-hud { min-height: 44px; padding: 0 12px; border-radius: var(--bo); border: 1.5px solid rgba(251, 246, 234, .35); background: transparent; color: var(--kem); font-size: 13px; font-weight: 600; }
.nut-dong { min-height: 44px; padding: 0 14px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); color: var(--rung); font-weight: 600; font-size: 14px; }

/* ---------- màn mở ---------- */
.man-mo { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.mo-tranh { background: url("assets/tong-dai/ban-truc.webp?v=20261118td1") 30% center / cover no-repeat; position: relative; min-height: 100dvh; }
.mo-tranh::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 70%, rgba(251, 246, 234, .9)); }
.mo-noi { padding: 28px clamp(20px, 4vw, 52px) 32px; padding-top: calc(28px + env(safe-area-inset-top)); max-width: 640px; align-self: center; }
.mo-ve { display: inline-flex; align-items: center; min-height: 44px; color: var(--olive); font-weight: 600; text-decoration: none; font-size: 14px; }
.mo-nhan { margin: 4px 0 2px; font-size: 13px; font-weight: 700; color: var(--olive); }
.man-mo h1, .tong-khung h1 { font-family: var(--serif); font-size: clamp(38px, 5vw, 54px); line-height: 1.08; margin: 0 0 10px; color: var(--rung); }
.mo-gt { margin: 0 0 16px; font-size: 16px; max-width: 52ch; }
.mo-hoc { border-left: 3px solid var(--olive); padding: 4px 0 4px 14px; margin: 0 0 16px; }
.mo-hoc-td { margin: 0 0 4px; font-weight: 700; color: var(--rung); font-size: 15px; }
.mo-hoc ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--chu-phu); }
.mo-hoc i { color: var(--chu); }
.mo-chuc { margin: 0 0 10px; font-size: 15px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.mo-chuc b { font-family: var(--serif); font-size: 19px; color: var(--rung); }
.mo-chuc span { color: var(--chu-phu); font-size: 14px; }
.mo-ca { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.the-ca { text-align: left; border: 1.5px solid var(--vien); background: var(--giay); border-radius: var(--bo); padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "so sao" "ten ten" "mo mo"; gap: 0 8px; min-height: 92px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.the-ca:hover:not(.khoa) { border-color: var(--olive); transform: translateY(-2px); box-shadow: var(--bong); }
.the-ca.khoa { background: var(--the); cursor: not-allowed; }
.the-ca.khoa .ca-ten { color: var(--chu-phu); }
.ca-so { grid-area: so; font-size: 12px; font-weight: 700; color: var(--olive); }
.ca-ten { grid-area: ten; font-family: var(--serif); font-weight: 700; font-size: 16.5px; color: var(--rung); line-height: 1.25; margin: 2px 0; }
.ca-mo { grid-area: mo; font-size: 12.5px; color: var(--chu-phu); line-height: 1.35; }
.ca-sao { grid-area: sao; justify-self: end; display: flex; gap: 3px; }
.ca-sao i, .sao-lon i { width: 12px; height: 12px; display: inline-block; background: var(--vien); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.ca-sao i.co, .sao-lon i.co { background: var(--cam); }
.mo-nut { display: flex; flex-wrap: wrap; gap: 8px; }
.mo-canh { margin: 12px 0 0; padding: 10px 12px; background: var(--the); border-radius: var(--bo); font-size: 14px; }

/* ---------- màn chơi ---------- */
.man-choi { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; background: var(--rung); color: var(--kem); padding: 2px 10px; padding-top: calc(2px + env(safe-area-inset-top)); min-height: 50px; }
.hud-trai { display: flex; gap: 10px; align-items: baseline; font-size: 14px; white-space: nowrap; }
.hud-ca { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.hud-giua { display: flex; gap: 8px; align-items: center; font-weight: 700; white-space: nowrap; }
.hud-chuoi { background: var(--cam); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.hud-phai { display: flex; gap: 6px; justify-content: flex-end; }
.than { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; padding: 18px clamp(12px, 3vw, 32px); padding-bottom: calc(18px + env(safe-area-inset-bottom)); overflow: auto; max-width: 1180px; width: 100%; margin: 0 auto; align-content: start; }

.khung-goi { background: var(--giay); border: 1.5px solid var(--vien); border-radius: 12px; padding: 16px 18px; box-shadow: var(--bong); align-self: start; position: relative; overflow: hidden; }
.khung-goi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--vien); transition: background .3s; }
.khung-goi.dang-noi::before { background: var(--olive); }
.g-dv { margin: 0; font-size: 13px; font-weight: 700; color: var(--olive); }
.g-tt { margin: 2px 0 10px; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--rung); display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.g-den { width: 10px; height: 10px; border-radius: 50%; background: var(--vien); flex: none; }
.dang-reo .g-den { background: var(--cam); }
.dang-noi .g-den { background: var(--olive); }
@media (prefers-reduced-motion: no-preference) {
  .dang-reo .g-den { animation: nhay 0.9s ease-in-out infinite; }
  .dang-reo .nut-nhac { animation: rung-may 1.1s ease-in-out infinite; }
  .dang-noi .g-den { animation: nhay 1.4s ease-in-out infinite; }
}
@keyframes nhay { 50% { transform: scale(1.6); opacity: .5; } }
@keyframes rung-may { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-2.5deg); } 20%, 40% { transform: rotate(2.5deg); } }
.nut-nhac { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; font-size: 18px; }
.g-chao { margin: 0 0 8px; font-size: 14px; color: var(--chu-phu); font-style: italic; }
.g-hang { display: flex; gap: 8px; flex-wrap: wrap; }
.g-hang .nut { flex: 1 1 auto; }
.g-cau { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-cau { min-height: 44px; min-width: 64px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--vien); background: var(--kem); font-size: 13.5px; font-weight: 600; color: var(--rung); transition: background .15s, border-color .15s; }
.chip-cau:hover:not([disabled]) { border-color: var(--olive); }
.chip-cau.dang { background: var(--olive); border-color: var(--olive); color: #fff; }
.chip-cau[disabled] { opacity: .45; }
.g-pho { margin-top: 12px; border-top: 1px solid var(--vien); padding-top: 10px; max-height: 32dvh; overflow: auto; font-size: 15px; }
.g-pho p { margin: 0 0 6px; padding: 2px 6px; border-radius: 4px; transition: background .2s; }
.g-pho p.dang { background: var(--xanh-nen); }
.g-pho.mo p[data-i] { color: #8A8676; }
.g-pho.mo b { font-weight: 500; filter: blur(3.5px); }
.g-pho.ro b { color: var(--rung); }
.g-pho .pho-ghi { font-size: 13px; color: var(--chu-phu); font-style: italic; }
.g-pho b.to, .kq-cau b.to { background: #F3D9A8; color: var(--chu); padding: 0 3px; border-radius: 3px; }
.g-pho b.nhieu, .kq-cau b.nhieu { text-decoration: line-through; text-decoration-color: rgba(160, 57, 42, .6); }

.phieu { background: var(--the); border: 1.5px solid var(--vien); border-radius: 12px; padding: 14px 16px 16px; align-self: start; position: sticky; top: 0; }
.phieu-td { margin: 0 0 10px; font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--rung); }
.phieu-o { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.o { text-align: left; min-height: 58px; padding: 7px 12px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); display: grid; gap: 1px; align-content: center; transition: border-color .15s, background .2s; }
.o:hover:not([disabled]) { border-color: var(--olive); }
.o-nhan { font-size: 12px; font-weight: 700; color: var(--olive); }
.o-gt { font-size: 15px; font-weight: 600; color: var(--chu); line-height: 1.3; overflow-wrap: anywhere; }
.o.trong .o-gt { color: var(--chu-phu); font-weight: 500; font-style: italic; }
.o.dung { border-color: var(--olive); background: var(--xanh-nen); }
.o.sai { border-color: var(--do); background: var(--do-nen); }
.o.sai .o-nhan { color: var(--do); }
.o.khoa { opacity: .75; }
.o[disabled] { cursor: default; }
.nut-gui { width: 100%; min-height: 52px; font-size: 17px; }
.phieu-meo { margin: 12px 0 0; font-size: 13.5px; color: var(--chu-phu); padding-top: 10px; border-top: 1px dashed var(--vien); }
.phieu-meo b { color: var(--rung); }

/* ---------- sửa theo đánh giá GPT (ux1) ---------- */
.mo-bat { width: 100%; max-width: 360px; min-height: 52px; font-size: 17px; margin: 0 0 16px; display: block; }
.g-pho-hop { margin-top: 12px; border-top: 1px solid var(--vien); }
.g-pho-hop > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--rung); list-style: none; }
.g-pho-hop > summary::-webkit-details-marker { display: none; }
.g-pho-hop > summary::after { content: "+"; font-size: 20px; color: var(--cam-dam); }
.g-pho-hop[open] > summary::after { content: "\2212"; }
.g-pho-hop .g-pho { margin-top: 0; }
@media (min-width: 861px) { .g-pho-hop > summary { display: none; } .g-pho-hop { margin-top: 0; border-top: 0; } .g-pho-hop .g-pho { margin-top: 12px; } }
@media (max-height: 460px) and (orientation: landscape) { .g-pho-hop > summary { display: none; } .g-pho-hop { margin-top: 0; border-top: 0; } .g-pho-hop .g-pho { margin-top: 8px; } }
.nut-gui.cho { background: var(--giay); color: var(--cam-dam); border-color: var(--cam); box-shadow: none; }
.mo-hoc ul, .sh-ghi, .g-chao, .phieu-meo, .g-pho .pho-ghi { color: #3E4637; }
.mo-hoc ul { font-size: 15px; } .sh-ghi { font-size: 15px; } .g-chao { font-size: 14.5px; }
.o { border-color: #B9AE91; }
.o-nhan { font-size: 13px; color: #4A5A32; }
.nut-chon { border-color: #B9AE91; }
.sheet.gan { inset: 0; display: block; pointer-events: none; }

/* ---------- bảng trượt ---------- */
.man-mo-nen { position: fixed; inset: 0; background: rgba(30, 38, 26, .55); z-index: 20; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 21; display: flex; justify-content: center; pointer-events: none; }
.sh-khung { pointer-events: auto; width: min(560px, 100%); max-height: 88dvh; display: flex; flex-direction: column; background: var(--kem); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(30, 38, 26, .3); padding-bottom: env(safe-area-inset-bottom); }
.sh-dau { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 8px 18px; border-bottom: 1px solid var(--vien); }
.sh-td { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--rung); }
.sh-than { overflow: auto; padding: 12px 18px 18px; }
.sh-ghi { margin: 0 0 12px; font-size: 14px; color: var(--chu-phu); }
.sh-nho { margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--olive); }
.nut-chon { min-height: 48px; padding: 6px 12px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); font-weight: 600; font-size: 15px; color: var(--chu); transition: background .12s, border-color .12s; }
.nut-chon:hover { border-color: var(--olive); }
.nut-chon[aria-pressed="true"] { background: var(--rung); border-color: var(--rung); color: var(--kem); }
.luoi-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chu-ten { font-size: 18px; letter-spacing: .02em; min-height: 56px; }
.so-man { font-size: 26px; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 10px; background: var(--giay); border: 1.5px solid var(--vien); border-radius: var(--bo); margin-bottom: 10px; color: var(--rung); font-variant-numeric: tabular-nums; }
.so-man.trong { font-size: 16px; font-weight: 500; color: var(--chu-phu); letter-spacing: 0; padding: 16px 10px; }
.phim-so { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.phim { min-height: 54px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); font-size: 22px; font-weight: 600; color: var(--rung); }
.phim:active { background: var(--the); }
.phim-xoa { font-size: 15px; }
.phim-xong { background: var(--cam); border-color: var(--cam-dam); color: #fff; font-size: 16px; font-weight: 700; }
.lich-thang { margin: 0 0 6px; font-family: var(--serif); font-weight: 700; color: var(--rung); }
.lich-luoi { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lich-thu { text-align: center; font-size: 12px; font-weight: 700; color: var(--olive); padding: 2px 0; }
.lich-ngay { min-height: 44px; padding: 0; font-size: 15px; }
.gio-xem { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--rung); text-align: center; }
.luoi-gio { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.nut-gio { padding: 2px; line-height: 1.1; display: grid; place-items: center; }
.nut-gio small { font-size: 12px; font-weight: 500; opacity: .85; }
.luoi-phut { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ds-chon { display: grid; gap: 6px; }
.dong-chon { text-align: left; }
.dong-chon[aria-pressed="true"]::before { content: "✓ "; }

/* ---------- hộp thoại ---------- */
.hop { position: fixed; inset: 0; z-index: 30; background: rgba(30, 38, 26, .6); display: grid; place-items: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.hop-khung { width: min(620px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--kem); border-radius: 14px; box-shadow: 0 20px 60px rgba(20, 28, 18, .4); }
.hop-dau { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 8px; }
.hop-td { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--rung); }
.hop-than { overflow: auto; padding: 0 18px 18px; }
.hd-buoc { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 8px; }
.hd-ghi { margin: 0; font-size: 14px; color: var(--chu-phu); }
.kq-diem { margin: 0 0 10px; font-weight: 700; color: var(--cam-dam); }
.kq-ds { display: grid; gap: 8px; }
.kq-dong { border-radius: var(--bo); padding: 8px 12px; border: 1.5px solid var(--vien); background: var(--giay); }
.kq-dong.dung { border-color: #C9D3B5; }
.kq-dong.sai { border-color: #E3B8AC; background: #FCF1EC; }
.kq-nhan { margin: 0; font-size: 12px; font-weight: 700; color: var(--olive); }
.kq-dong.sai .kq-nhan { color: var(--do); }
.kq-gt { margin: 0; font-weight: 600; }
.kq-dong.dung .kq-gt::before { content: "✓ "; color: var(--olive); }
.kq-gt s { color: var(--do); text-decoration-thickness: 1.5px; }
.kq-dap { margin: 2px 0 0; }
.kq-cau { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--glacier); background: #F1F4F6; border-radius: 0 4px 4px 0; font-size: 15px; }
.kq-huong { margin: 0 0 10px; font-size: 14px; }
.kq-cau-hang { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; margin-top: 6px; }
.kq-cau-hang .kq-cau { margin: 0; }
.g-pho b.che, .kq-cau b.che { color: transparent; background: #DCD3BC; border-radius: 3px; filter: none; user-select: none; }
.kq-meo { margin: 6px 0 0; font-size: 13.5px; color: var(--chu-phu); }
.kq-bay { margin: 10px 0 0; font-size: 14px; color: var(--xanh-dam); }
.kq-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: flex-end; position: sticky; bottom: -18px; background: var(--kem); padding: 10px 0 18px; margin-bottom: -18px; box-shadow: 0 -8px 12px -8px rgba(58,74,50,.18); }
.tiep p { margin: 0; }

/* ---------- tổng kết ---------- */
.man-tong { padding: 24px 16px 40px; padding-top: calc(24px + env(safe-area-inset-top)); }
.tong-khung { max-width: 720px; margin: 0 auto; }
.sao-lon { display: flex; gap: 8px; margin: 4px 0 8px; }
.sao-lon i { width: 40px; height: 40px; }
.t-so { margin: 0; font-size: 17px; font-weight: 700; color: var(--rung); }
.t-tb { margin: 6px 0 0; font-size: 15px; }
.t-tb.len { display: inline-block; background: var(--rung); color: var(--kem); border-radius: var(--bo); padding: 6px 12px; font-weight: 700; }
.tong-khung h2 { font-family: var(--serif); font-size: 20px; color: var(--rung); margin: 22px 0 8px; }
.t-ghi { margin: -4px 0 8px; font-size: 14px; color: var(--chu-phu); }
.t-bang { display: grid; gap: 6px; }
.t-dong { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; background: var(--giay); border: 1.5px solid var(--vien); border-radius: var(--bo); }
.t-stt { font-weight: 700; color: var(--olive); }
.t-dv { font-weight: 600; }
.t-dv small { display: block; font-weight: 400; color: var(--chu-phu); font-size: 13px; }
.t-o { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--do); }
.t-o.du { color: var(--olive); }
.t-mau { display: grid; gap: 6px; }
.t-bay { display: grid; gap: 6px; }
.bay-dong { padding: 8px 12px; border-left: 3px solid var(--cam); background: var(--giay); border-radius: 0 var(--bo) var(--bo) 0; }
.bay-ten { margin: 0; font-weight: 700; color: var(--rung); }
.bay-gt { margin: 2px 0 0; font-size: 14px; color: var(--chu-phu); }
.sot-dong { border-left-color: var(--olive); }
.sot-so { font-weight: 600; font-size: 14px; color: var(--do); margin-left: 6px; }
.mau-dong, .socau-dong { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; background: var(--giay); border: 1.5px solid var(--vien); border-radius: var(--bo); }
.nut-nghe { width: 44px; height: 44px; border-radius: var(--bo); border: none; background: var(--rung); color: var(--kem); display: grid; place-items: center; }
.mau-en { margin: 0; font-weight: 600; }
.mau-vi { margin: 0; font-size: 14px; color: var(--chu-phu); }
.t-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

/* ---------- sổ lỗi ---------- */
.loi-dong { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--vien); }
.loi-ten { margin: 0; font-weight: 700; color: var(--rung); }
.loi-so { margin: 0; font-size: 13px; color: var(--chu-phu); }
.loi-thanh { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--the); overflow: hidden; }
.loi-thanh i { display: block; height: 100%; background: var(--cam); }
.loi-chip { display: flex; flex-wrap: wrap; gap: 6px; }
.socau-dong { margin-bottom: 6px; }
.socau-chu { margin: 0; font-size: 14.5px; }
.socau-k { display: block; font-size: 12px; font-weight: 700; color: var(--do); }

/* ---------- thông báo nhỏ ---------- */
.bao { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; background: var(--rung); color: var(--kem); padding: 10px 16px; border-radius: var(--bo); font-size: 14px; box-shadow: var(--bong); max-width: calc(100% - 32px); }

/* ---------- điện thoại ---------- */
@media (max-width: 860px) {
  .man-mo { grid-template-columns: 1fr; }
  .mo-tranh { min-height: 0; height: 30dvh; max-height: 240px; }
  .mo-tranh::after { background: linear-gradient(180deg, transparent 60%, var(--kem)); }
  .mo-noi { padding: 4px 16px 28px; margin-top: -24px; position: relative; }
  .than { grid-template-columns: 1fr; gap: 10px; padding: 10px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .phieu { position: static; }
}
@media (max-width: 520px) {
  .hud { grid-template-columns: auto 1fr auto; padding-left: 10px; padding-right: 6px; }
  .hud-trai { font-size: 13px; gap: 6px; flex-direction: column; gap: 0; line-height: 1.15; }
  .hud-ca { font-size: 16px; }
  .hud-giua { justify-content: center; font-size: 14px; }
  .hud-chuoi { font-size: 12px; padding: 1px 8px; }
  .nut-hud { font-size: 12px; padding: 0 8px; max-width: 80px; white-space: normal; line-height: 1.1; }
  .khung-goi { padding: 10px 12px; border-radius: 10px; }
  .g-tt { font-size: 17px; margin-bottom: 6px; }
  .g-chao { font-size: 13px; margin-bottom: 6px; }
  .g-cau { margin-top: 6px; }
  .chip-cau { min-width: 0; flex: 1 1 0; padding: 0 6px; }
  .g-pho { max-height: 22dvh; font-size: 14.5px; margin-top: 8px; padding-top: 6px; }
  .phieu { padding: 10px 10px 12px; }
  .phieu-td { font-size: 16px; margin-bottom: 6px; }
  .phieu-o { gap: 6px; margin-bottom: 8px; }
  .o { min-height: 52px; padding: 5px 10px; }
  .o-gt { font-size: 14px; }
  .phieu-meo { display: none; }
  .mo-tranh { height: 22dvh; }
  .luoi-gio { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .the-ca { min-height: 86px; padding: 8px 10px; }
  .ca-mo { font-size: 12px; }
  .hop { padding: 8px; align-items: end; }
  .hop-khung { max-height: calc(100dvh - 16px); }
}
@media (max-height: 460px) and (orientation: landscape) {
  .man-mo { grid-template-columns: 34% 1fr; }
  .mo-tranh { height: auto; min-height: 100dvh; max-height: none; }
  .than { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); padding: 8px 12px; gap: 10px; }
  .phieu { position: static; }
  .phieu-o { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
  .o { min-height: 48px; padding: 4px 8px; }
  .o-gt { font-size: 13.5px; }
  .phieu { padding: 8px 10px 10px; }
  .phieu-td { font-size: 15px; margin-bottom: 4px; }
  .phieu-meo { display: none; }
  .nut-gui { min-height: 46px; }
  .khung-goi { padding: 8px 12px; }
  .g-pho { max-height: 34dvh; }
  .sh-khung { max-height: 96dvh; }
  .phim { min-height: 44px; font-size: 18px; }
  .phim-so { grid-template-columns: repeat(6, 1fr); }
  .lich-ngay, .nut-chon { min-height: 44px; }
  .hop-khung { max-height: calc(100dvh - 16px); }
  .hop { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ===== Cuộc kiểu đề thật (Part 3 hội thoại, Part 4 độc thoại): ba câu hỏi trắc nghiệm ===== */
.nguoi { font-weight: 700; color: var(--olive); }
.khung-goi.de .g-cau, .khung-goi.de #g-cham { display: none; }
.khung-goi.de .g-chao { font-style: normal; }
.phieu.de { position: static; }
.phieu-o.de { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cd { display: grid; gap: 6px; }
.cd-q { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--chu); }
.cd-so { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--rung); color: var(--kem); font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.cd-ds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cd-opt { text-align: left; min-height: 44px; padding: 6px 10px; border-radius: var(--bo); border: 1.5px solid var(--vien); background: var(--giay); display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.3; color: var(--chu); transition: border-color .15s, background .15s; }
.cd-opt:hover:not([disabled]) { border-color: var(--olive); }
.cd-chu { flex: none; width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--vien); font-size: 12px; font-weight: 700; display: grid; place-items: center; color: var(--olive); margin-top: 1px; }
.cd-nd { min-width: 0; overflow-wrap: anywhere; align-self: center; }
.cd-opt.chon { border-color: var(--rung); background: var(--xanh-nen); }
.cd-opt.chon .cd-chu { background: var(--rung); border-color: var(--rung); color: var(--kem); }
.cd-opt.dung { border-color: var(--olive); background: var(--xanh-nen); }
.cd-opt.dung .cd-chu { background: var(--olive); border-color: var(--olive); color: #fff; }
.cd-opt.sai { border-color: var(--do); background: var(--do-nen); }
.cd-opt.sai .cd-chu { background: var(--do); border-color: var(--do); color: #fff; }
.cd-opt[disabled] { cursor: default; }
.kq-hoi { margin: 2px 0 4px; font-size: 14.5px; color: var(--chu); }
.kq-cau mark { background: #F3D9A8; color: var(--chu); padding: 0 2px; border-radius: 3px; }
.de-loi { margin-top: 10px; border: 1.5px solid var(--vien); border-radius: var(--bo); background: var(--giay); padding: 6px 12px; }
.de-loi summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--rung); }
.de-thoai p { margin: 0 0 6px; font-size: 14.5px; }
.de-vi { margin: 6px 0; font-size: 14px; color: var(--chu-phu); }
.de-sai { padding: 10px 12px; border-left: 3px solid var(--do); background: var(--giay); border-radius: 0 var(--bo) var(--bo) 0; }
.nhieu-sai { border-left-color: var(--do); }
@media (max-width: 520px) {
  .phieu-o.de { gap: 10px; }
  .cd-ds { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .cd-q { font-size: 14.5px; }
  .cd-opt { min-height: 44px; padding: 5px 8px; font-size: 14px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .phieu-o.de { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
/* hai khối xếp dọc ở điện thoại: hàng không được co lại khi phiếu cao hơn màn hình (khung gọi có overflow: hidden) */
.than { grid-auto-rows: max-content; }
/* k12: ba nút màn kết quả trên điện thoại – hai nút phụ chia đôi một hàng, nút chính cả hàng bên dưới */
@media (max-width: 560px) {
  .kq-nut { display: grid; grid-template-columns: 1fr 1fr; }
  .kq-nut .nut { width: 100%; }
  .kq-nut:has(> .nut:nth-child(3)) .nut-chinh, .kq-nut .nut:only-child { grid-column: 1 / -1; }
}
/* k12: viền ô phiếu, ô chọn, thẻ ca đạt 3:1 trên nền kem; phụ đề dạng mờ đọc được (≥ 4,5:1) – chỉ chi tiết cần nghe vẫn bị làm nhoè */
.o, .nut-chon, .chu-ten, .the-ca, .nut-phu, .chip-cau, .lich-ngay, .nut-gio, .dong-chon { border-color: #978C6D; }
.g-pho-hop { border-top-color: #978C6D; }
.g-pho.mo p[data-i] { color: #5B5748; }
#phieu-o .o { border-color: #877C5F; }

.g-mo { display: none; }
/* ---------- vòng 2 (ux2): bỏ nghiêng, chữ đậm rõ, nút nghe lại có chữ, dải cuộc gọi gọn ---------- */
.g-chao, .g-pho .pho-ghi, .o.trong .o-gt, .mo-hoc i, .khung-goi.de .g-chao { font-style: normal; }
.mo-hoc i { font-weight: 700; color: var(--rung); }
.mo-hoc ul, .sh-ghi, .g-chao, #g-nhac, .hd-ghi, .kq-huong, .phieu-meo, .g-pho .pho-ghi { color: #2F382A; font-size: 15px; line-height: 1.45; }
.o-nhan { font-size: 13.5px; font-weight: 700; color: #3A4A28; letter-spacing: .01em; }
.o.trong .o-gt { color: #4A4F3E; font-weight: 600; font-size: 15px; }
.kq-nhan { font-size: 13.5px; color: #3A4A28; }
.kq-dong.sai .kq-nhan { color: #8E2F20; }
.kq-sot { margin: 4px 0 2px; font-size: 14.5px; font-weight: 600; color: #8E2F20; line-height: 1.4; }
.kq-cau-hang { grid-template-columns: 1fr; gap: 6px; }
.nut-nghe.nut-nghe-cau { width: auto; min-height: 44px; padding: 0 16px; gap: 8px; justify-self: start; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; }
@media (max-width: 860px) and (orientation: portrait) {
  .khung-goi:has(#g-nut:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "dv lai" "tt lai" "b1 b1" "b2 b2" "b3 b3" "pho pho" "nhac nhac"; column-gap: 10px; align-items: center; padding: 8px 12px; }
  .khung-goi:has(#g-nut:not([hidden])) .g-dv { grid-area: dv; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .khung-goi:has(#g-nut:not([hidden])) .g-tt { grid-area: tt; margin: 0; font-size: 16px; }
  .khung-goi:has(#g-nut:not([hidden])) #g-nut, .khung-goi:has(#g-nut:not([hidden])) .g-hang { display: contents; }
  .khung-goi:has(#g-nut:not([hidden])) #g-lai, .khung-goi:has(#g-nut:not([hidden])) #g-mo { grid-area: lai; align-self: center; min-height: 48px; padding: 0 14px; white-space: normal; max-width: 150px; line-height: 1.2; font-size: 14px; }
  .khung-goi:has(#g-nut:not([hidden])) #g-chao { display: none; }
  /* cuộc phiếu: "Nghe lại" mở bảng gồm nghe lại cả cuộc, xin nhắc lại, từng câu, phụ đề – cùng luật trừ lượt như máy tính */
  .khung-goi:has(#g-nut:not([hidden])):not(.de) #g-mo:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
  #g-mo small { display: block; font-size: 12.5px; font-weight: 600; opacity: .9; }
  #g-mo .g-mo-c { display: grid; text-align: left; line-height: 1.15; }
  .khung-goi:has(#g-nut:not([hidden])):not(.de) #g-mo::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
  .khung-goi:has(#g-nut:not([hidden])).mo-nghe:not(.de) #g-mo { background: var(--rung); border-color: var(--rung); color: #fff; }
  .khung-goi:has(#g-nut:not([hidden])).mo-nghe:not(.de) #g-mo::after { transform: translateY(2px) rotate(-135deg); }
  .khung-goi:has(#g-nut:not([hidden])):not(.de):not(.mo-nghe) #g-lai, .khung-goi:has(#g-nut:not([hidden])):not(.de):not(.mo-nghe) #g-cham, .khung-goi:has(#g-nut:not([hidden])):not(.de):not(.mo-nghe) .g-cau { display: none; }
  .khung-goi:has(#g-nut:not([hidden])).mo-nghe:not(.de) #g-lai { grid-area: b1; max-width: none; width: 100%; margin-top: 8px; }
  .khung-goi:has(#g-nut:not([hidden])).mo-nghe:not(.de) #g-cham { grid-area: b2; width: 100%; min-height: 48px; margin-top: 6px; font-size: 14px; }
  .khung-goi:has(#g-nut:not([hidden])).mo-nghe:not(.de) .g-cau { grid-area: b3; margin-top: 6px; }
  .khung-goi:has(#g-nut:not([hidden])) #g-nhac { grid-area: nhac; margin: 6px 0 0; font-size: 14px; line-height: 1.35; }
  .khung-goi:has(#g-nut:not([hidden])):not(.mo-nghe) .g-pho-hop:not(:has(.g-pho.ro)) { display: none; }
  .khung-goi:has(#g-nut:not([hidden])) .g-pho-hop { grid-area: pho; }
  .khung-goi:has(#g-nut:not([hidden])) .g-pho-hop { grid-column: 1 / -1; margin-top: 6px; }
  .nut-gui { position: sticky; bottom: calc(6px + env(safe-area-inset-bottom)); z-index: 3; box-shadow: 0 -6px 10px -4px rgba(58, 74, 50, .25); }
  .phieu { padding-bottom: 8px; }
  .phieu-td { font-size: 17px; }
  .o { min-height: 56px; }
  .o-gt { font-size: 15px; }
}

/* ---------- 20261118ux3: chữ khoá ca và sao rõ hơn; nút Gửi trung tính khi phiếu còn trống; máy tính rộng chữ hội thoại to hơn ---------- */
.ca-mo { font-size: 13.5px; font-weight: 600; color: #45423A; }
.the-ca.khoa .ca-ten { color: #45423A; }
.ca-sao i { background: #7D7358; }
.ca-sao i.co { background: var(--cam); }
.nut-gui.rong, .nut-gui.cho.rong { background: var(--giay); color: #3E3B32; border-color: #7D7358; border-style: dashed; box-shadow: none; }
@media (min-width: 1200px) {
  .g-dv { font-size: 14.5px; }
  .g-tt { font-size: 22px; }
  .g-chao { font-size: 17px; }
  .g-pho { font-size: 17.5px; line-height: 1.55; }
  .g-pho .pho-ghi { font-size: 15px; }
  .khung-goi .nut-nho { font-size: 15.5px; }
  .chip-cau { font-size: 15px; }
  .phieu-td { font-size: 21px; }
  .o-gt { font-size: 17px; }
  .o-nhan { font-size: 15px; }
  .phieu-meo { font-size: 17px; line-height: 1.5; }
  .nut-gui { font-size: 18px; min-height: 56px; }
}
@media (min-width: 1200px) and (min-height: 700px) {
  .g-pho { max-height: 46dvh; }
}
