/* Bổ sung cho mục Luyện câu: lộ trình 4 cấp, thẻ lý thuyết, bảng trượt lý thuyết (đi kèm levels.js) */
.xdc-roadmap{display:flex;align-items:stretch;gap:8px;margin:0 0 22px;flex-wrap:wrap}
.rm-step{flex:1 1 150px;display:flex;flex-direction:column;gap:3px;padding:12px 14px;border:1px solid #c6d8bd;border-radius:12px;background:#f1f5ed;color:inherit;text-decoration:none;min-width:0}
a.rm-step:hover{background:#e4edde;border-color:#8aad99}
.rm-step.current{background:#1b6c63;border-color:#1b6c63;color:#fff}
.rm-step.current .rm-sub,.rm-step.current .rm-level{color:#deebdf}
.rm-step.soon{opacity:.65;border-style:dashed}
.rm-level{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#58815e}
.rm-step strong{font-size:17px}
.rm-sub{font-size:13px;color:#6c7f7b;line-height:1.45}
.rm-arrow{align-self:center;color:#8aad99;font-size:20px}
@media(max-width:700px){.rm-arrow{display:none}.rm-step{flex:1 1 calc(50% - 8px)}}

.nav-level-link{display:block;margin-top:10px;padding:9px 12px;border:1px dashed #8aad99;border-radius:10px;text-decoration:none;color:#1b6c63;font-size:14px;text-align:center}
.nav-level-link:hover{background:#edf4e9}

.xdc-groups{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:20px;padding:14px;background:#e9f0e3;border-radius:12px}
.xdc-groups strong{margin-right:4px}
.xdc-groups .td-link{margin-left:auto}
@media(max-width:700px){.xdc-groups button{font-size:13px}.xdc-groups .td-link{margin-left:0}}

.theory-chip{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;margin:3px 6px 3px 0;border:1px solid #b9cebd;border-radius:999px;background:#edf4e9;color:#1b6c63;font-size:13px;line-height:1.4;cursor:pointer;text-align:left;white-space:normal}
.theory-chip:hover{background:#dfeedd;border-color:#8aad99}
.theory-chip.mini{padding:2px 8px;font-size:12px;margin:4px 0 0}
.theory-ref{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:12px 0 0;padding-top:10px;border-top:1px dashed #d7e2d1;font-size:14px;color:#58815e}
.td-chips{display:flex;flex-wrap:wrap;align-items:center;gap:2px}
.related-row{margin-top:14px;padding-top:10px;border-top:1px dashed #d7e2d1}
.related-row .muted{margin-right:8px;font-size:14px}
.td-target>summary{background:#fff3c9;border-radius:6px}

.btn-link,.td-link{display:inline-block;padding:8px 12px;border:1px solid #b9cebd;border-radius:9px;text-decoration:none;color:#1b6c63;background:#fff;font-size:14px}
.btn-link.primary{background:#1b6c63;border-color:#1b6c63;color:#fff}
.btn-link:hover,.td-link:hover{filter:brightness(.96)}

.phrase-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:20px}
.phrase-group h3{margin:8px 0 4px}
@media(max-width:1000px){.phrase-groups{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.phrase-groups{grid-template-columns:1fr}}

#theory-drawer{position:fixed;top:0;right:0;bottom:0;width:min(600px,100vw);background:#fbfcf8;border-left:1px solid #c6d8bd;box-shadow:-8px 0 30px #163c4026;z-index:120;overflow-y:auto;padding:0 22px 30px}
#theory-drawer[hidden],#theory-backdrop[hidden]{display:none}
#theory-backdrop{position:fixed;inset:0;background:#163c4033;z-index:110}
.td-head{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;gap:12px;justify-content:space-between;padding:18px 0 12px;background:#fbfcf8;border-bottom:1px solid #e0e6dc}
.td-head h2{margin:4px 0 0;font-size:22px;line-height:1.35}
.td-close{flex-shrink:0;width:40px;height:40px;padding:0;border-radius:50%;font-size:18px}
.td-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:14px 0}
.td-body{border-top:1px dashed #d7e2d1;padding-top:6px}
.td-foot h3{margin:22px 0 8px;font-size:16px}
.td-uses{margin:8px 0 12px}
.td-uses strong{display:block;font-size:14px;margin-bottom:6px;color:#426e4a}
.td-use-list{display:flex;flex-wrap:wrap;gap:6px}
.td-use-list button{padding:5px 10px;font-size:13px;min-width:38px}
body.theory-open{overflow:hidden}

/* Lý thuyết bổ sung từ giáo trình Từ pháp */
.tp-extra{margin-top:22px;padding:16px 18px;border:1px solid #d9cfa8;border-radius:14px;background:#fffbea}
.tp-extra>h3{margin:0 0 8px;font-size:17px;color:#6b5414}
.tp-extra>h3 .muted{font-size:13px;font-weight:400}
.tp-item>summary{cursor:pointer;color:#6b5414;font-weight:500}
.tp-item[open]>summary{margin-bottom:10px}
.tp-ex{margin:8px 0 12px;border-left:3px solid #e2d3a0;padding-left:12px}
.tp-ex p{margin:6px 0;display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline}
.tp-ex .cn{font-size:19px}
.tp-vi{color:#6c7f7b;font-size:14px}
.tp-err{margin:10px 0;padding:10px 12px;border-radius:10px;background:#fff;border:1px solid #ecdcb0}
.tp-err>strong{display:block;font-size:13px;color:#8a5a12;margin-bottom:4px}
.tp-err p{margin:6px 0;display:flex;flex-wrap:wrap;gap:4px 16px;align-items:baseline}
.tp-wrong{color:#a33a2c;text-decoration:line-through;text-decoration-color:#a33a2c80}
.tp-right{color:#1b6c63}
.tp-why{color:#6c7f7b;font-size:14px;flex-basis:100%}
.tp-table .cn{font-size:16px}
.tp-src{font-size:12px;color:#8a8a7a;margin-top:10px}
.theory-chip.tp{background:#fff6d6;border-color:#e2d3a0;color:#6b5414}
.theory-chip.tp:hover{background:#fbedb9}
@media(max-width:600px){#theory-drawer{padding:0 16px 24px}.td-head h2{font-size:19px}}

/* Bài tập liên kết câu (Level 3) */
.lk-tabs button{font-size:14px}
.lk-card{margin:14px 0;padding:18px 20px}
.lk-card .section-top{margin-bottom:6px}
.lk-done{background:#fff3c9;color:#6b5414}
.lk-text{font-size:21px;line-height:2.1}
.lk-sel{font-size:18px;padding:2px 6px;margin:0 3px;border:1px solid #b9cebd;border-radius:7px;background:#fff;color:#1b6c63}
.lk-sel.ok{border-color:#1b6c63;background:#e4f2ea}
.lk-sel.bad{border-color:#a33a2c;background:#fbe9e6;color:#a33a2c}
.lk-fb{font-size:14px;margin-left:6px}
.lk-fb.ok{color:#1b6c63}.lk-fb.bad{color:#a33a2c}
.lk-area{width:100%;min-height:80px;font-size:18px;margin-top:6px}
.lk-sents{display:flex;flex-direction:column;gap:8px;margin:6px 0 12px}
.lk-sent{display:flex;gap:12px;align-items:baseline;text-align:left;padding:10px 12px;background:#fff;border:1px solid #d7e2d1;border-radius:10px}
.lk-sent b{color:#1b6c63;min-width:18px}
.lk-sent .cn{font-size:19px}
.lk-sent:hover{background:#edf4e9}
.lk-order{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.lk-input{width:120px;font-size:18px;letter-spacing:.3em;text-transform:uppercase;padding:6px 10px}

/* Level 1 · tab mới */
.l1-classify select{min-width:130px}
.l1-classify td{vertical-align:middle}
.l1-picks{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 4px}
.l1-pick{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid #d7e2d1;border-radius:10px;background:#fff;cursor:pointer}
.l1-pick .cn{font-size:20px}
.l1-pick.ok{border-color:#1b6c63;background:#e4f2ea}
.l1-pick.bad{border-color:#a33a2c;background:#fbe9e6}
.l1-vi-m{display:none;font-size:13px;color:#6c7f7b}
@media(max-width:650px){.l1-classify{min-width:0!important;width:100%}.l1-classify th:nth-child(2),.l1-classify td:nth-child(2){display:none}.l1-vi-m{display:block}.l1-classify select{min-width:0;max-width:150px}}

/* Level 4 · đoạn văn */
.l4-para{font-size:19px;line-height:2;margin:6px 0 12px}
.l4-s{margin-right:2px}
.l4-spot{display:inline-flex;align-items:center;gap:6px}
.l4-kw{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 10px}
.l4-word{padding:5px 12px;border:1px dashed #b9cebd;border-radius:999px;font-size:18px;color:#6c7f7b}
.l4-word.on{border-style:solid;border-color:#1b6c63;background:#e4f2ea;color:#1b6c63}
.l4-word.on::before{content:'✓ '}
.l4-long{min-height:170px}
.l4-count{font-size:13px;color:#58815e;margin:4px 0 10px}
.l4-check label{display:block;margin:6px 0}

/* Level 2 · sắp xếp từ dạng HSK */
.hsk-chunks{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 12px}
.hsk-chunk{font-size:19px;padding:8px 14px;border:1px solid #b9cebd;border-radius:10px;background:#fff}
.hsk-chunk:hover{background:#edf4e9}
.hsk-chunk.used{opacity:.35}
.hsk-line{min-height:52px;display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:8px 10px;border:1px dashed #b9cebd;border-radius:10px;background:#f7faf5;font-size:20px}
.hsk-piece{font-size:20px;padding:4px 8px;border:0;border-bottom:2px solid #8aad99;border-radius:4px;background:transparent}
.hsk-piece:hover{background:#fbe9e6;border-color:#a33a2c}
.hsk-dot{font-size:20px}

/* Lộ trình: thanh "Bài X" trên trang học */
.path-bar{margin:0 0 18px;padding:14px 16px;border:1px solid #c6d8bd;border-left:5px solid #1b6c63;border-radius:12px;background:#f4f9f1}
.pb-top{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.pb-tag{font-size:12px;letter-spacing:.04em;color:#58815e;font-weight:600}
.pb-top strong{font-size:17px}
.pb-prog{margin-left:auto;font-size:13px;color:#58815e}.pb-prog.ok{color:#1b6c63;font-weight:600}
.pb-goal{margin:4px 0 8px;font-size:14px;color:#6c7f7b}
.pb-steps{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:6px 0}
.pb-k{font-size:13px;font-weight:600;color:#426e4a;min-width:58px}
.pb-link{font-size:13px;padding:4px 10px;border:1px solid #b9cebd;border-radius:999px;background:#fff;color:#1b6c63;text-decoration:none}
.pb-link.opt{border-style:dashed;color:#6c7f7b}
.pb-link:hover{background:#e4edde}
.pb-c{font-size:12px;color:#8a9a93}
.pb-nav{display:flex;flex-wrap:wrap;gap:8px 16px;justify-content:space-between;align-items:center;margin-top:10px;padding-top:10px;border-top:1px dashed #c6d8bd;font-size:14px}
.pb-nav a{color:#1b6c63;text-decoration:none}
.pb-next{padding:7px 14px;border-radius:9px;background:#1b6c63;color:#fff!important}
@media(max-width:600px){.pb-nav{flex-direction:column;align-items:stretch;text-align:center}.pb-prog{margin-left:0}}

/* Trang lộ trình */
.path-hero{display:flex;flex-wrap:wrap;gap:14px 24px;align-items:center;justify-content:space-between;padding:18px 20px;margin-bottom:18px;border-radius:14px;background:#1b6c63;color:#fff}
.path-hero .eyebrow,.path-hero .muted{color:#deebdf}
.path-hero h2{margin:4px 0;color:#fff}
.path-hero.ok{background:#2f7d4f}
.path-hero .btn-link.primary{background:#fff;color:#1b6c63;border-color:#fff}
.path-hero button{background:#fff;color:#1b6c63}
.big{font-size:16px;padding:11px 18px}
.path-level{margin:18px 0}
.path-list{list-style:none;padding:0;margin:8px 0}
.ps{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;margin:6px 0;border:1px solid #d7e2d1;border-radius:12px;background:#fff}
.ps-ic{flex-shrink:0;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-weight:700;border:2px solid #b9cebd;color:#8a9a93}
.ps-done .ps-ic{background:#1b6c63;border-color:#1b6c63;color:#fff}
.ps-doing .ps-ic{border-color:#d9a400;color:#a07800}
.ps-cur{border-color:#1b6c63;box-shadow:0 0 0 2px #1b6c6333}
.ps-test{background:#fffbea;border-color:#e2d3a0}
.ps-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.ps-title{font-weight:600;color:#1b4c46;text-decoration:none}
.ps-title:hover{text-decoration:underline}
.ps-goal,.ps-note{font-size:13px;color:#6c7f7b}
.ps-note a{color:#1b6c63}
.ps-prog{flex-shrink:0;font-size:13px;color:#58815e}
.path-how{margin-top:20px}
.quiz-q{border:1px solid #d7e2d1}
.quiz-q legend{font-weight:500;padding:0 4px}
.quiz-opt{display:flex;align-items:center;gap:8px;padding:8px 10px;margin:6px 0;border:1px solid #e0e6dc;border-radius:9px;cursor:pointer;background:#fff}
.quiz-opt .cn{font-size:19px}
.quiz-opt:has(input:checked){border-color:#1b6c63;background:#edf4e9}
.quiz-fb{font-size:14px;margin:6px 0 0}.quiz-fb.ok{color:#1b6c63}.quiz-fb.bad{color:#a33a2c}
.quiz-fb a{color:#1b6c63}

/* Điều hướng chia nhóm Lý thuyết / Bài tập */
.nav-sec{display:block;margin:14px 2px 4px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#58815e;font-weight:600}
/* Level 1 · thanh chọn nhóm bài tập */
.l1-grp{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin:0 0 16px}
.l1-grp button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;text-align:left;font-size:13px;line-height:1.3;min-width:0}
.l1-grp button span{font-size:11px;color:#58815e;font-weight:700}
.l1-grp button small{font-size:11px;color:#8a9a93}
.l1-grp button.active{background:#1b6c63;color:#fff;border-color:#1b6c63}
.l1-grp button.active span,.l1-grp button.active small{color:#deebdf}
@media(max-width:1100px){.l1-grp{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:600px){.l1-grp{grid-template-columns:repeat(2,minmax(0,1fr))}}
.l1-rail-groups{flex-direction:column;align-items:stretch}
.l1-rail-groups button{text-align:left;font-size:13px}
.l1-rail-groups button.active{background:#1b6c63;color:#fff}
/* Mục Từ pháp ghép vào nhánh */
.tp-inline{margin:12px 0 4px;padding:10px 12px;border:1px solid #e2d3a0;border-radius:10px;background:#fffbea}
.tp-inline>summary{color:#6b5414}
.tp-wrong-plain{color:#a33a2c}

/* Level 0 / 5 · trắc nghiệm, tranh, dàn ý */
.l4-q{font-size:17px;margin:4px 0 10px}
.l4-q .cn{font-size:26px}
.l4-opts{display:grid;gap:6px}
.l4-opts.big-cn{grid-template-columns:repeat(auto-fit,minmax(110px,1fr))}
.l4-opts.big-cn .quiz-opt .cn{font-size:30px}
.l4-scene{display:flex;gap:14px;align-items:center;padding:12px 14px;margin-bottom:10px;border-radius:12px;background:#f1f5ed;border:1px dashed #b9cebd}
.l4-emoji{font-size:40px;line-height:1}
.l4-outline p{margin:6px 0}
.l4-essay{min-height:260px}
/* Nhãn nhóm điều hướng luôn chiếm trọn một hàng (kể cả khi thanh điều hướng thành lưới trên điện thoại) */
.local-nav .nav-sec,.local-nav .nav-level-link{grid-column:1/-1;flex-basis:100%;width:100%}

/* Level 0 · phát triển chữ từng bước */
.gw-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:4px 0 10px}
.gw-ch{display:inline-grid;place-items:center;width:52px;height:52px;border:1px dashed #b9cebd;border-radius:10px;font-size:32px;color:#b9cebd;background:#fff}
.gw-ch.on{border-style:solid;border-color:#1b6c63;color:#1b4c46;background:#edf4e9}
.gw-ar{color:#8aad99;font-size:18px}
.gw-base{margin:0 0 8px;color:#426e4a}
.gw-base .cn{font-size:22px}
.gw-step{padding:10px 12px;margin:6px 0;border-radius:10px;border:1px solid #e0e6dc;background:#fff}
.gw-step .cn{font-size:22px}
.gw-step.ok{background:#f4f9f1}
.gw-step.ok p{margin:4px 0 0;font-size:13px}
.gw-step.cur{border-color:#1b6c63;box-shadow:0 0 0 2px #1b6c6322}
.gw-new{color:#1b6c63;font-size:26px!important}
.gw-opts{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 4px}
.gw-opts button{font-size:30px;min-width:64px;padding:6px 12px;background:#fff}
.gw-opts button.bad{border-color:#a33a2c;background:#fbe9e6;color:#a33a2c}
@media(max-width:600px){.gw-ch{width:42px;height:42px;font-size:26px}}

/* Level 0 · bài phân nhánh */
.tr-root{display:flex;align-items:center;gap:14px;margin:4px 0 10px}
.gw-ch.big{width:64px;height:64px;font-size:40px}
.gw-ch.sm{width:42px;height:42px;font-size:26px}
.tr-branch{margin:8px 0 8px 18px;padding:8px 12px;border-left:3px solid #b9cebd;border-radius:0 10px 10px 0;background:#fbfdf9}
.tr-branch.ok{border-left-color:#1b6c63}
.tr-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.tr-head .gw-line{margin:0}
.tr-solved{display:flex;flex-direction:column;gap:2px;margin:6px 0;font-size:14px}
.tr-solved .cn{font-size:19px}
@media(max-width:600px){.tr-branch{margin-left:6px}}

/* Sơ đồ phân nhánh */
.tree-sub{margin:0 0 6px}
.tree-wrap{overflow-x:auto;padding:8px 2px 10px}
.tree{display:flex;align-items:center;width:max-content}
.tr-rows{display:flex;flex-direction:column;gap:12px;border-left:2px solid #8aad99;padding:4px 0}
.tr-row{display:flex;align-items:center}
.tl{display:inline-block;width:20px;height:2px;background:#8aad99;flex-shrink:0}
.tn{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:56px;height:58px;padding:2px 6px;border:2px solid #b9cebd;border-radius:12px;background:#fff;line-height:1.15;flex-shrink:0}
.tn b.cn{font-size:28px;font-weight:500}
.tn small{font-size:11px;color:#6c7f7b}
.tn.root{min-width:66px;height:70px;border-color:#1b6c63;background:#1b6c63;color:#fff}
.tn.root b.cn{font-size:36px}
.tn.root small{color:#deebdf}
.tn.on{border-color:#1b6c63;background:#edf4e9}
.tn.q{border-style:dashed;border-color:#d9a400;background:#fffbea;color:#a07800;font-size:28px;cursor:pointer;padding:0}
.tn.q:hover{background:#fff3c9}
.tn.q.act{box-shadow:0 0 0 4px #d9a40055;border-style:solid}
.tn.ghost{min-width:34px;height:34px;border-style:dashed;opacity:.35}
.tr-row.ok .tl{background:#1b6c63}
.tree-pop{margin:6px 0 4px;padding:10px 12px;border:1px solid #e2d3a0;border-radius:12px;background:#fffbea}
.tree-pop p{margin:0 0 4px}
.tree-pop .cn{font-size:22px}
.tree-hint{margin:6px 0;color:#8a5a12;font-size:14px}
.tr-legend{display:flex;flex-direction:column;gap:2px;margin:8px 0 0;font-size:13px;color:#426e4a}
.tr-legend .cn{font-size:18px}
@media(max-width:600px){.tn{min-width:46px;height:50px}.tn b.cn{font-size:24px}.tl{width:12px}}
/* Cây nhiều tầng */
.tnode{display:flex;align-items:center}
.tkids{display:flex;flex-direction:column;gap:8px;padding:0}
.tkid{display:flex;align-items:center;position:relative}
/* Đường dọc chỉ nối từ tâm nhánh đầu đến tâm nhánh cuối (không thừa nét ở hai đầu); nhánh con có mũi tên */
.tkid::before{content:'';position:absolute;left:0;top:-4px;bottom:-4px;border-left:2px solid #8aad99}
.tkid:first-child::before{top:50%}
.tkid:last-child::before{bottom:50%}
.tkid:only-child::before{display:none}
.tkid>.tl{width:24px;position:relative;margin-right:2px}
.tkid>.tl::after{content:'';position:absolute;right:-4px;top:-4px;border:5px solid transparent;border-left:7px solid #8aad99;border-right:0}
.tree-wrap>.tnode{width:max-content}

/* Tab gom nhiều nhóm bài */
.l4-sub{margin:10px 0 26px;padding-top:10px;border-top:2px solid #e0e6dc;scroll-margin-top:16px}
.l4-sub:first-of-type{border-top:0}
.l4-jumps{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px}
.l4-jumps button{font-size:13px}
.l4-rail>summary{cursor:pointer;font-size:13px;font-weight:600;color:#1b4c46;padding:6px 0}
.l4-rail>summary small{font-weight:400;color:#8a9a93;margin-left:4px}
.l4-rail .rail-numbers{margin:2px 0 10px}

/* Mỗi câu một trang */
.l4-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0;padding:8px 10px;border-radius:10px;background:#f1f5ed}
.l4-pager span{font-size:14px;color:#426e4a;text-align:center}
.l4-pager button:disabled{opacity:.4}
.l4-jumps button.active{background:#1b6c63;color:#fff;border-color:#1b6c63}
.l4-gtitle{margin:6px 0 2px}

/* Menu theo bài phát triển (level-nav.js): Các bước phát triển · Ôn theo dạng bài · Sổ tay lý thuyết */
.nav-lessons{display:flex;flex-direction:column;gap:5px}
.nav-lesson{display:grid;grid-template-columns:26px minmax(0,1fr);gap:1px 6px;align-items:baseline;padding:9px 10px;border:1px solid #e1d3bd;border-radius:10px;background:#fffdf9;color:#3d413c;text-decoration:none;font-size:13.5px;line-height:1.3}
.nav-lesson:hover{background:#e4eee5}
.nav-lesson .nl-code{font-weight:700;font-size:12px;color:#58815e}
.nav-lesson small{grid-column:2;font-size:11px;color:#8a9a93}
.nav-lesson.doing{border-left:3px solid #d9a93a}
.nav-lesson.done{border-left:3px solid #1b6c63}
.nav-lesson.done small::before{content:'✓ '}
.nav-lesson.test{border-style:dashed}
.nav-lesson.active{background:#1b6c63;border-color:#1b6c63;color:#fff}
.nav-lesson.active .nl-code,.nav-lesson.active small{color:#deebdf}
.nav-lesson:focus-visible{outline:3px solid #87b7aa;outline-offset:2px}
.nav-fold{margin-top:8px}
.nav-fold>summary{cursor:pointer;margin:6px 2px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#58815e;font-weight:600}
.nav-fold>button{display:block;width:100%;margin-top:6px}
.local-nav .nav-lessons,.local-nav .nav-fold,.study-rail #multi-nav .nav-lessons,.study-rail #multi-nav .nav-fold,.study-rail #multi-nav .nav-sec,.study-rail #multi-nav .nav-level-link{grid-column:1/-1}

/* Level 2 · bài phát triển câu: bố cục "câu đang xây" (level2-build.js) */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.bd-head{align-items:flex-end;gap:12px;flex-wrap:wrap}
.bd-head h2{margin:2px 0 0}
.bd-pick select{max-width:300px;padding:8px 10px;border:1px solid #d9cdb8;border-radius:10px;background:#fffdf9;font-size:14px}
.bd-path{margin:6px 0 14px;color:#6b6f68;font-size:14px}
.bd-bar{position:sticky;top:0;z-index:5;margin:0 0 14px;padding:12px 16px;border:1px solid #b9cebd;border-radius:14px;background:#f6faf3;box-shadow:0 4px 12px rgba(40,60,50,.08)}
.bd-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.bd-k{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#58815e;font-weight:600}
.bd-say{padding:4px 10px;font-size:13px}
.bd-sentence{margin:6px 0 8px;font-size:26px;line-height:1.7}
.bd-ph{padding:1px 3px;border-radius:6px;background:#e3eee0;color:#1b4c46}
.bd-ph sup{font-size:10px;color:#58815e;margin-left:1px;font-family:system-ui,sans-serif}
.bd-ph.hot{background:#fbe7b5;color:#5e430b;box-shadow:inset 0 -2px 0 #d9a93a}
.bd-ph.hot sup{color:#8a6312}
.bd-chips{display:flex;flex-wrap:wrap;gap:5px}
.bd-chip{font-size:12px;padding:2px 8px;border-radius:999px;border:1px dashed #c8bba4;color:#8a8478;background:#fff}
.bd-chip .cn{font-size:13px}
.bd-chip.on{border-style:solid;border-color:#9fc0a8;background:#e3eee0;color:#1b4c46}
.bd-chip.now{border:1px solid #d9a93a;background:#fbe7b5;color:#5e430b}
.bd-steps{display:flex;flex-direction:column;gap:6px}
.bd-row{display:grid;grid-template-columns:44px minmax(0,1.1fr) minmax(0,1.6fr) auto;gap:10px;align-items:center;width:100%;padding:9px 12px;border:1px solid #e4d8c6;border-radius:10px;background:#fffdf9;text-align:left;font-size:14px;color:#3d413c}
.bd-row .cn.bd-a{font-size:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bd-row.done{cursor:pointer}.bd-row.done:hover{background:#eef5ec}
.bd-row.done .bd-n{color:#1b6c63;font-weight:700}
.bd-row.lock{color:#9a948a;background:#faf7f1;border-style:dashed}
.bd-row.lock .bd-a{color:#a39d92}
.bd-edit{font-size:12px;color:#1b6c63}
.bd-row.lock::after{content:''}
.bd-step{padding:14px 16px;border:2px solid #d9a93a;border-radius:14px;background:#fffbef}
.bd-step-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:6px}
.bd-req{margin:6px 0 10px}
.bd-lab{display:block;font-size:13px;color:#6b6f68;margin-bottom:4px}
.bd-input{width:100%;font-size:22px!important;line-height:1.6;min-height:0}
.bd-err{min-height:1em;margin:4px 0 0;font-size:13px;color:#a33a2c}
.bd-acts{align-items:center;margin:6px 0 0}
.bd-hint{font-size:12px;color:#8a8478}
.bd-ref{margin-top:10px}
.bd-ladder{margin-top:16px;padding:14px 16px;border:1px solid #b9cebd;border-radius:14px;background:#fff}
.bd-ladder h3{margin:0 0 8px}
.bd-ladder ol{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:8px}
.bd-ladder li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;align-items:baseline}
.bd-ladder li .cn{font-size:20px}
.bd-ladder small{display:block;color:#7b7f78;font-size:12px}.bd-ladder small .cn{font-size:14px}
.bd-ladder .bd-n,.bd-row .bd-n{font-size:13px}
.bd-pager{display:flex;justify-content:space-between;margin-top:16px}
@media(max-width:700px){.bd-sentence{font-size:21px}.bd-row{grid-template-columns:40px minmax(0,1fr) auto}.bd-row .bd-t{display:none}.bd-pick select{max-width:100%}}

/* Level 0 (level0.js): tab ngang Lý thuyết / Bài tập, sơ đồ phát triển chữ, ma trận bộ thủ */
.l0-htabs{display:flex;gap:6px;margin:0 0 18px;padding:5px;border-radius:14px;background:#ece5d8;width:100%}
.l0-htabs button{flex:1;border:0;background:transparent;padding:12px 18px;border-radius:10px;font-weight:600;font-size:16px;color:#5b5446}
.l0-htabs button.active{background:#1b6c63;color:#fff}
.l0-sub{margin:22px 0 6px}
.l0-toc{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:5px}
.l0-toc button{width:100%;text-align:left;font-size:13px;padding:7px 9px}
.l0-tp{scroll-margin-top:12px}
.l0-tools{margin:8px 0}
.l0-search{display:flex;gap:6px;max-width:460px}.l0-search input{flex:1;padding:8px 10px;border:1px solid #d9cdb8;border-radius:10px;font-size:14px}
.l0-find{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px}
.l0-chips{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
.l0-chips button{font-size:13px;padding:6px 11px}.l0-chips button small{color:#8a8478}
.l0-chips button.active{background:#1b6c63;color:#fff;border-color:#1b6c63}.l0-chips button.active small{color:#deebdf}
.l0-sticky{position:sticky;top:0;z-index:6;margin:0 0 10px}
.l0-info{padding:10px 14px;border:1px solid #b9cebd;border-radius:12px;background:#f6faf3;font-size:14px;box-shadow:0 4px 12px rgba(40,60,50,.08)}
.l0-info.muted{color:#6b6f68;box-shadow:none}
.l0-info-top{display:flex;gap:12px;align-items:flex-start}.l0-info-top>div{flex:1}
.l0-big{font-size:44px;line-height:1}
.l0-x{padding:2px 9px;font-size:16px}
.l0-occ-h{margin:8px 0 4px;font-size:12px;color:#58815e;font-weight:600}
.l0-occ-list{display:flex;flex-wrap:wrap;gap:5px}
.l0-occ{font-size:13px;padding:5px 9px;text-align:left}.l0-occ .cn{font-size:15px}.l0-occ.here{background:#e3eee0;border-color:#9fc0a8}
.l0-fam{display:flex;flex-wrap:wrap;gap:6px}.l0-fam span{display:inline-flex;flex-direction:column;align-items:center;min-width:40px;padding:3px 6px;border:1px solid #d6e3d5;border-radius:8px;background:#fff;font-size:22px}.l0-fam small{font-size:10px;color:#6c7f7b;font-family:system-ui,sans-serif}
.l0-sd{scroll-margin-top:160px}
.l0-tn{position:relative;cursor:pointer}.l0-tn:hover{background:#eef5ec}
.l0-tn.xl{border-color:#d9a93a}
.l0-tn.sel{box-shadow:0 0 0 3px #d9a93a88}
.l0-tn.flash{animation:l0flash 1.6s ease}
@keyframes l0flash{0%,60%{background:#fbe7b5}100%{background:#fff}}
.l0-xl{position:absolute;top:-7px;right:-7px;min-width:16px;height:16px;padding:0 3px;border-radius:8px;background:#d9a93a;color:#fff;font-size:10px;font-style:normal;line-height:16px;text-align:center}
.l0-xl.static{position:static;display:inline-block}
.l0-gap{min-width:34px;height:40px;border-style:dashed;color:#8a8478}
.l0-rail-sd{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.l0-rail-sd button{border-radius:8px!important;height:auto!important;padding:4px!important;font-size:12px!important}
.l0-mx-wrap{overflow:auto;max-height:75vh;border:1px solid #d9e3d6;border-radius:12px;background:#fff}
.l0-mx{border-collapse:separate;border-spacing:0;font-size:12px}
.l0-mx th,.l0-mx td{border-right:1px solid #eef1ea;border-bottom:1px solid #eef1ea;padding:0;text-align:center;min-width:46px}
.l0-mx thead th{position:sticky;top:0;z-index:2;background:#edf4e9;padding:4px 2px}
.l0-mx thead th .cn{display:block;font-size:20px}.l0-mx thead th small{display:block;font-size:10px;color:#58815e;white-space:nowrap}
.l0-mx tbody th{position:sticky;left:0;z-index:1;background:#f7f3ea}
.l0-mx .l0-mx-corner{left:0;z-index:3;font-size:10px;color:#6b6f68;min-width:70px}
.l0-mx-base,.l0-mx td button{display:flex;flex-direction:column;align-items:center;width:100%;border:0;border-radius:0;background:transparent;padding:4px 2px;position:relative}
.l0-mx-base b.cn{font-size:24px}.l0-mx td b.cn{font-size:21px;font-weight:500}
.l0-mx small{font-size:10px;color:#6c7f7b}
.l0-mx td.has{background:#fbfdf9}.l0-mx td.has:hover{background:#f3f8ef}
.l0-mx td.supp button{outline:1px dashed #b9a77f;outline-offset:-3px}
.l0-mx tr.row-on>td,.l0-mx tr.row-on>th,.l0-mx .col-on{background:#fdf3d6}
.l0-mx td.has.row-on,.l0-mx tr.row-on>td.has,.l0-mx td.has.col-on{background:#fbe7b5}
.l0-mx td.hit,.l0-mx td.has.hit{background:#f3cf6e;box-shadow:inset 0 0 0 2px #c08a1e}
.l0-mx thead th.col-on,.l0-mx tr.row-on>th{background:#f3cf6e}
.l0-mx-rad{display:block;width:100%;border:0;border-radius:0;background:transparent;padding:0}
.l0-dot{position:absolute;top:3px;right:3px;width:6px;height:6px;border-radius:50%;background:#1b6c63}
.l0-note{font-size:13px;margin-top:8px}
.l0-grid td{padding:6px}.l0-grid select{font-size:20px;min-width:64px}
.l0-word{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:4px 0 12px}.l0-word span{font-size:13px}
.rail-numbers button.kt-ok{background:#dff0e3;border-color:#1b6c63}.rail-numbers button.kt-bad{background:#fbe2dd;border-color:#a33a2c}
.quiz-opt.kt-right{border-color:#1b6c63;background:#edf4e9}
.tag.kt-wrong{background:#fbe2dd;color:#a33a2c}
@media(max-width:700px){.l0-big{font-size:36px}}
.l0-mxinfo{margin:0 0 10px}
/* Lọc hàng / cột ma trận */
.l0-filter{margin:6px 0 10px;border:1px solid #d9e3d6;border-radius:12px;background:#fff}
.l0-filter>summary{cursor:pointer;padding:9px 12px;font-weight:600;font-size:14px;color:#1b4c46}
.l0-filter>summary .tag{margin-left:6px}
.l0-filter-body{padding:0 12px 12px}
.l0-fchips{display:flex;flex-wrap:wrap;gap:5px}
.l0-fchips button{padding:4px 9px;font-size:13px;border-radius:999px}
.l0-fchips.cn button{font-size:18px;min-width:40px;padding:2px 8px}
.l0-fchips button.on{background:#1b6c63;color:#fff;border-color:#1b6c63}
.l0-filter-foot{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-top:10px;font-size:13px}
.l0-factive{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.l0-factive button{font-size:13px;padding:4px 10px;border-radius:999px;background:#fbe7b5;border-color:#d9a93a;color:#5e430b}
.l0-factive button.link{background:transparent;border-color:transparent;color:#1b6c63;text-decoration:underline}
.l0-qf{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.l0-qf button{font-size:12px;padding:4px 9px}
/* Bottom sheet thông tin chữ (Level 0) */
.l0-hint{font-size:13px;margin:4px 0 10px}
.l0-sheet{position:fixed;left:0;right:0;bottom:0;z-index:1000;display:flex;justify-content:center;pointer-events:none;transform:translateY(105%);transition:transform .22s ease}
.l0-sheet.open{transform:none}
.l0-sheet-in{pointer-events:auto;width:min(920px,100%);max-height:52vh;overflow:auto;padding:6px 16px 14px;background:#fff;border:1px solid #c9d9c8;border-bottom:0;border-radius:18px 18px 0 0;box-shadow:0 -8px 28px rgba(30,50,40,.18)}
.l0-sheet-grip{display:block;width:44px;height:5px;margin:2px auto 8px;border-radius:3px;background:#d3dccf}
.l0-sheet .l0-info{padding:0;border:0;background:transparent;box-shadow:none}
.l0-sheet .l0-x{font-size:22px;line-height:1;padding:4px 12px;border-radius:10px}
@media(max-width:700px){.l0-sheet-in{max-height:60vh;padding:6px 12px 12px}}
.l0-mx td.multi button{padding:3px 2px}.l0-mx td.multi{vertical-align:top}.l0-mx td button.supp{outline:1px dashed #b9a77f;outline-offset:-3px}

/* Level 1 · 7 bước phát triển (tab Lý thuyết | Bài tập) và bài phát triển cụm dạng bảng */
.l1-step-head{margin:0 0 10px}
.l1-step-head .eyebrow{font-size:12px}
.l1-step-chain{font-size:22px;margin:4px 0 2px}
.l1-step-head .muted{margin:0}
.l0-htabs small{font-weight:400;font-size:12px;opacity:.8}
.l1-step-btn b{color:#58815e}.l1-step-btn.active b{color:#deebdf}
.l1-step-btn small{font-weight:400;font-size:11px;opacity:.75}
.l1-theory>details,.l1-theory .component-branch{scroll-margin-top:12px}
.l1-base{font-size:16px;margin:8px 0}.l1-base .cn{font-size:26px}.l1-base button{padding:2px 9px;font-size:13px}
.l1-table-wrap{overflow-x:auto;border:1px solid #d9e3d6;border-radius:12px;background:#fff}
.l1-table{width:100%;border-collapse:collapse;font-size:14px}
.l1-table th{background:#edf4e9;color:#1b4c46;text-align:left;padding:9px 10px;font-weight:600;border-bottom:1px solid #d9e3d6;white-space:nowrap}
.l1-table td{padding:8px 10px;border-bottom:1px solid #eef1ea;vertical-align:top}
.l1-table tr:last-child td{border-bottom:0}
.l1-c-step{width:24%;color:#3d413c}.l1-c-step b{color:#1b6c63}
.l1-c-add{width:14%;font-size:22px;color:#5e430b;background:#fffbea}
.l1-c-in{width:30%}
.l1-in{width:100%;font-size:20px;padding:6px 8px;border:1px solid #cfdccc;border-radius:8px;background:#fbfdf9}
.l1-in:focus{outline:2px solid #87b7aa;border-color:#1b6c63;background:#fff}
.l1-c-ans{width:32%}
.l1-ans-btn{font-size:13px;padding:6px 10px;white-space:nowrap}
.l1-ans{margin-top:8px;padding:8px 10px;border-radius:10px;background:#f6faf3;border:1px solid #d6e3d5}
.l1-ans p{margin:2px 0}.l1-ans-zh{font-size:20px}.l1-ans-vi{color:#3d413c}.l1-ans-ex{font-size:13px;color:#6b6f68}
.l1-ans .theory-ref{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.l1-ans .theory-ref button{font-size:12px;padding:3px 8px}
.l1-table-wrap{container-type:inline-size}
.l1-in::placeholder{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:14px;letter-spacing:0;color:#9aa69f}
/* Khung nội dung hẹp (điện thoại, hoặc máy tính có cả hai lề): mỗi bước thành một thẻ */
@container (max-width:620px){
  .l1-table thead{display:none}
  .l1-table,.l1-table tbody,.l1-table tr,.l1-table td{display:block;width:100%}
  .l1-table tr{border-bottom:1px solid #d9e3d6;padding:8px 0}
  .l1-table td{border:0;padding:3px 12px}
  .l1-table td::before{content:attr(data-l);display:block;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-size:11px;color:#58815e;font-weight:600;text-transform:uppercase;letter-spacing:.04em}
  .l1-c-step{font-size:15px}
  .l1-c-add{background:transparent}
}
/* Level 1 · tab con bài tập ở lề phải */
#rail-tabs{margin-bottom:12px}
#rail-tabs h3{margin-top:0}
#rail-tabs .lk-tabs{display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:0;padding:0;background:none;border:0}
#rail-tabs .lk-tabs button{width:100%;text-align:left;font-size:13px;padding:8px 10px;white-space:normal;border-radius:10px}
#rail-tabs .lk-tabs button.active{background:#1b6c63;color:#fff;border-color:#1b6c63}

/* ---------- quiz.js: bài tập / kiểm tra dùng chung (2026-11-20) ---------- */
.qz-in{display:block;width:100%;max-width:560px;margin:8px 0;padding:10px 12px;font-size:20px;border:1.5px solid #cfd8c8;border-radius:10px;background:#fff;transition:box-shadow .15s,border-color .15s}
.qz-in.qz-on,.qz-in:focus{outline:none;border-color:#e0a100;background:#fffbea;box-shadow:0 0 0 4px rgba(240,180,0,.28)}
.qz-in.ok{border-color:#1b6c63;background:#edf4e9}.qz-in.bad{border-color:#a33a2c;background:#fdf0ed}
.qz-dev{margin:6px 0 0;padding-left:22px}.qz-dev li{margin:6px 0}.qz-dev .qz-in{margin:4px 0 2px}
.qz-hint{font-size:14px;color:#58815e}
.qz-bank{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.qz-bank button{font-size:19px;padding:6px 12px;border-radius:9px}
.qz-bank .qz-clear{font-size:13px;margin-left:auto}
.qz-ans{margin-top:10px;padding:10px 12px;border-radius:10px;background:#f1f5ed}.qz-ans.bad{background:#fbefe9}.qz-ans p{margin:4px 0 0}
.qz-ans .cn{font-size:19px}
.quiz-opt.kt-wrongopt{border-color:#a33a2c;background:#fbe2dd}
.qz-rail-g{margin:8px 0 2px;font-size:12px;color:#58815e;font-weight:600}
.lv-theory .card{margin:14px 0}
.lv-fam{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:6px;margin:8px 0}
.lv-fam span{padding:6px 8px;border:1px solid #e0e6dc;border-radius:8px;background:#fff;font-size:13px}
.lv-fam b{font-size:19px;font-weight:600;margin-right:4px}
.lv-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.lv-head .cn{font-size:34px}
.nav-fold.lv-fold>summary{font-size:15px;letter-spacing:0;text-transform:none;color:#1b6c63;font-weight:700;padding:8px 6px;border-radius:9px;background:#eef3ea}
.nav-fold.lv-fold>button,.nav-fold.lv-fold>a{margin-left:10px;width:calc(100% - 10px)}
.nav-kt{display:block;width:100%;margin-top:10px}
#app input:focus,#app textarea:focus{outline:none;border-color:#e0a100 !important;background:#fffbea;box-shadow:0 0 0 4px rgba(240,180,0,.28)}
.ff-on{border-color:#e0a100 !important;background:#fffbea !important;box-shadow:0 0 0 4px rgba(240,180,0,.28) !important}
.l0-subtopic{margin-left:14px !important;width:calc(100% - 14px) !important;font-size:14px}

/* 2.1: lề phải liệt kê chữ gốc, 5 chữ một hàng */
.rail-numbers.l0-rail-ch{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.rail-numbers.l0-rail-ch button{min-width:0;padding:5px 0;font-size:17px}

/* Nút tải Word nằm dưới số thứ tự câu ở lề phải */
.study-right .l0-word{display:flex;flex-direction:column;gap:4px;margin-top:12px}
.study-right .l0-word button{width:100%;white-space:normal}
.study-right .l0-word .muted{font-size:12px}

/* Tab ngang Lý thuyết | Bài tập luôn hiện khi cuộn */
.l0-htabs{position:sticky;top:12px;z-index:30;box-shadow:0 4px 14px rgba(40,30,10,.10)}

/* Level 5 · 2.3: tab hướng dịch ở lề phải */
.practice-mode-tabs.rail-dir{display:flex;flex-direction:column;gap:6px;margin:0 0 14px}
.practice-mode-tabs.rail-dir button{width:100%}

/* Điện thoại: menu trái và lề phải thành thanh thả xuống (mobile-dd.js) */
.dd-toggle{display:none}
@media (max-width:760px){
  .dd-toggle{display:flex;align-items:center;gap:8px;width:100%;margin:0;padding:12px 14px;border:1px solid #d9ccb6;border-radius:12px;background:#fffdf7;font:inherit;font-size:15px;text-align:left;color:#2d2a24;cursor:pointer}
  .dd-toggle .dd-h{font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#1b6c63;flex:none}
  .dd-toggle .dd-cur{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dd-toggle .dd-arrow{margin-left:auto;color:#1b6c63}
  .dd-host:not(.dd-closed) > .dd-toggle{margin-bottom:12px}
  .dd-host.dd-closed > :not(.dd-toggle){display:none!important}
  aside.study-rail.dd-host,aside.study-right.dd-host{padding:10px 14px}
  aside.study-right.dd-host{position:static;max-height:none;overflow:visible}
}
@media (max-width:760px){
  aside.study-right.dd-host{background:transparent;border:0;box-shadow:none;padding:6px 14px 0}
  aside.study-right.dd-host:not(.dd-closed){background:#fffdf7;border:1px solid #e4d8c6;border-radius:14px;padding:10px 14px;margin:6px 14px 0}
}

/* Bỏ dòng ghi chú cuối trang ("… bài luyện tập · Đáp án tham khảo, không tự chấm…") — 2026-11-21 */
.study-content > .footer{display:none!important}
/* Chấm ô tự nhập (answer-check.js) */
.ans-ok{border-color:#1b6c63!important;background:#edf4e9!important}
.ans-bad{border-color:#c0533f!important;background:#fdf1ee!important}
.ans-fb{display:block;margin:4px 0 0;font-size:14px;font-weight:600}
.ans-fb.ok{color:#1b6c63}.ans-fb.bad{color:#a33a2c}.ans-fb.near{color:#9a6a00}
.l1-ans-alts{margin:4px 0;font-size:14px}.l1-ans-alts .cn{font-size:17px}
