/* ===== Tra từ tại chỗ (tra-tu.js) — nút "Tra" khi bôi đen chữ tiếng Anh + thẻ nghĩa; dùng chung /dashboard và /test — 28/10/2026 ===== */
.tra-btn, .t-dict { --tt-forest: #3A4A32; --tt-olive: #5F6D45; --tt-ink: #3F4236; --tt-mute: #625E51; --tt-line: #E2D8C0; font-family: "Be Vietnam Pro", system-ui, sans-serif; }
.tra-btn { position: fixed; z-index: 61; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 0; border-radius: 6px; background: var(--tt-forest); color: #FBF6EA; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(46, 53, 40, .55); }
.tra-btn[hidden] { display: none; }
.tra-btn svg { width: 16px; height: 16px; }
.tra-btn:hover { background: #4A5C40; }

.t-dict { position: fixed; z-index: 60; width: min(370px, calc(100vw - 16px)); max-height: min(72vh, 560px); overflow-y: auto; padding: 16px 18px 12px; border: 1px solid #E6C76A; border-radius: 8px; background: #FFFDF7; box-shadow: 0 18px 40px -16px rgba(46, 53, 40, .45); color: var(--tt-ink); text-align: left; }
.t-dict[hidden] { display: none; }
.t-dict p { margin: 0; }
.t-dict-wait { color: var(--tt-mute); font-size: 14px; }
.t-dict-h { display: flex; align-items: baseline; gap: 8px; }
.t-dict-h b { font: 700 24px/1.2 "Lora", Georgia, serif; color: var(--tt-forest); text-transform: capitalize; }
.t-dict-h b.long { font-size: 16px; text-transform: none; }
.t-dict-h em { font-style: normal; font-weight: 600; font-size: 14px; color: var(--tt-olive); }
.t-dict-lv { margin-left: auto; padding: 2px 7px; border-radius: 4px; background: #EAF0DE; color: var(--tt-forest); font-style: normal; font-size: 11.5px; font-weight: 700; }
.t-dict-h-say { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; border: 0; border-radius: 50%; background: #F1ECDC; color: var(--tt-forest); cursor: pointer; align-self: center; }
.t-dict-h-say svg { width: 17px; height: 17px; }
.t-dict-ipa { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 4px; }
.t-dict-acc { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.t-dict-acc small { padding: 1px 5px; border-radius: 4px; background: #F1ECDC; color: var(--tt-mute); font-size: 11px; font-weight: 700; }
.t-dict-acc button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #F1ECDC; color: var(--tt-forest); cursor: pointer; }
.t-dict-acc button:hover, .t-dict-h-say:hover { background: #E6DFC8; }
.t-dict-acc svg { width: 15px; height: 15px; }
.t-dict-m { margin: 8px 0 10px !important; font-weight: 700; font-size: 17px; line-height: 1.45; }
.t-dict-other { margin: -4px 0 10px !important; color: var(--tt-mute); font-size: 13px; line-height: 1.5; }
.t-dict-more { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--tt-olive); background: #F4F1E6; font-size: 13.5px; line-height: 1.55; }
.t-dict-more p { margin: 0 0 4px !important; }
.t-dict-more p:last-child { margin-bottom: 0 !important; }
.t-dict-more ul { margin: 2px 0 4px; padding-left: 18px; }
.t-dict-more b { color: var(--tt-forest); }
.t-dict-soon { color: var(--tt-mute); font-style: italic; }
.t-dict-ex { margin: 0 0 10px; padding: 10px 12px; border-radius: 6px; background: #FBF2DC; }
.t-dict-ex p { margin: 0 0 4px !important; font-weight: 600; font-size: 14.5px; line-height: 1.5; }
.t-dict-ex small { color: var(--tt-mute); font-style: italic; font-size: 13px; line-height: 1.45; }
.t-dict-lab { display: block; margin-bottom: 2px; font-style: normal !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px !important; color: var(--tt-olive) !important; }
.t-dict-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 2px; padding: 10px; border: 0; border-radius: 6px; background: var(--tt-forest); color: #FBF6EA; font: 700 14px/1 "Be Vietnam Pro", sans-serif; cursor: pointer; }
.t-dict-add svg { width: 17px; height: 17px; }
.t-dict-add:hover { background: #4A5C40; }
.t-dict-add.on { background: #EAF0DE; color: var(--tt-forest); }
.t-dict-add.on svg { fill: currentColor; }
.t-dict-add.no { background: #FBE9DC; color: #8A4A22; }
.t-dict-src { margin-top: 8px !important; padding-top: 8px; border-top: 1px dashed var(--tt-line); color: var(--tt-mute); font-size: 12px; text-align: center; }
.t-dict { padding-top: 14px; }
.t-dict-x { position: sticky; top: 0; float: right; width: 28px; height: 28px; margin: -4px -6px 0 8px; border: 0; border-radius: 50%; background: #F1ECDC; color: var(--tt-forest); font-size: 18px; line-height: 1; cursor: pointer; z-index: 1; }
.t-dict-x:hover { background: #E6DFC8; }
.t-dict-h { flex-wrap: wrap; }
.t-dict-h em, .t-dict-lab { color: #4F5B3A !important; }
.t-dict-acc small, .t-dict-src, .t-dict-other, .t-dict-ex small { color: #5A5648; }
:is(.tra-btn, .t-dict-add, .t-dict-x, .t-dict-acc button, .t-dict-h-say):focus-visible { outline: 2px solid #3A4A32; outline-offset: 2px; }
/* 28/10 đợt 2: nhãn nhỏ trong thẻ tối thiểu 12px */
.t-dict :is(.t-dict-lv, .t-dict-lab, small) { font-size: 12px !important; }
