/* Luyện thi HSA Ngôn ngữ - Văn học. Màu thương hiệu: xanh lá #0F6E56, vàng đồng #BA7517. */
:root {
  --xanh: #0F6E56; --xanh-dam: #0a5442; --xanh-nhat: #e7f3ef;
  --vang: #BA7517; --vang-dam: #96600f; --vang-nhat: #fcf2e2;
  --chu: #1c2421; --phu: #5a6560; --nen: #f5f6f3; --the: #ffffff; --vien: #dce3df;
  --do: #b83227; --do-nhat: #fdeceb; --dung: #1e7d4a; --dung-nhat: #e6f5ec;
  --to-vang: #ffe680; --to-xanh: #bfe7ff;
  --n1: #0F6E56; --n2: #7a4bb5; --n3: #BA7517; --n4: #1f6fb2; --n5: #b23a5e;
  --chu-doc: "Times New Roman", "Noto Serif", Georgia, serif;
  --chu-giao-dien: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --co: 16px; --bo: 10px; --bong: 0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { font-size: var(--co); }
body { margin: 0; background: var(--nen); color: var(--chu); font-family: var(--chu-giao-dien); line-height: 1.55; padding-bottom: 46px; }
a { color: var(--xanh); }
button { font: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.2rem; color: var(--xanh-dam); } h3 { font-size: 1.05rem; }

/* ---------- Đầu app ---------- */
.dau-app { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--xanh); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.logo-dau { background: var(--vang); padding: 3px 10px; border-radius: 6px; font-weight: 800; letter-spacing: 1px; }
.logo-chu { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.logo-chu b { font-size: 1.05rem; }
.logo-chu small { font-size: .72rem; opacity: .85; letter-spacing: .3px; }
.menu-chinh a i { font-style: normal; margin-right: 5px; }
.dau-app .nut-cai { background: var(--vang); color: #fff; border-color: var(--vang); font-weight: 600; }
.menu-chinh { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.menu-chinh::-webkit-scrollbar, .tab-cd::-webkit-scrollbar, .menu-cd::-webkit-scrollbar { display: none; }
.menu-chinh a { color: #e5f3ee; text-decoration: none; padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
.menu-chinh a:hover { background: rgba(255,255,255,.12); }
.menu-chinh a.dang-chon { background: #fff; color: var(--xanh-dam); font-weight: 600; }
.dau-app .nut-tivi { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }

#noi-dung { max-width: 1180px; margin: 0 auto; padding: 24px 20px 30px; }
#chan-trang { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 9px 16px; background: #10251f; color: #cfe2db; font-size: .82rem; text-align: center; }
#chan-trang a { color: #ffd38a; }

/* ---------- Thành phần chung ---------- */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--vien); border-radius: 8px; background: var(--the); color: var(--chu); cursor: pointer; text-decoration: none; font-size: .95rem; line-height: 1.2; }
.nut:hover { border-color: var(--xanh); }
.nut:disabled { opacity: .45; cursor: default; }
.nut.chinh { background: var(--xanh); border-color: var(--xanh); color: #fff; font-weight: 600; }
.nut.chinh:hover { background: var(--xanh-dam); }
.nut.lon { padding: 12px 22px; font-size: 1.05rem; margin-top: 10px; }
.nut.nho { padding: 3px 9px; font-size: .82rem; }
.nhom-nut, .hang-nut { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hang-nut { justify-content: flex-end; margin-top: 16px; }
.khoi { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 20px 22px; box-shadow: var(--bong); margin-bottom: 18px; }
.ghi-nho { color: var(--phu); font-size: .9rem; }
.dang-tai { color: var(--phu); text-align: center; padding: 40px; }
.nhan { display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--vang-dam); margin-bottom: 4px; }
.bang-tin { padding: 12px 16px; border-radius: 8px; background: var(--xanh-nhat); border-left: 4px solid var(--xanh); margin: 10px 0 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.bang-tin.canh-bao { background: var(--vang-nhat); border-color: var(--vang); }
.bang-tin.loi { background: var(--do-nhat); border-color: var(--do); }
.nhan-nhom { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: .78rem; font-weight: 700; color: #fff; white-space: nowrap; }
.nhan-cap { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid; }
.nhan-cap.c1 { color: var(--dung); border-color: var(--dung); } .nhan-cap.c2 { color: var(--vang-dam); border-color: var(--vang); } .nhan-cap.c3 { color: var(--do); border-color: var(--do); }
.nhan-nhom.n1 { background: var(--n1); } .nhan-nhom.n2 { background: var(--n2); } .nhan-nhom.n3 { background: var(--n3); } .nhan-nhom.n4 { background: var(--n4); } .nhan-nhom.n5 { background: var(--n5); }
.bang-cuon { overflow-x: auto; }
.bang { width: 100%; border-collapse: collapse; font-size: .95rem; }
.bang th, .bang td { border: 1px solid var(--vien); padding: 8px 10px; text-align: left; vertical-align: top; }
.bang th { background: var(--xanh-nhat); color: var(--xanh-dam); }
.bang .giua { text-align: center; }
ul.gach-ngang { list-style: none; padding-left: 0; margin: .4em 0 .8em; }
ul.gach-ngang li { position: relative; padding-left: 1.35em; margin: .3em 0; }
ul.gach-ngang li::before { content: "-"; position: absolute; left: .35em; font-weight: 700; color: var(--xanh); }
ul.gach-ngang.nho { font-size: .92rem; }

/* ---------- Trang chủ ---------- */
.dau-trang { text-align: center; padding: 26px 10px 18px; }
.dau-trang h1 { font-size: 2.3rem; color: var(--xanh-dam); }
.dau-trang h1 span { color: var(--vang); font-size: 1.5rem; }
.dau-trang p { max-width: 640px; margin: 0 auto; color: var(--phu); }
.hai-the { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 10px 0 22px; }
.the-lon { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 14px; background: linear-gradient(135deg, var(--xanh), var(--xanh-dam)); color: #fff; text-decoration: none; box-shadow: var(--bong); transition: transform .15s; }
.the-lon:hover { transform: translateY(-2px); }
.the-lon.vang { background: linear-gradient(135deg, var(--vang), var(--vang-dam)); }
.the-lon h2 { color: #fff; font-size: 1.4rem; margin: 0; }
.the-lon p { margin: 0; opacity: .93; }
.the-so { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.the-chan { margin-top: auto; padding-top: 10px; font-weight: 600; }

/* ---------- Chuyên đề ---------- */
.bo-cuc-cd { display: grid; grid-template-columns: 270px 1fr; gap: 20px; align-items: start; }
.menu-cd { position: sticky; top: 72px; background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 8px; max-height: calc(100vh - 140px); overflow: auto; }
.menu-cd-tieu-de { font-size: .78rem; font-weight: 700; text-transform: uppercase; color: var(--phu); padding: 6px 8px; }
.menu-cd a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; text-decoration: none; color: var(--chu); font-size: .93rem; }
.menu-cd a:hover { background: var(--nen); }
.menu-cd a.dang-chon { background: var(--xanh-nhat); color: var(--xanh-dam); font-weight: 600; }
.menu-cd a.chua-mo { color: var(--phu); }
.so-cd { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--xanh); color: #fff; font-size: .8rem; font-weight: 700; }
.chua-mo .so-cd { background: #b9c3be; }
.ten-cd { flex: 1; }
.khoa-nho { color: #9aa5a0; font-size: .8rem; }
.vung-cd { min-width: 0; }
.tieu-de-cd { margin-bottom: 14px; }
.tieu-de-cd h1 { color: var(--xanh-dam); }
.lien-quan { font-size: .9rem; color: var(--phu); }
.tab-cd { display: flex; gap: 6px; border-bottom: 2px solid var(--vien); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab-cd a { display: flex; flex-direction: column; padding: 8px 16px 10px; text-decoration: none; color: var(--phu); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; font-weight: 600; }
.tab-cd a span { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: #9aa5a0; }
.tab-cd a.dang-chon { color: var(--xanh-dam); border-color: var(--vang); }
.muc-ly-thuyet { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--bong); }
.muc-ly-thuyet h2 { border-left: 4px solid var(--vang); padding-left: 10px; }
.muc-ly-thuyet h3 { color: var(--vang-dam); margin-top: 1em; }
.doan { margin: .5em 0; }
.vi-du { border: 1px dashed var(--vien); border-radius: 8px; padding: 10px 14px; margin: 10px 0; background: #fbfcfb; }
.vi-du-nhan { font-weight: 700; font-size: .85rem; color: var(--phu); margin-bottom: 4px; }
.dong-sai, .dong-sua { display: flex; gap: 10px; align-items: baseline; margin: 3px 0; font-family: var(--chu-doc); font-size: 1.08rem; }
.nhan-vd { font-style: normal; flex: none; font-family: var(--chu-giao-dien); font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 4px; color: #fff; }
.dong-sai .nhan-vd { background: var(--do); } .dong-sua .nhan-vd { background: var(--dung); }
.vi-du-gt { color: var(--phu); font-size: .93rem; margin-top: 4px; }
.luu-y { background: var(--vang-nhat); border-left: 4px solid var(--vang); border-radius: 6px; padding: 10px 14px; margin: 12px 0; }
.luu-y strong { display: block; color: var(--vang-dam); margin-bottom: 3px; }
.cac-buoc { counter-reset: b; list-style: none; padding: 0; margin: 10px 0; }
.cac-buoc li { counter-increment: b; position: relative; padding: 8px 0 8px 46px; min-height: 40px; }
.cac-buoc li::before { content: counter(b); position: absolute; left: 0; top: 6px; width: 32px; height: 32px; border-radius: 50%; background: var(--xanh); color: #fff; display: grid; place-items: center; font-weight: 700; }
.cac-buoc li strong { display: block; }
.ds-bai { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 16px 16px 16px 40px; }
.ds-bai li { margin: 4px 0; }
.bt-tong { position: sticky; top: 64px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--xanh-nhat); border: 1px solid #c6e0d6; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.the-bt { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--bong); }

/* ---------- Danh mục đề ---------- */
.tieu-de-trang { margin-bottom: 18px; }
.tieu-de-trang h1 { color: var(--xanh-dam); }
.tieu-de-trang p { color: var(--phu); margin: 0; }
.luoi-de { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.the-de { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px; background: var(--the); border: 1px solid var(--vien); text-decoration: none; color: var(--chu); box-shadow: var(--bong); transition: transform .12s, border-color .12s; }
.the-de:hover { transform: translateY(-2px); border-color: var(--xanh); }
.the-de-so { font-size: 1.9rem; font-weight: 800; color: var(--xanh); line-height: 1; }
.the-de-ten { font-weight: 600; }
.the-de-chan { font-size: .85rem; color: var(--phu); }
.the-de-diem { font-size: .8rem; color: var(--vang-dam); font-weight: 600; }
.the-de.mo { border-color: var(--xanh); background: linear-gradient(180deg, #fff, var(--xanh-nhat)); }
.the-de.khoa { opacity: .78; }
.the-de.khoa .the-de-so { color: #a9b4af; }

/* ---------- Chuẩn bị ---------- */
.hai-cot { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.chuan-bi label { display: block; font-weight: 600; margin-bottom: 10px; }
.chuan-bi input[type=text], .chuan-bi input:not([type]) { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid var(--vien); border-radius: 8px; font: inherit; }
.chon-che-do { display: grid; gap: 8px; }
.o-che-do { display: flex !important; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--vien); border-radius: 8px; cursor: pointer; font-weight: 400 !important; }
.o-che-do:has(input:checked) { border-color: var(--xanh); background: var(--xanh-nhat); }
.o-che-do input { margin-top: 4px; }
.o-che-do span { display: flex; flex-direction: column; font-size: .92rem; color: var(--phu); }
.o-che-do strong { color: var(--chu); font-size: 1rem; }

/* ---------- Câu hỏi ---------- */
.than-cau { margin-bottom: 12px; }
.dau-cau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.so-cau { font-weight: 800; color: var(--xanh-dam); font-size: 1.1rem; }
.muc-do { font-size: .78rem; color: var(--phu); border: 1px solid var(--vien); border-radius: 20px; padding: 0 8px; }
.lenh-hoi { font-weight: 600; font-size: 1.05rem; }
.cau-dan { margin-top: 10px; padding: 12px 16px; background: #fbfaf6; border: 1px solid #ece4d3; border-radius: 8px; font-family: var(--chu-doc); font-size: 1.15rem; line-height: 1.9; }
.gach-chan u { text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--vang); }
.gach-chan sub { font-family: var(--chu-giao-dien); font-size: .7rem; font-weight: 800; color: var(--vang-dam); margin-left: 1px; }
.cho-trong { display: inline-block; min-width: 90px; border-bottom: 2px dotted var(--phu); color: transparent; line-height: 1; }
.cac-phuong-an { display: grid; gap: 9px; }
.cac-phuong-an.ngan { grid-template-columns: repeat(2, 1fr); }
.phuong-an { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 11px 14px; border: 2px solid var(--vien); border-radius: 10px; background: var(--the); cursor: pointer; color: var(--chu); font-family: var(--chu-doc); font-size: 1.1rem; line-height: 1.45; transition: border-color .1s, background .1s; }
.phuong-an:hover:not(:disabled) { border-color: var(--xanh); }
.phuong-an:disabled { cursor: default; }
.chu-pa { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--nen); border: 1px solid var(--vien); font-family: var(--chu-giao-dien); font-weight: 700; font-size: .95rem; }
.nd-pa { padding-top: 2px; }
.phuong-an.da-chon { border-color: var(--xanh); background: var(--xanh-nhat); }
.phuong-an.da-chon .chu-pa { background: var(--xanh); color: #fff; border-color: var(--xanh); }
.phuong-an.dung { border-color: var(--dung); background: var(--dung-nhat); }
.phuong-an.dung .chu-pa { background: var(--dung); color: #fff; border-color: var(--dung); }
.phuong-an.sai { border-color: var(--do); background: var(--do-nhat); }
.phuong-an.sai .chu-pa { background: var(--do); color: #fff; border-color: var(--do); }
.hang-nut-cau { display: flex; justify-content: flex-end; margin-top: 12px; gap: 8px; }
.hang-nut-cau:empty { display: none; }

/* Lời giải */
.loi-giai { margin-top: 16px; border: 1px solid #cfe3da; border-radius: 10px; background: #f8fcfa; padding: 14px 16px; }
.lg-dau { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 1.05rem; margin-bottom: 6px; }
.lg-dung, .lg-sai { font-size: .82rem; font-weight: 700; padding: 1px 9px; border-radius: 20px; color: #fff; }
.lg-dung { background: var(--dung); } .lg-sai { background: var(--do); }
.lg-tong { margin-bottom: 10px; }
.lg-phan-tich { display: grid; gap: 7px; }
.lg-pa { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--vien); font-size: .95rem; }
.lg-pa.dung { border-color: var(--dung); background: var(--dung-nhat); }
.lg-pa.da-chon-sai { border-color: var(--do); }
.lg-pa .chu-pa { width: 26px; height: 26px; font-size: .85rem; }
.the-nho { display: inline-block; font-size: .72rem; font-weight: 700; padding: 0 7px; border-radius: 4px; background: #eef0ee; color: var(--phu); margin-right: 6px; }
.the-nho.xanh { background: var(--dung); color: #fff; }
.lg-meo { margin-top: 10px; padding: 8px 12px; background: var(--vang-nhat); border-radius: 8px; font-size: .95rem; }

/* Ngữ liệu */
.ngu-lieu { font-family: var(--chu-doc); font-size: 1.12rem; line-height: 1.75; }
.nl-dan { font-family: var(--chu-giao-dien); font-weight: 700; font-size: .95rem; color: var(--xanh-dam); margin-bottom: 8px; }
.nl-noi-dung p { margin: 0 0 .7em; text-indent: 1.27cm; text-align: justify; }
.nl-tho { white-space: pre-line; padding-left: 1.27cm; }
.nl-pham-vi { font-style: italic; color: var(--phu); font-size: .95rem; }
.nl-nguon { text-align: right; font-style: italic; color: var(--phu); font-size: .98rem; margin-top: 6px; }
.nl-chu-thich { font-size: .92rem; color: var(--phu); padding-left: 22px; }
.nl-ngan { background: #fbfaf6; border: 1px solid #ece4d3; border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; }
mark.to-vang { background: var(--to-vang); cursor: pointer; border-radius: 2px; }
mark.to-xanh { background: var(--to-xanh); cursor: pointer; border-radius: 2px; }

/* ---------- Phòng thi ---------- */
body.dang-thi { padding-bottom: 0; overflow: hidden; }
body.dang-thi .dau-app, body.dang-thi #chan-trang { display: none; }
body.dang-thi #noi-dung { max-width: none; padding: 0; }
.phong-thi { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: var(--nen); }
.thanh-thi { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--xanh); color: #fff; }
.thanh-thi .nut { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.thanh-thi .nut.chinh { background: var(--vang); border-color: var(--vang); }
.thanh-thi .nut[aria-pressed=true] { background: #fff; color: var(--xanh-dam); }
.nut-bang-cau { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.tt-de { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-de strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-de span { font-size: .82rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dong-ho { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.2); padding: 3px 14px; border-radius: 8px; }
.dh-nhan { font-size: .68rem; text-transform: uppercase; opacity: .8; }
.dh-so { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.dong-ho.gap { background: var(--vang); }
.dong-ho.rat-gap { background: var(--do); animation: nhay 1s infinite; }
@keyframes nhay { 50% { opacity: .65; } }
.than-thi { display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
.bang-cau { background: var(--the); border-right: 1px solid var(--vien); padding: 12px; overflow-y: auto; }
.bc-tong { font-size: .9rem; margin-bottom: 10px; color: var(--phu); }
.bc-nhom { margin-bottom: 12px; }
.bc-ten { margin-bottom: 5px; }
.bc-luoi { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.o-cau { position: relative; aspect-ratio: 1; border: 1px solid var(--vien); border-radius: 6px; background: #fff; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--chu); padding: 0; }
.o-cau.da-lam { background: var(--xanh); color: #fff; border-color: var(--xanh); }
.o-cau.co-co::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--vang); border: 2px solid #fff; }
.o-cau.hien-tai { outline: 3px solid var(--vang); outline-offset: 1px; }
.o-cau.dung { background: var(--dung); border-color: var(--dung); color: #fff; }
.o-cau.sai { background: var(--do); border-color: var(--do); color: #fff; }
.bc-chu-giai { display: flex; gap: 12px; font-size: .75rem; color: var(--phu); margin-top: 6px; }
.o-mau { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--vien); }
.o-mau.da-lam { background: var(--xanh); } .o-mau.co-co { background: var(--vang); border-radius: 50%; }
.vung-cau { min-height: 0; overflow: hidden; }
.mot-cot { height: 100%; overflow-y: auto; padding: 22px 28px 40px; max-width: 980px; margin: 0 auto; }
.chia-doi { height: 100%; display: grid; grid-template-columns: 50% 10px 1fr; min-height: 0; }
.cot-ngu-lieu { display: flex; flex-direction: column; min-height: 0; background: #fffdf8; border-right: 1px solid var(--vien); }
.cong-cu-to { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid #ece4d3; background: #fbf6ea; }
.ct-nhan { flex: 1; font-size: .82rem; font-weight: 700; color: var(--vang-dam); }
.to { border: 1px solid var(--vien); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: .85rem; background: #fff; }
.to.vang { background: var(--to-vang); } .to.xanh { background: var(--to-xanh); }
.cuon-ngu-lieu { flex: 1; overflow-y: auto; padding: 18px 24px 40px; }
.thanh-keo { cursor: col-resize; background: linear-gradient(90deg, transparent 4px, var(--vien) 4px, var(--vien) 6px, transparent 6px); touch-action: none; }
.thanh-keo:hover { background: linear-gradient(90deg, transparent 3px, var(--vang) 3px, var(--vang) 7px, transparent 7px); }
.cot-cau { overflow-y: auto; padding: 20px 26px 40px; }
.chan-thi { display: flex; justify-content: space-between; gap: 8px; padding: 8px 16px; background: var(--the); border-top: 1px solid var(--vien); }
.nut-danh-dau.dang-bat { background: var(--vang-nhat); border-color: var(--vang); color: var(--vang-dam); font-weight: 700; }

/* Giấy nháp */
.giay-nhap { position: fixed; right: 24px; bottom: 70px; width: 360px; height: 300px; min-width: 240px; min-height: 160px; z-index: 40; display: flex; flex-direction: column; background: #fffef5; border: 1px solid #e3d9a8; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); resize: both; overflow: hidden; }
.gn-dau { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #f4ecc4; cursor: move; font-weight: 700; font-size: .9rem; user-select: none; touch-action: none; }
.gn-dau button { border: 0; background: transparent; cursor: pointer; font-size: .85rem; padding: 2px 6px; }
.gn-dong { font-size: 1.2rem !important; }
.giay-nhap textarea { flex: 1; border: 0; resize: none; padding: 10px 12px; font: 1rem/1.6 var(--chu-giao-dien); background: repeating-linear-gradient(#fffef5, #fffef5 25px, #ece7c9 26px); outline: none; }

/* ---------- Kết quả ---------- */
.kq-dau { display: flex; gap: 26px; align-items: center; background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 22px; margin-bottom: 18px; box-shadow: var(--bong); }
.kq-dau p { margin: .3em 0; }
.kq-vong { flex: none; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--xanh) calc(var(--tl) * 1%), #e4ebe7 0); }
.kq-vong span { width: 108px; height: 108px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--xanh-dam); }
.kq-vong small { font-size: 1rem; color: var(--phu); }
.cot-nhom { display: grid; gap: 9px; }
.cn-hang { display: grid; grid-template-columns: 78px 1fr 34% 56px; gap: 10px; align-items: center; font-size: .93rem; }
.cn-thanh { height: 12px; border-radius: 10px; background: #e7ece9; overflow: hidden; }
.cn-thanh i { display: block; height: 100%; background: linear-gradient(90deg, var(--xanh), #2a9d7c); border-radius: 10px; }
.cn-so { text-align: right; font-weight: 700; }
.goi-y { margin-top: 12px; padding: 9px 12px; background: var(--vang-nhat); border-radius: 8px; }
.loc-cau { margin-bottom: 10px; }
.xem-lai { border: 1px solid var(--vien); border-left: 5px solid var(--dung); border-radius: 8px; padding: 0 14px; margin-bottom: 8px; background: #fff; }
.xem-lai.sai { border-left-color: var(--do); }
.xem-lai > summary { display: flex; gap: 10px; align-items: center; padding: 10px 0; cursor: pointer; flex-wrap: wrap; }
.xem-lai[open] { padding-bottom: 14px; }
.xl-so { font-weight: 800; }
.xl-tom { flex: 1; min-width: 160px; color: var(--phu); font-size: .92rem; }
.xl-kq { font-size: .85rem; font-weight: 600; }
.xem-lai.sai .xl-kq { color: var(--do); } .xem-lai.dung .xl-kq { color: var(--dung); }
.xl-nl { margin: 4px 0 12px; } .xl-nl > summary { cursor: pointer; color: var(--xanh); font-weight: 600; margin-bottom: 6px; }

/* ---------- Báo cáo ---------- */
.thanh-loc { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.thanh-loc select { padding: 8px 10px; border: 1px solid var(--vien); border-radius: 8px; font: inherit; background: #fff; }
.bang-kq td, .bang-kq th { font-size: .88rem; padding: 6px 8px; }

/* ---------- Đề của thầy cô, trình soạn đề ---------- */
.the-gv { gap: 6px; }
.nho-nut { margin-top: 6px; }
.luoi-truong { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.luoi-truong label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.luoi-truong .rong { grid-column: 1 / -1; }
.soan-de input:not([type=radio]), .soan-de select, .soan-de textarea, #o-dan { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--vien); border-radius: 8px; background: #fff; color: var(--chu); width: 100%; }
.soan-de textarea { resize: vertical; font-family: var(--chu-doc); font-size: 1.05rem; }
.dau-muc { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.the-soan { border: 1px solid var(--vien); border-left: 4px solid var(--xanh); border-radius: 10px; padding: 12px 14px; margin: 12px 0; background: #fcfdfc; }
.dau-the { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bang-pa { display: grid; gap: 6px; margin: 12px 0; }
.dong-pa { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 8px; align-items: center; }
.chon-da { display: flex; align-items: center; gap: 4px; font-weight: 700; cursor: pointer; }
.chon-da input { accent-color: var(--dung); width: 18px; height: 18px; }
.thanh-luu { position: sticky; bottom: 46px; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--the); border: 1px solid var(--vien); border-radius: 10px; padding: 10px 14px; box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
.huong-dan { margin: 6px 0 10px; font-size: .92rem; } .huong-dan summary { cursor: pointer; color: var(--xanh); font-weight: 600; }
code { background: var(--vang-nhat); padding: 0 4px; border-radius: 4px; font-size: .9em; }

/* ---------- Thương hiệu, bản quyền, bảng giá ---------- */
#thanh-ban-quyen { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; padding: 5px 16px; font-size: .82rem; }
#thanh-ban-quyen.dung-thu { background: #fbf1e1; color: var(--vang-dam); }
#thanh-ban-quyen.co-ban-quyen { background: linear-gradient(90deg, #0a3d30, #0F6E56, #0a3d30); }
.nut-chu-so-huu { background: none; border: 0; cursor: pointer; color: #ffd76a; font-weight: 800; letter-spacing: .6px; font-size: .9rem; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.nut-kich-hoat { border: 1px solid var(--vang); background: #fff; color: var(--vang-dam); border-radius: 20px; padding: 2px 12px; cursor: pointer; font-weight: 700; font-size: .8rem; }
.mien-chinh { margin-top: 8px !important; font-weight: 700; color: var(--xanh) !important; letter-spacing: .3px; }
#chan-trang { display: flex; justify-content: center; gap: 4px 14px; flex-wrap: wrap; }
.ct-mien a { color: #fff !important; font-weight: 700; text-decoration: none; }
.mien-tivi { display: none; }
html.tivi .mien-tivi { display: block; position: fixed; right: 14px; bottom: 10px; z-index: 45; font-size: 15px; color: rgba(255,255,255,.55); letter-spacing: .5px; pointer-events: none; }
html.tivi body.dang-thi .mien-tivi { bottom: 64px; }
.thong-bao-offline { background: #eef4ff; border-color: #3b6fd8; }
.goi-y-mua { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--vang); background: linear-gradient(90deg, #fff, var(--vang-nhat)); }
.goi-y-mua h2 { margin: 0; } .goi-y-mua p { margin: 4px 0 0; }
.mien-phi-nho { font-size: .68rem; font-weight: 700; color: var(--dung); border: 1px solid var(--dung); border-radius: 10px; padding: 0 6px; }
.the-de.sap { opacity: .6; } .the-de.sap .the-de-so { color: #a9b4af; }
.the-de.khoa .the-de-so { color: var(--vang); }
.o-che-do.bi-khoa { opacity: .6; cursor: not-allowed; }
.hop-kich-hoat h2 { text-align: center; }
.bang-gia { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.goi-gia { border: 2px solid var(--vien); border-radius: 12px; padding: 14px; }
.goi-gia.gv { border-color: var(--xanh); background: var(--xanh-nhat); }
.goi-gia.hs { border-color: var(--vang); background: var(--vang-nhat); }
.goi-ten { font-weight: 800; color: var(--xanh-dam); }
.goi-gia.hs .goi-ten { color: var(--vang-dam); }
.goi-tien { font-size: 1.7rem; font-weight: 800; margin: 2px 0; }
.goi-moc { font-size: .8rem; color: var(--phu); margin-bottom: 6px; }
.lo-trinh-gia { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; font-size: .78rem; }
.lo-trinh-gia span { display: flex; flex-direction: column; padding: 3px 7px; border-radius: 6px; background: #fff; border: 1px solid var(--vien); font-weight: 700; }
.lo-trinh-gia span.dang { border-color: var(--xanh); color: var(--xanh-dam); box-shadow: 0 0 0 2px var(--xanh-nhat); }
.lo-trinh-gia small { font-weight: 400; color: var(--phu); font-size: .68rem; }
.lo-trinh-gia i { font-style: normal; color: var(--phu); }
.nhan-o-ma { display: block; font-weight: 600; margin: 14px 0 4px; }
#o-ma { width: 100%; font: .9rem/1.4 Consolas, monospace; padding: 8px 10px; border: 1px solid var(--vien); border-radius: 8px; }
.loi-ma { color: var(--do); font-size: .9rem; min-height: 1.2em; margin: 4px 0; }
.the-ban-quyen { background: var(--xanh-nhat); border: 1px solid #c6e0d6; border-radius: 10px; padding: 12px; margin: 10px 0; }
.the-ban-quyen strong { font-size: 1.2rem; color: var(--xanh-dam); }
.the-ban-quyen small { color: var(--phu); }
.the-chia-doi { display: none; }

/* ---------- Hộp thoại, thông báo ---------- */
#hop-thoai { position: fixed; inset: 0; z-index: 60; background: rgba(10,25,20,.55); display: grid; place-items: center; padding: 16px; }
.hop { position: relative; background: #fff; border-radius: 14px; padding: 26px 26px 22px; width: min(620px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.hop.hop-nho { width: min(520px, 100%); }
.hop-dong { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--phu); }
.hop-khoa { text-align: center; }
.hop-khoa-bieu-tuong { font-size: 2.4rem; }
.hop-khoa p { color: var(--phu); }
.hai-nut { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.nut-fb, .nut-zalo { display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px 10px; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem; }
.nut-fb { background: #1877F2; } .nut-zalo { background: #0068FF; }
#thong-bao { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; pointer-events: none; }
.tb { background: #10251f; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: opacity .5s; max-width: 90vw; }
.tb.loi { background: var(--do); } .tb.canh-bao { background: var(--vang-dam); }
.tb.an { opacity: 0; }
#vung-in { display: none; }

/* ---------- Chế độ Tivi: chữ lớn, tương phản cao ---------- */
html.tivi { --co: 22px; --nen: #000; --the: #0d0d0d; --chu: #fff; --phu: #d9d9d9; --vien: #5c5c5c;
  --xanh-nhat: #0b3a2e; --vang-nhat: #3a2a0c; --dung-nhat: #0d3a1f; --do-nhat: #4a1410; --to-vang: #f5d000; --to-xanh: #00a2ff; }
html.tivi body { background: #000; }
html.tivi h2, html.tivi .tieu-de-cd h1, html.tivi .tieu-de-trang h1, html.tivi .so-cau, html.tivi .dau-trang h1 { color: #ffd54a; }
html.tivi .phuong-an { border-width: 3px; background: #111; color: #fff; }
html.tivi .phuong-an.da-chon { background: #0b3a2e; border-color: #3ddc97; }
html.tivi .phuong-an.dung { background: #0d3a1f; border-color: #3ddc97; }
html.tivi .phuong-an.sai { background: #4a1410; border-color: #ff6b5e; }
html.tivi .chu-pa { background: #222; color: #fff; }
html.tivi .cau-dan, html.tivi .nl-ngan, html.tivi .cot-ngu-lieu, html.tivi .cong-cu-to, html.tivi .loi-giai, html.tivi .lg-pa, html.tivi .vi-du, html.tivi .xem-lai, html.tivi .giay-nhap textarea { background: #0d0d0d; color: #fff; border-color: #5c5c5c; }
html.tivi .gach-chan u { text-decoration-color: #ffd54a; }
html.tivi .gach-chan sub, html.tivi .ct-nhan, html.tivi .nl-dan { color: #ffd54a; }
html.tivi mark.to-vang, html.tivi mark.to-xanh { color: #000; }
html.tivi .o-cau { background: #1a1a1a; color: #fff; }
html.tivi .o-cau.da-lam { background: var(--xanh); }
html.tivi .the-de, html.tivi .the-de.mo { background: #111; }
html.tivi .the-nho { background: #333; color: #fff; }
html.tivi .menu-cd a.dang-chon, html.tivi .tab-cd a.dang-chon { color: #ffd54a; }
html.tivi .bang th { background: #0b3a2e; color: #fff; }
html.tivi .the-lon { box-shadow: none; }
html.tivi .than-thi { grid-template-columns: 250px 1fr; }
html.tivi .giay-nhap { background: #0d0d0d; border-color: #5c5c5c; }
html.tivi .gn-dau { background: #333; color: #fff; }
html.tivi .gn-dau button { color: #fff; }
html.tivi select, html.tivi input { background: #111; color: #fff; border-color: #5c5c5c; }

/* ---------- Màn hình hẹp ---------- */
@media (max-width: 900px) {
  .hai-the, .hai-cot, .bo-cuc-cd, .luoi-truong { grid-template-columns: 1fr; }
  .dong-pa { grid-template-columns: 44px 1fr; } .dong-pa input:last-child { grid-column: 2; }
  .menu-cd { position: static; max-height: none; display: flex; overflow-x: auto; gap: 4px; padding: 6px; scrollbar-width: none; }
  .menu-cd-tieu-de { display: none; }
  .menu-cd a { flex: none; } .menu-cd .ten-cd { white-space: nowrap; }
  .than-thi { grid-template-columns: 1fr !important; }
  .bang-cau { position: fixed; top: 52px; bottom: 52px; left: 0; width: 250px; z-index: 35; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 18px rgba(0,0,0,.2); }
  body.mo-bang-cau .bang-cau { transform: none; }
  .nut-bang-cau { display: block; }
  .chia-doi { display: flex !important; flex-direction: column; }
  .the-chia-doi { display: flex; flex: none; gap: 6px; padding: 6px 10px; background: var(--the); border-bottom: 1px solid var(--vien); }
  .the-chia-doi button { flex: 1; padding: 9px 6px; border: 1px solid var(--vien); border-radius: 20px; background: var(--nen); color: var(--chu); font-weight: 700; cursor: pointer; }
  .the-chia-doi button.dang { background: var(--xanh); border-color: var(--xanh); color: #fff; }
  .cot-ngu-lieu, .cot-cau { flex: 1; min-height: 0; border-right: 0; }
  .chia-doi.xem-nl .cot-cau, .chia-doi.xem-cau .cot-ngu-lieu { display: none; }
  .thanh-keo { display: none; }
  .thanh-thi { flex-wrap: wrap; gap: 8px; }
  .tt-de { order: 0; flex-basis: calc(100% - 60px); }
  .kq-dau { flex-direction: column; text-align: center; }
  .cn-hang { grid-template-columns: 70px 1fr 50px; } .cn-ten { display: none; }
}
@media (max-width: 760px) {
  body { padding-bottom: 66px; }
  .dau-app { padding: 8px 14px; }
  .menu-chinh { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--xanh); justify-content: space-around; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -3px 12px rgba(0,0,0,.18); overflow: visible; }
  .menu-chinh a { display: flex; flex-direction: column; align-items: center; flex: 1; padding: 4px 2px; font-size: .68rem; border-radius: 10px; white-space: normal; text-align: center; line-height: 1.15; }
  .menu-chinh a i { font-size: 1.25rem; margin: 0 0 2px; }
  .menu-chinh a.dang-chon { background: rgba(255,255,255,.95); }
  .dau-app .nut-tivi { margin-left: auto; }
  #chan-trang { position: static; margin-top: 10px; }
  .thanh-luu { bottom: 70px; }
  html.tivi .mien-tivi { bottom: 74px; }
  .bang-gia { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --co: 15px; }
  html.tivi { --co: 17px; }
  #noi-dung { padding: 16px 16px 26px; }
  .dau-app { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  .logo-chu b { font-size: .95rem; }
  .cac-phuong-an.ngan { grid-template-columns: 1fr; }
  .mot-cot, .cot-cau { padding: 16px; }
  .cuon-ngu-lieu { padding: 14px 16px; }
  .giay-nhap { left: 8px !important; right: 8px; width: auto; }
  .hai-nut { grid-template-columns: 1fr; }
  .chan-thi .nut { padding: 8px 10px; font-size: .85rem; }
  #chan-trang { font-size: .72rem; }
}

/* ---------- In phiếu điểm (Lưu thành PDF) ---------- */
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; padding: 0; color: #000; }
  body > *:not(#vung-in) { display: none !important; }
  .mien-tivi, #thanh-ban-quyen { display: none !important; }
  #vung-in { display: block !important; font-family: "Times New Roman", serif; font-size: 13pt; color: #000; }
  .phieu-dau { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid #0F6E56; padding-bottom: 8px; margin-bottom: 12px; font-weight: 700; color: #0F6E56; }
  .phieu-ten { font-size: 20pt; color: #BA7517; }
  .phieu-tt { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
  .phieu-tt td { padding: 4px 6px; border: 1px solid #ccc; }
  .phieu-tt td:nth-child(odd) { width: 16%; background: #eef6f2; }
  .phieu-diem { font-size: 15pt; margin: 10px 0; }
  .phieu-bang { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
  .phieu-bang th, .phieu-bang td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; }
  .phieu-bang th { background: #0F6E56; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .phieu-chu-thich { font-style: italic; font-size: 11pt; color: #444; }
  h3 { font-size: 14pt; margin: 10px 0 6px; }
}
