/* ============================================================================
   Kiet So Much — linh vật bay quanh trang + khung chat hướng dẫn (dùng trong shell.html)
   Màu lấy từ theme.css: --tdmu, --tdmu-dark, --tdmu-sky, --tdmu-light, --tt-*
   ============================================================================ */
#tb-root { --tb-size: 96px; font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif; }
#tb-root *, #tb-root *::before, #tb-root *::after { box-sizing: border-box; }
#tb-root [hidden] { display: none !important; }

/* ===== Linh vật ===== */
#tb-bot {
  position: fixed; left: 0; top: 0; z-index: 9000; width: var(--tb-size); height: var(--tb-size);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
  transition: opacity .25s;
}
#tb-bot.tb-grabbing { cursor: grabbing; }
#tb-bot.tb-away { opacity: 0; pointer-events: none; }
#tb-bot:focus-visible .tb-fly { filter: drop-shadow(0 0 0 3px var(--tdmu-sky)); outline: 3px solid var(--tdmu-sky); outline-offset: 4px; border-radius: 24px; }
.tb-fly { width: 100%; height: 100%; animation: tb-bob 3.2s ease-in-out infinite; transform-origin: 50% 80%; transition: transform .5s ease; }
.tb-moving .tb-fly { animation-duration: 1.1s; }
.tb-tilt-r .tb-fly { transform: rotate(9deg); }
.tb-tilt-l .tb-fly { transform: rotate(-9deg); }
.tb-svg { width: 100%; height: 100%; display: block; overflow: visible; transform: scaleX(var(--tb-face, 1)); transition: transform .35s; filter: drop-shadow(0 6px 10px rgba(35, 47, 115, .28)); }
.tb-shadow { position: absolute; left: 50%; bottom: -14px; width: 46%; height: 8px; margin-left: -23%; border-radius: 50%; background: rgba(35, 47, 115, .22); filter: blur(3px); animation: tb-shadow 3.2s ease-in-out infinite; }
.tb-moving .tb-shadow { animation-duration: 1.1s; }

/* các bộ phận của nhân vật */
.tb-eye { transform-box: fill-box; transform-origin: center; animation: tb-blink 5.2s infinite; }
.tb-eye.tb-e2 { animation-delay: .04s; }
.tb-flame { transform-box: fill-box; transform-origin: 50% 0; animation: tb-flame .22s ease-in-out infinite alternate; }
.tb-moving .tb-flame { animation-duration: .12s; transform: scaleY(1.5); }
.tb-wing { transform-box: fill-box; animation: tb-flap .9s ease-in-out infinite alternate; }
.tb-wing.tb-wl { transform-origin: 100% 60%; }
.tb-wing.tb-wr { transform-origin: 0% 60%; animation-direction: alternate-reverse; }
.tb-moving .tb-wing { animation-duration: .16s; }
.tb-armr { transform-box: fill-box; transform-origin: 20% 15%; }
#tb-bot:hover .tb-armr, .tb-chat-av .tb-armr, .tb-waving .tb-armr { animation: tb-wave .55s ease-in-out infinite alternate; }
.tb-ant { animation: tb-glow 1.8s ease-in-out infinite; }

/* cậu bé Shin: kéo má, lè lưỡi, lắc lư */
.tb-sway { transform-origin: 160px 260px; animation: tb-sway .9s ease-in-out infinite alternate; }
.tb-ch-l { transform-origin: 100px 180px; animation: tb-pull-l .8s ease-in-out infinite alternate; }
.tb-ch-r { transform-origin: 220px 180px; animation: tb-pull-r .8s ease-in-out infinite alternate; }
.tb-tongue { transform-origin: 160px 190px; animation: tb-tongue .4s ease-in-out infinite alternate; }
.tb-moving .tb-sway { animation-duration: .25s; }
.tb-moving .tb-tongue { animation-duration: .18s; }
.tb-chat-av .tb-sway, .tb-chat-av .tb-ch-l, .tb-chat-av .tb-ch-r, .tb-chat-av .tb-tongue,
.tb-mini .tb-sway, .tb-mini .tb-ch-l, .tb-mini .tb-ch-r, .tb-mini .tb-tongue { animation: none; }
@keyframes tb-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes tb-pull-l { from { transform: scaleX(1); } to { transform: scaleX(1.1) translateX(-6px); } }
@keyframes tb-pull-r { from { transform: scaleX(1); } to { transform: scaleX(1.1) translateX(6px); } }
@keyframes tb-tongue { from { transform: rotate(-5deg) scaleY(1); } to { transform: rotate(5deg) scaleY(1.12); } }

