/* v1.7.59 – BS122 đợt 1: ngăn chọn học liệu + thẻ học liệu trong chat (theo Canvas Gemini 563880d6b0a6a727) */
.hl-add { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: #F0FDFA; color: #0F766E; border: 1px solid #99F6E4; font-weight: 600; white-space: nowrap; }
.hl-add:hover { background: #CCFBF1; }
.hl-add svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .hl-add span { display: none; } .hl-add { padding: 0 10px; } }

body.hlk-on { overflow: hidden; }
.hlk-wrap { position: fixed; inset: 0; z-index: 1200; }
.hlk-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); }
.hlk { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--card, #fff); color: var(--ink, #0f172a); display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(15, 23, 42, .18); }
.hlk-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line, #e2e8f0); }
.hlk-h h2 { margin: 0; font-size: 18px; } .hlk-h p { margin: 2px 0 0; font-size: 13px; color: var(--muted, #64748b); }
.hlk-x { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted, #64748b); display: grid; place-items: center; cursor: pointer; }
.hlk-x:hover { background: var(--soft, #f1f5f9); }
.hlk-b { flex: 1; overflow-y: auto; padding: 14px 20px 20px; }   /* vùng cuộn DUY NHẤT của ngăn */
.hlk-s { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; background: var(--soft, #f8fafc); color: var(--muted, #64748b); }
.hlk-s input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--ink, #0f172a); outline: none; min-width: 0; }
.hlk-s:focus-within { border-color: #0F766E; box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
.hlk-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 0 10px; padding: 4px; border-radius: 12px; background: var(--soft, #f1f5f9); }
.hlk-tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: 600 14px inherit; color: var(--muted, #64748b); cursor: pointer; }
.hlk-tabs button[aria-selected="true"] { background: var(--card, #fff); color: #0F766E; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.hlk-chips > div { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; justify-content: flex-start; }
.hlk-chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line, #e2e8f0); background: var(--card, #fff); font: 500 13.5px inherit; color: var(--ink, #334155); cursor: pointer; }
.hlk-chip span { color: var(--muted, #64748b); font-size: 12px; margin-left: 2px; }
.hlk-chip.on { background: #0F766E; border-color: #0F766E; color: #fff; } .hlk-chip.on span { color: #CCFBF1; }
.hlk-g { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted, #64748b); }
.hlk-lk { border: 0; background: none; color: var(--muted, #64748b); font: inherit; cursor: pointer; min-height: 32px; }
.hlk-r { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; margin-bottom: 8px; min-height: 64px; border-radius: 14px; border: 1px solid var(--line, #e2e8f0); background: var(--card, #fff); cursor: pointer; font: inherit; color: inherit; }
.hlk-r:hover { border-color: #5EEAD4; }
.hlk-r.on { border-color: #0F766E; background: #F0FDFA; box-shadow: inset 0 0 0 1px #0F766E; }
.hlk-r:focus-visible, .hlk-chip:focus-visible, .hlk-tabs button:focus-visible { outline: 2px solid #0D9488; outline-offset: 2px; }
.hlk-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.hlk-ic.t-lesson { background: #E0F2FE; color: #0369A1; } .hlk-ic.t-practice { background: #FEF3C7; color: #B45309; } .hlk-ic.t-exam { background: #CCFBF1; color: #0F766E; } .hlk-ic.t-file { background: #EDE9FE; color: #6D28D9; }
.hlk-t { flex: 1; min-width: 0; } .hlk-t b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.35; }
.hlk-t small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted, #64748b); } .hlk-t small i { font-style: normal; color: #0F766E; }
.hlk-ck { flex: none; width: 26px; height: 26px; border-radius: 999px; border: 2px solid #CBD5E1; display: grid; place-items: center; color: #fff; }
.hlk-r.on .hlk-ck { background: #0F766E; border-color: #0F766E; } .hlk-ck svg { width: 16px; height: 16px; }
.hlk-more { width: 100%; min-height: 44px; margin-top: 4px; }
.hlk-empty { padding: 20px 4px; color: var(--muted, #64748b); text-align: center; }
.hlk-f { padding: 12px 20px 16px; border-top: 1px solid var(--line, #e2e8f0); background: var(--card, #fff); }
.hlk-fn { margin: 0 0 8px; font-size: 12.5px; color: var(--muted, #64748b); }
.hlk-go { width: 100%; min-height: 48px; font-size: 15px; }
@media (max-width: 760px) {
  .hlk { top: 0; width: 100%; border-radius: 0; box-shadow: none; }
  .hlk-h { padding: 14px 16px 10px; } .hlk-b { padding: 12px 16px 16px; } .hlk-f { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
}

/* thẻ học liệu trong chat */
.m.xcard.hlc { max-width: 440px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line, #e2e8f0); background: var(--card, #fff); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.hlc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .hlc-h time { margin-left: auto; font-size: 12px; color: var(--muted, #64748b); }
.hlc-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 8px; background: #F0FDFA; border: 1px solid #99F6E4; color: #0F766E; font-size: 12.5px; font-weight: 600; }
.hlc-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.hlc-st.s-moi { color: #0F766E; } .hlc-st.s-moi i { width: 8px; height: 8px; border-radius: 999px; background: #0D9488; }
.hlc-st.s-nop { color: #15803D; } .hlc-st.s-het { color: #B45309; }
.hlc-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; line-height: 1.4; }
.hlc-n { margin-top: 4px; font-size: 13px; color: var(--muted, #64748b); }
.hlc-b { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 12px; border-radius: 12px; text-decoration: none; font-weight: 600; }
.hlc-b svg { width: 18px; height: 18px; }
.hlc.het, .hlc.gone { opacity: .75; } .hlc.gone .hlc-t { text-decoration: line-through; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl-add, :root:not([data-theme="light"]) .hlc-chip { background: rgba(13, 148, 136, .16); border-color: rgba(94, 234, 212, .35); color: #5EEAD4; } }
[data-theme="dark"] .hl-add, [data-theme="dark"] .hlc-chip { background: rgba(13, 148, 136, .16); border-color: rgba(94, 234, 212, .35); color: #5EEAD4; }
[data-theme="dark"] .hlk-r.on { background: rgba(13, 148, 136, .14); }

/* lớp trực tiếp: chọn trang để chiếu + thanh lật trang trên sân khấu */
.hlg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 560px) { .hlg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hlg-p { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid var(--line, #e2e8f0); background: var(--card, #fff); cursor: pointer; font: 500 13px inherit; color: var(--ink, #334155); min-height: 44px; }
.hlg-p.on { border-color: #0D9488; box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); color: #0F766E; }
.hlg-i { display: block; width: 100%; aspect-ratio: 3 / 4; background: var(--soft, #f1f5f9); border-radius: 6px; overflow: hidden; }
.hlg-i img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.hlg-more { display: flex; justify-content: center; margin-top: 10px; } .hlg-more .btn { min-height: 44px; }
.lv-hlnav { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(15, 23, 42, .82); color: #fff; font-size: 14px; font-weight: 600; }
.lv-hlnav span { padding: 0 10px; white-space: nowrap; }
.lv-hlnav button { width: 44px; height: 44px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.lv-hlnav button:disabled { opacity: .35; cursor: default; }
.lv-hlnav button:focus-visible { outline: 2px solid #5EEAD4; outline-offset: 2px; }
.hlg-p { position: relative; }
.hlg-p.on::after { content: ""; position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 999px; background: #0D9488 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 0 0 2px #fff; }

/* Gemini đối chiếu bản code: tấm chọn học liệu trên điện thoại bị chat đè (khung chat điện thoại nằm lớp trên) → lớp cao hơn, nền đặc */
.hlk-wrap { z-index: 9000; }
.hlk { background: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hlk { background: #0F172A; } }
[data-theme="dark"] .hlk { background: #0F172A; }
.lv-hlnav { border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 4px 12px rgba(0, 0, 0, .28); }
@media (max-width: 760px) { .chat .chd .tt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.hlk .hlk-loai, .hlk .hlk-mons { display: flex !important; flex-wrap: wrap; justify-content: flex-start !important; gap: 8px; margin-bottom: 10px; }
.hlk #hlkc { display: block !important; text-align: left; } .hlk .hlk-loai, .hlk .hlk-mons { width: 100%; }