/* biểu tượng bay lên khi bấm vào linh vật */
.tb-pop { position: fixed; z-index: 10000; pointer-events: none; font-size: 20px; animation: tb-floatup .9s cubic-bezier(.1,.8,.2,1) forwards; }
@keyframes tb-floatup { 0% { opacity: 1; transform: translate(0,0) scale(.6); } 100% { opacity: 0; transform: translate(var(--tx,0), var(--ty,-60px)) scale(1.3) rotate(20deg); } }

@keyframes tb-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes tb-shadow { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.78); opacity: .55; } }
@keyframes tb-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes tb-flame { from { transform: scaleY(.8) scaleX(.95); opacity: .85; } to { transform: scaleY(1.2) scaleX(1.05); opacity: 1; } }
@keyframes tb-flap { from { transform: rotate(-8deg); } to { transform: rotate(14deg); } }
@keyframes tb-wave { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }
@keyframes tb-glow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* ===== Bong bóng lời chào / mẹo ===== */
.tb-bubble {
  position: absolute; bottom: calc(100% + 6px); right: 4px; width: max-content; max-width: min(260px, 70vw);
  background: #fff; color: var(--tt-ink); border: 1px solid var(--tt-line); border-radius: 16px 16px 4px 16px;
  box-shadow: 0 10px 28px rgba(35, 47, 115, .2); padding: 10px 28px 10px 14px; font-size: 13px; line-height: 1.45;
  animation: tb-pop .3s cubic-bezier(.2, 1.3, .4, 1); cursor: pointer; z-index: 2;
}
.tb-bubble b { color: var(--tdmu); }
.tb-bubble.tb-bl { right: auto; left: 4px; border-radius: 16px 16px 16px 4px; }
.tb-bubble.tb-below { bottom: auto; top: calc(100% + 6px); border-radius: 4px 16px 16px 16px; }
.tb-bubble-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--tt-muted); cursor: pointer; font-size: 15px; line-height: 1; }
.tb-bubble-x:hover { background: var(--tdmu-light); color: var(--tdmu); }
@keyframes tb-pop { from { opacity: 0; transform: scale(.7) translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Khung chat ===== */
#tb-chat {
  position: fixed; right: 16px; bottom: 16px; z-index: 9500; width: 392px; height: min(600px, calc(100vh - 32px));
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--tt-line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(35, 47, 115, .32), 0 2px 8px rgba(35, 47, 115, .12); animation: tb-open .28s cubic-bezier(.2, 1, .3, 1); transform-origin: 100% 100%;
}
@keyframes tb-open { from { opacity: 0; transform: translateY(20px) scale(.92); } to { opacity: 1; transform: none; } }
.tb-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; color: #fff; background: linear-gradient(135deg, var(--tdmu-dark) 0%, var(--tdmu) 60%, var(--tdmu-sky) 100%); }
.tb-chat-av { width: 46px; height: 46px; flex: 0 0 46px; background: #fff; border-radius: 50%; padding: 3px; display: flex; }
.tb-chat-av .tb-svg { filter: none; }
.tb-chat-av .tb-flame, .tb-chat-av .tb-wing { animation: none; }
.tb-ttl { flex: 1; min-width: 0; }
.tb-ttl b { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.tb-ttl small { display: flex; align-items: center; gap: 5px; font-size: 11.5px; opacity: .9; }
.tb-ttl small i { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
.tb-hbtn { width: 32px; height: 32px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; font-size: 16px; }
.tb-hbtn:hover { background: rgba(255, 255, 255, .3); }
.tb-hbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tb-ctx { padding: 6px 14px; font-size: 11.5px; color: var(--tt-muted); background: var(--tdmu-light); border-bottom: 1px solid var(--tt-line); display: flex; align-items: center; gap: 6px; }
.tb-ctx b { color: var(--tdmu); font-weight: 700; }
.tb-ctx span { flex: 1; min-width: 0; }
.tb-fly-opt { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.tb-fly-opt input { margin: 0; accent-color: var(--tdmu); }

.tb-msgs { flex: 1; overflow-y: auto; padding: 14px 12px 6px; background: var(--tt-bg); display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.tb-row { display: flex; gap: 8px; max-width: 100%; animation: tb-msg .25s ease; }
@keyframes tb-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tb-row.tb-u { justify-content: flex-end; }
.tb-mini { width: 28px; height: 28px; flex: 0 0 28px; background: #fff; border: 1px solid var(--tt-line); border-radius: 50%; padding: 2px; display: flex; align-self: flex-end; }
.tb-mini .tb-svg { filter: none; }
.tb-mini .tb-flame, .tb-mini .tb-wing, .tb-mini .tb-eye, .tb-mini .tb-ant { animation: none; }
.tb-msg { max-width: calc(100% - 38px); padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; color: var(--tt-ink); background: #fff; border: 1px solid var(--tt-line); border-bottom-left-radius: 5px; overflow-wrap: anywhere; }
.tb-u .tb-msg { background: var(--tdmu); color: #fff; border-color: var(--tdmu); border-radius: 16px 16px 5px 16px; max-width: 86%; }
.tb-msg p { margin: 0 0 6px; } .tb-msg p:last-child { margin-bottom: 0; }
.tb-msg ul, .tb-msg ol { margin: 4px 0 6px; padding-left: 20px; } .tb-msg li { margin: 2px 0; }
.tb-msg code { background: var(--tdmu-light); color: var(--tdmu-dark); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.tb-msg b { color: var(--tdmu-dark); font-weight: 700; }
.tb-u .tb-msg b { color: #fff; }
.tb-ttl-in { display: block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--tdmu-sky); margin-bottom: 4px; }
.tb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tb-act { border: 0; border-radius: 999px; background: var(--tdmu); color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; cursor: pointer; }
.tb-act:hover { background: var(--tdmu-dark); }
.tb-fb { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--tt-muted); }
.tb-fb button { border: 1px solid var(--tt-line); background: #fff; border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: 13px; }
.tb-fb button:hover { background: var(--tdmu-light); }
.tb-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.tb-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--tdmu-sky); animation: tb-dot 1s infinite; }
.tb-typing i:nth-child(2) { animation-delay: .15s; } .tb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tb-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.tb-sys { align-self: center; font-size: 11.5px; color: var(--tt-muted); background: var(--tdmu-light); border-radius: 999px; padding: 3px 12px; }

.tb-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 4px; background: var(--tt-bg); max-height: 112px; overflow-y: auto; }
.tb-chips:empty { display: none; }
.tb-chips-l { width: 100%; font-size: 11px; color: var(--tt-muted); margin-bottom: -2px; }
.tb-chip { border: 1px solid #C9D3F2; background: #fff; color: var(--tdmu); font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 5px 11px; cursor: pointer; text-align: left; line-height: 1.3; }
.tb-chip:hover { background: var(--tdmu-light); border-color: var(--tdmu-sky); }
.tb-chip small { font-weight: 500; color: var(--tt-muted); }

.tb-form { display: flex; gap: 8px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid var(--tt-line); }
.tb-form input { flex: 1; min-width: 0; border: 1px solid var(--tt-line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--tt-ink); background: var(--tt-bg); outline: none; }
.tb-form input:focus { border-color: var(--tdmu-sky); box-shadow: 0 0 0 3px rgba(66, 173, 226, .2); background: #fff; }
.tb-send { width: 42px; border: 0; border-radius: 12px; background: var(--tdmu); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tb-send:hover { background: var(--tdmu-dark); } .tb-send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-foot { padding: 0 12px 8px; font-size: 10.5px; color: var(--tt-muted); text-align: center; background: #fff; }

/* ===== Bảng quản lý kiến thức (tài khoản quyền cao nhất) ===== */
#tb-admin { position: fixed; inset: 0; z-index: 9800; background: rgba(15, 23, 42, .5); display: grid; place-items: center; padding: 14px; }
.tb-adm { width: min(1040px, 100%); height: min(720px, 100%); background: #fff; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.tb-adm-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: linear-gradient(135deg, var(--tdmu-dark), var(--tdmu)); color: #fff; }
.tb-adm-h b { font-size: 16px; flex: 1; }
.tb-tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: var(--tdmu-light); border-bottom: 1px solid var(--tt-line); }
.tb-tab { border: 0; background: transparent; padding: 9px 14px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--tt-muted); cursor: pointer; border-radius: 10px 10px 0 0; }
.tb-tab.on { background: #fff; color: var(--tdmu); box-shadow: 0 -2px 0 var(--tdmu-sky) inset; }
.tb-tab em { font-style: normal; background: var(--tdmu-sky); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.tb-adm-b { flex: 1; min-height: 0; display: flex; }
.tb-pane { flex: 1; min-width: 0; display: none; } .tb-pane.on { display: flex; }
.tb-list { width: 340px; flex: 0 0 340px; border-right: 1px solid var(--tt-line); display: flex; flex-direction: column; min-height: 0; }
.tb-list-t { padding: 10px; display: flex; gap: 6px; border-bottom: 1px solid var(--tt-line); }
.tb-list-t input, .tb-list-t select, .tb-fld input, .tb-fld select, .tb-fld textarea, .tb-test input, .tb-test select { border: 1px solid var(--tt-line); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13px; background: #fff; color: var(--tt-ink); min-width: 0; }
.tb-list-t input { flex: 1; } .tb-list-t select { max-width: 128px; }
.tb-items { flex: 1; overflow-y: auto; }
.tb-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--tt-line); background: #fff; padding: 9px 12px; cursor: pointer; font: inherit; }
.tb-item:hover { background: var(--tdmu-light); } .tb-item.on { background: #E4EAFB; box-shadow: 3px 0 0 var(--tdmu) inset; }
.tb-item b { display: block; font-size: 13px; color: var(--tt-ink); font-weight: 600; }
.tb-item small { font-size: 11px; color: var(--tt-muted); }
.tb-item.off b { opacity: .5; text-decoration: line-through; }
.tb-tag { display: inline-block; background: var(--tdmu-light); color: var(--tdmu); border-radius: 6px; padding: 0 6px; margin-right: 6px; font-weight: 600; }
.tb-edit { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 16px; }
.tb-fld { margin-bottom: 11px; } .tb-fld label { display: block; font-size: 12px; font-weight: 600; color: var(--tt-muted); margin-bottom: 4px; }
.tb-fld input, .tb-fld select, .tb-fld textarea { width: 100%; } .tb-fld textarea { resize: vertical; line-height: 1.45; }
.tb-fld .tb-hint { font-size: 11px; color: var(--tt-muted); margin-top: 3px; }
.tb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb-prev { border: 1px dashed #C9D3F2; border-radius: 12px; padding: 10px 13px; font-size: 13px; background: var(--tt-bg); }
.tb-chk { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin: 6px 0 12px; } .tb-chk label { display: flex; gap: 6px; align-items: center; }
.tb-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tb-btn { border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--tdmu); color: #fff; }
.tb-btn:hover { background: var(--tdmu-dark); } .tb-btn.g { background: #fff; color: var(--tdmu); border: 1px solid #C9D3F2; } .tb-btn.g:hover { background: var(--tdmu-light); } .tb-btn.r { background: #fff; color: #d93025; border: 1px solid #f2c5c1; }
.tb-note { font-size: 12.5px; color: var(--tt-muted); } .tb-note.ok { color: #188038; } .tb-note.err { color: #d93025; }
.tb-tbl { width: 100%; border-collapse: collapse; font-size: 13px; } .tb-tbl th, .tb-tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--tt-line); vertical-align: top; }
.tb-tbl th { color: var(--tt-muted); font-weight: 600; font-size: 12px; position: sticky; top: 0; background: #fff; }
.tb-scroll { flex: 1; overflow: auto; padding: 4px 10px 14px; }
.tb-test { padding: 14px 16px; flex: 1; overflow: auto; } .tb-test .tb-row2 { display: flex; gap: 8px; margin-bottom: 12px; } .tb-test input { flex: 1; }
.tb-bar { height: 7px; border-radius: 4px; background: var(--tdmu-light); overflow: hidden; min-width: 70px; } .tb-bar i { display: block; height: 100%; background: var(--tdmu-sky); }

/* ===== Điện thoại ===== */
@media (max-width: 560px) {
  #tb-root { --tb-size: 76px; }
  #tb-chat { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  .tb-list { width: 100%; flex-basis: auto; border-right: 0; } .tb-pane.on { flex-direction: column; } .tb-edit { padding: 12px; }
  .tb-two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-fly, .tb-shadow, .tb-eye, .tb-flame, .tb-wing, .tb-ant, .tb-sway, .tb-ch-l, .tb-ch-r, .tb-tongue, .tb-pop, .tb-typing i, #tb-chat, .tb-bubble, .tb-row { animation: none !important; }
  .tb-msgs { scroll-behavior: auto; }
}

/* ===== Mời cà phê: nút trên bong bóng + ảnh mã QR trong khung chat ===== */
.tb-cf { display: flex; gap: 6px; margin-top: 8px; }
.tb-cf button { border: 0; border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; background: var(--tdmu-light); color: var(--tdmu); }
.tb-cf button:hover { background: #DCE5FA; }
.tb-cf button[data-cf="yes"] { background: var(--tdmu); color: #fff; }
.tb-cf button[data-cf="yes"]:hover { background: var(--tdmu-dark); }
.tb-qr { display: block; margin: 8px 0 6px; }
.tb-qr img { display: block; width: 100%; max-width: 230px; border-radius: 14px; border: 1px solid var(--tt-line); box-shadow: 0 6px 16px rgba(35, 47, 115, .12); }
/* ===== Hộp thư góp ý (phủ lên khung chat) ===== */
.tb-fbp { position: absolute; inset: 0; z-index: 6; background: #fff; display: flex; flex-direction: column; border-radius: inherit; }
.tb-fbh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--tt-line); color: var(--tdmu-dark); }
#tb-fbform { display: flex; flex-direction: column; gap: 9px; padding: 14px; overflow: auto; flex: 1; }
#tb-fbform .tb-fbn { margin: 0; font-size: 13px; color: var(--tt-muted); line-height: 1.5; }
#tb-fbform textarea, #tb-fbform input:not(#tb-fbweb) { width: 100%; border: 1px solid var(--tt-line); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 14px; background: var(--tt-bg); color: var(--tt-ink); }
#tb-fbform textarea { resize: vertical; min-height: 110px; }
#tb-fbform textarea:focus, #tb-fbform input:focus { outline: 2px solid var(--tdmu-sky); outline-offset: 0; }
.tb-fbres { min-height: 1.3em; font-size: 13px; color: var(--tt-muted); }
.tb-fbres.ok { color: #15803D; } .tb-fbres.err { color: #B91C1C; }
.tb-fbact { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.tb-fbsend, .tb-fbcancel { border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.tb-fbsend { background: var(--tdmu); color: #fff; } .tb-fbsend:hover { background: var(--tdmu-dark); } .tb-fbsend:disabled { opacity: .6; cursor: wait; }
.tb-fbcancel { background: var(--tdmu-light); color: var(--tdmu); }
.tb-ctx select { font: inherit; font-size: 11.5px; font-weight: 700; color: var(--tdmu); background: #fff; border: 1px solid #C9D3F2; border-radius: 8px; padding: 2px 6px; max-width: 190px; cursor: pointer; }
.tb-ctx select:focus-visible { outline: 2px solid var(--tdmu-sky); }
.nbadge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: #E11D48; color: #fff; border-radius: 999px; padding: 1px 7px; }
/* nút ẩn / hiện linh vật trên đầu trang */
.tb-tog { font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); color: #fff; cursor: pointer; white-space: nowrap; }
.tb-tog:hover { background: rgba(255,255,255,.26); }
@media (max-width: 760px) { .tb-tog .tb-tog-t { display: none; } .tb-tog { padding: 6px 9px; } }
@media (max-width: 480px) { #tb-root { --tb-size: 62px !important; } }
/* ---------- Thư viện linh vật dạng ảnh (sprite 3x3: 9 hướng nhìn + 9 biểu cảm) ---------- */
.tb-sprite { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.tb-sprite i { position: absolute; width: 300%; height: 300%; left: calc(var(--tbx, 1) * -100%); top: calc(var(--tby, 1) * -100%); background: var(--tb-img) 0 0 / 100% 100% no-repeat; pointer-events: none; }
.tb-fly .tb-sprite { filter: drop-shadow(0 6px 10px rgba(35, 47, 115, .28)); }
.tb-sprite.hd i { width: 450%; height: 450%; left: calc(var(--tbx, 1) * -150% - 26%); top: calc(var(--tby, 1) * -150% - 7.5%); }
.tb-chat-av .tb-sprite, .tb-mini .tb-sprite { border-radius: 50%; }
#tb-bot.tb-sp .tb-shadow { opacity: .8; }
.tb-cp { position: absolute; inset: 0; z-index: 6; background: #fff; display: flex; flex-direction: column; border-radius: inherit; }
.tb-cp[hidden] { display: none; }
.tb-cph { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: linear-gradient(135deg, var(--tdmu-dark), var(--tdmu)); color: #fff; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tb-cpb { flex: 1; overflow: auto; padding: 4px 12px 14px; }
.tb-cpn { margin: 10px 2px 2px; font-size: 12.5px; color: var(--tt-muted); }
.tb-cpg { margin: 14px 2px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tt-muted); }
.tb-cpgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.tb-ct { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border: 1.5px solid var(--tt-line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--tt-ink); }
.tb-ct:hover { border-color: var(--tdmu-sky); background: var(--tdmu-light); }
.tb-ct.on { border-color: var(--tdmu); background: var(--tdmu-light); box-shadow: 0 0 0 2px rgba(48, 64, 154, .16); }
.tb-ct .th { width: 54px; height: 54px; border-radius: 50%; background: #F1F5F9; overflow: hidden; display: flex; }
.tb-ct .nm { line-height: 1.2; text-align: center; }
.tb-cpreset { margin: 12px 2px 0; padding: 7px 12px; border: 1px solid var(--tt-line); background: #fff; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--tdmu); cursor: pointer; }
.tb-cpreset:hover { background: var(--tdmu-light); }