/* TransMind — lớp giao diện riêng, ĐẶT TRÊN design system Helen (helen-rail, helen-nav-item, helen-account-*).
   Chỉ khai báo khối mới (tm-*); màu/viền/bo góc bám token của Helen (cam #ff6b2b, navy #0b1437, slate).
   z-index theo UI-STACKING-REGISTRY: backdrop 29 / rail 30 (tầng sidebar dính 10–99); toast dùng chung ở tầng trên cùng. */
/* AI-MARK[TRANSMIND-UI:styles] 2026-11-11 15:57 (GMT+7) — style màn chat Chat|Agent, composer có mic, kế hoạch Agent, guide, responsive | rel: QAI-UI:transmind-shell, helen/helen.css */
/* Biến màu dùng chung cho vùng chính + menu ⋯ (trong rail) + hộp xác nhận (gắn vào body, ngoài .tm-root) */
.tm-root, .tm-pop, .tm-dialog {
  --tm-ink: #0f172a; --tm-text: #334155; --tm-muted: #64748b; --tm-faint: #94a3b8;
  --tm-line: #dbe4f0; --tm-soft: #f8fafc; --tm-card: #fff;
  --tm-orange: #ff6b2b; --tm-orange-d: #ea580c; --tm-orange-bg: #fff7ed; --tm-orange-line: #fdba74;
  --tm-navy: #0b1437; --tm-red: #dc2626; --tm-green: #047857;
}
.tm-root { min-height: 100vh; min-height: 100dvh; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ───────── Rail (bổ sung cho helen-rail) ───────── */
.tm-new-btn { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid rgba(255,107,43,.45); border-radius: 12px;
  background: rgba(255,107,43,.12); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s ease; }
.tm-new-btn:hover { background: rgba(255,107,43,.24); }
.tm-new-btn:focus-visible, .tm-hist-open:focus-visible, .tm-hist-more:focus-visible, .tm-sec-btn:focus-visible { outline: 2px solid var(--tm-orange); outline-offset: 2px; }
.tm-new-btn svg { color: var(--tm-orange); }
.tm-hist-title { padding: 0 12px; color: #64748b; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
/* AI-MARK[TRANSMIND-UI:sidebar-folders] 2026-11-12 09:10 (GMT+7) — SỬA CẮT CHỮ: cột lưới ngầm định = auto ⇒ dòng phình theo tiêu đề (583px trong rail 256px), "…" không bao giờ hiện, chữ bị mép rail cắt ngang ⇒ ép cột minmax(0,1fr) + min-width:0. Thêm ô tìm, mục Thư mục/Đã ghim/Gần đây, nút ⋯, menu nổi, hộp xác nhận | rel: transmind.js renderHistory, popHtml, confirmDialog */
.tm-hist-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.tm-hist-empty { padding: 6px 12px; color: #64748b; font-size: 12px; line-height: 1.45; }
.tm-hist-cta { width: 100%; border: 1px dashed rgba(148,163,184,.35); border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.tm-hist-cta:hover { border-color: rgba(255,107,43,.6); color: #e2e8f0; }
.tm-hist-item { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 10px; }
.tm-hist-item:hover, .tm-hist-item.is-active { background: rgba(255,255,255,.07); }
.tm-hist-item.is-active { box-shadow: inset 2px 0 0 var(--tm-orange); }
.tm-hist-open { flex: 1; min-width: 0; min-height: 34px; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px 7px 12px; color: #cbd5e1; font-size: 13px; text-align: left; cursor: pointer; }
.tm-hist-open svg { color: #64748b; }
.tm-hist-item.is-active .tm-hist-open { color: #fff; }
.tm-hist-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nút ⋯: nổi ở mép phải, chỉ hiện khi rê/đang chọn/menu mở; chữ chừa chỗ để "…" hiện trước nút */
.tm-hist-more { position: absolute; right: 4px; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: #94a3b8; cursor: pointer; opacity: 0; transition: opacity .12s ease, background .12s ease; }
.tm-hist-item:hover .tm-hist-more, .tm-hist-item:focus-within .tm-hist-more, .tm-hist-item.is-active .tm-hist-more, .tm-hist-more.is-open { opacity: 1; }
.tm-hist-item:hover .tm-hist-open, .tm-hist-item:focus-within .tm-hist-open, .tm-hist-item.is-active .tm-hist-open { padding-right: 36px; }
.tm-hist-item:has(.tm-hist-more.is-open) .tm-hist-open { padding-right: 36px; } /* tách riêng: trình duyệt cũ không hiểu :has() sẽ bỏ cả quy tắc */
.tm-hist-more:hover, .tm-hist-more.is-open { background: rgba(255,255,255,.12); color: #fff; }
/* Ô tìm + đầu mục */
.tm-search { display: flex; align-items: center; gap: 8px; height: 36px; margin: 0 0 4px; padding: 0 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.05); color: #64748b; cursor: text; }
.tm-search:focus-within { border-color: rgba(255,107,43,.6); background: rgba(255,255,255,.08); color: #cbd5e1; }
.tm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: #e2e8f0; font-size: 13px; }
.tm-search input::placeholder { color: #64748b; }
.tm-sec { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; padding: 8px 0 2px; }
.tm-sec-btn { flex: 0 0 auto; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: #94a3b8; cursor: pointer; }
.tm-sec-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
/* Thư mục */
.tm-folder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.tm-folder-row .tm-hist-open { color: #e2e8f0; font-weight: 600; }
.tm-folder-chev { transition: transform .15s ease; }
.tm-folder-row.is-open .tm-folder-chev { transform: rotate(90deg); }
.tm-folder-row .tm-folder-ico { color: #fdba74; }
.tm-count { flex: 0 0 auto; color: #64748b; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-folder-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; margin-left: 18px; padding-left: 6px; border-left: 1px solid rgba(255,255,255,.08); }
/* Ô đổi tên tại chỗ */
.tm-hist-item.is-editing { background: none; } /* cùng chiều cao dòng thường ⇒ lưu tên không làm xô lệch dòng bên dưới */
.tm-inline-input { width: 100%; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid rgba(255,107,43,.7); border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; font-size: 13px; outline: none; }
.tm-inline-input::placeholder { color: #94a3b8; }
/* Menu nổi ⋯ — nằm trong rail (stacking context z-30) ⇒ trên nội dung chính; toast + lớp phủ giọng nói vẫn ở trên */
.tm-pop { position: fixed; z-index: 60; width: 236px; max-width: calc(100vw - 16px); padding: 6px; border: 1px solid #dbe4f0; border-radius: 14px; background: #fff; color: #0f172a; box-shadow: 0 16px 40px rgba(15,23,42,.24); }
.tm-pop[hidden] { display: none; }
.tm-pop-item { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: #334155; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.tm-pop-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-pop-item svg { color: #64748b; }
.tm-pop-item:hover { background: #f1f5f9; color: #0f172a; }
.tm-pop-item:focus-visible { background: #f1f5f9; color: #0f172a; outline: none; } /* tách riêng: Safari < 15.4 không hiểu :focus-visible sẽ bỏ cả nhóm */
.tm-pop-item.is-danger, .tm-pop-item.is-danger svg { color: #dc2626; }
.tm-pop-item.is-danger:hover { background: #fef2f2; }
.tm-pop-item.is-danger:focus-visible { background: #fef2f2; }
.tm-pop-item.is-current { color: #c2410c; }
.tm-pop-item.is-current svg { color: #ea580c; }
.tm-pop-chev { margin-left: auto; }
.tm-pop-sep { height: 1px; margin: 4px 6px; background: #eef2f7; }
.tm-pop-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 6px; color: #0f172a; font-size: 13px; font-weight: 800; }
.tm-pop-back { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: #475569; cursor: pointer; }
.tm-pop-back:hover { background: #f1f5f9; }
.tm-pop-back:focus-visible { background: #f1f5f9; outline: none; }
.tm-pop-scroll { max-height: min(260px, 45vh); overflow-y: auto; }
.tm-pop-note { padding: 8px 10px; color: #64748b; font-size: 12.5px; }
.tm-pop-form { display: grid; gap: 8px; padding: 2px 4px 4px; }
.tm-pop .tm-inline-input { border-color: #dbe4f0; background: #fff; color: #0f172a; }
.tm-pop .tm-inline-input:focus { border-color: var(--tm-orange); box-shadow: 0 0 0 3px rgba(255,107,43,.18); }
/* Hộp xác nhận (native dialog ⇒ lớp trên cùng của trình duyệt, không tranh z-index) */
.tm-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; background: #fff; color: #0f172a; box-shadow: 0 24px 60px rgba(2,6,23,.35); }
.tm-dialog::backdrop { background: rgba(2,6,23,.55); }
.tm-dialog-card { display: grid; gap: 10px; padding: 20px; }
.tm-dialog h2 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.35; }
.tm-dialog p { margin: 0; color: #475569; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.tm-check { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: #7f1d1d; font-size: 13px; font-weight: 600; line-height: 1.45; cursor: pointer; }
.tm-check input { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; accent-color: #dc2626; }
.tm-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
/* AI-MARK[TRANSMIND-UI:history-sync] 2026-11-12 09:58 (GMT+7) — dòng trạng thái đồng bộ ở cuối danh sách (đang đồng bộ / đã đồng bộ / một phần / lỗi sẽ thử lại / hết phiên) + màn "đang tải" cho cuộc chỉ có tiêu đề | rel: transmind.js syncStateHtml */
.tm-sync-state { display: flex; align-items: center; gap: 6px; margin: 10px 12px 0; color: #64748b; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.tm-sync-state[hidden] { display: none; }
.tm-sync-state.is-warn { color: #fbbf24; }
.tm-sync-state.is-busy svg { animation: tm-rot 1s linear infinite; }
.tm-loading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 160px; color: var(--tm-muted); font-size: 13.5px; font-weight: 600; }
.tm-loading-ico { color: var(--tm-orange); animation: tm-rot 1s linear infinite; }
.tm-folder-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 12px; border: 1px solid var(--tm-orange-line); border-radius: 999px; background: var(--tm-orange-bg); color: #9a3412; font-size: 12.5px; font-weight: 600; }
.tm-folder-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Khi rail thu gọn: ẩn danh sách lịch sử (chỉ còn biểu tượng nav), mở rộng khi hover/focus hoặc mở menu mobile */
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .tm-hist { display: none; }
/* AI-MARK[TRANSMIND-UI:rail] 2026-11-11 17:07 (GMT+7) — căn TÂM icon khi rail thu gọn: chữ ẩn (opacity 0) vẫn chiếm chỗ + gap đẩy icon sang trái (nút cuộc mới lệch 12px, avatar 3px) ⇒ bỏ hẳn chữ + gap + padding ngang ở trạng thái thu gọn | rel: helen/helen.css .helen-rail */
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .tm-new-btn,
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .helen-nav-item { padding-left: 0; padding-right: 0; gap: 0; justify-content: center; }
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .tm-new-btn .helen-navtext,
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .helen-nav-item .helen-navtext,
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .helen-account-label,
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .helen-account-caret { display: none; }
/* AI-MARK[TRANSMIND-UI:account-menu] 2026-11-12 08:11 (GMT+7) — khối tài khoản nay là NÚT mở menu (helen-account-btn/menu của helen.css); căn tâm avatar nhắm vào nút, KHÔNG nhắm "dock > div" (sẽ trúng cả menu); hiện mũi tên khi ngăn kéo mobile mở | rel: transmind.js accountDockHtml, helen/helen.css .helen-account-menu */
.helen-rail:not(:hover):not(:focus-within):not(.tm-rail-open) .helen-account-btn { padding-left: 0; padding-right: 0; gap: 0; justify-content: center; }
.tm-new-btn .helen-navtext { overflow: hidden; }
.helen-rail .tm-hist-title { opacity: 0; transition: opacity .12s ease; }
.helen-rail:hover .tm-hist-title, .helen-rail:focus-within .tm-hist-title, .helen-rail.tm-rail-open .tm-hist-title { opacity: 1; }

/* Mobile: rail ẩn, mở bằng nút menu dưới dạng ngăn kéo */
.tm-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(2,6,23,.5); }
.tm-backdrop[hidden] { display: none; }
.helen-rail.tm-rail-open { display: flex !important; width: 16rem; box-shadow: 12px 0 40px rgba(2,6,23,.45); }
.helen-rail.tm-rail-open .helen-navtext, .helen-rail.tm-rail-open .helen-group, .helen-rail.tm-rail-open .helen-brandtext,
.helen-rail.tm-rail-open .helen-account-label, .helen-rail.tm-rail-open .helen-account-caret { opacity: 1; pointer-events: auto; }
.helen-rail.tm-rail-open .helen-account-label { max-width: 158px; }
.helen-rail.tm-rail-open .helen-brand-logo-wrap { width: 5.75rem; }


/* ───────── Thanh trên + nút gạt Chat | Agent ───────── */
.tm-chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-width: 0; }
.tm-topbar { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 20px; background: transparent; }
.tm-topbar-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tm-muted); font-size: 13px; font-weight: 700; }
.tm-menu-btn { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--tm-line); border-radius: 12px; background: #fff; color: var(--tm-navy); cursor: pointer; }
.tm-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--tm-line); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.06); flex: 0 0 auto; }
.tm-seg-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 0 16px; background: transparent; color: var(--tm-muted); font-size: 13px; font-weight: 800; cursor: pointer; transition: background .15s ease, color .15s ease; }
.tm-seg-btn:hover { color: var(--tm-orange-d); }
.tm-seg-btn.is-active { background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; box-shadow: 0 4px 10px rgba(234,88,12,.28); }
.tm-seg-btn:focus-visible, .tm-sug:focus-visible, .tm-tool:focus-visible, .tm-icon-btn:focus-visible, .tm-btn:focus-visible, .tm-menu-btn:focus-visible, .tm-input:focus-visible { outline: 3px solid rgba(255,107,43,.4); outline-offset: 2px; }

/* ───────── Vùng hội thoại ───────── */
.tm-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 12px; }
.tm-thread { max-width: 820px; margin: 0 auto; display: grid; gap: 18px; min-height: 100%; align-content: start; }
.tm-welcome { display: grid; justify-items: center; align-content: center; gap: 10px; text-align: center; min-height: calc(100vh - 260px); min-height: calc(100dvh - 260px); padding: 12px 0 24px; }
.tm-welcome-logo { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; box-shadow: 0 12px 26px rgba(234,88,12,.28); }
.tm-welcome h1 { margin: 6px 0 0; color: var(--tm-ink); font-size: 26px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.tm-welcome p { margin: 0; max-width: 560px; color: var(--tm-muted); font-size: 15px; font-weight: 500; line-height: 1.6; }
.tm-welcome p b { color: var(--tm-ink); }
.tm-sugs { width: 100%; max-width: 680px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tm-sug { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border: 1px solid var(--tm-line); border-radius: 14px; background: #fff; color: var(--tm-text); font-size: 13px; font-weight: 600; line-height: 1.45; text-align: left; cursor: pointer; transition: .15s ease; }
.tm-sug svg { margin-top: 2px; color: var(--tm-orange); }
.tm-sug:hover { border-color: var(--tm-orange-line); background: var(--tm-orange-bg); color: #c2410c; }

.tm-msg { display: flex; gap: 10px; min-width: 0; }
.tm-msg--user { justify-content: flex-end; }
.tm-bubble { max-width: min(85%, 640px); padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: var(--tm-navy); color: #fff; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.tm-avatar { flex: 0 0 auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; }
.tm-avatar--err { background: #fef2f2; color: var(--tm-red); }
.tm-bot-body { min-width: 0; flex: 1; display: grid; gap: 8px; align-content: start; }
.tm-md { color: var(--tm-text); font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.tm-md > :first-child { margin-top: 0; }
.tm-md p { margin: 0 0 10px; }
.tm-md h3, .tm-md h4, .tm-md h5 { margin: 14px 0 6px; color: var(--tm-ink); font-weight: 800; line-height: 1.35; }
.tm-md h3 { font-size: 17px; } .tm-md h4 { font-size: 15.5px; } .tm-md h5 { font-size: 14.5px; }
.tm-md ul, .tm-md ol { margin: 0 0 10px; padding-left: 22px; }
.tm-md ul { list-style: disc; } .tm-md ol { list-style: decimal; }
.tm-md li { margin: 3px 0; padding-left: 2px; }
.tm-md strong { color: var(--tm-ink); font-weight: 800; }
.tm-md a { color: var(--tm-orange-d); text-decoration: underline; text-underline-offset: 2px; }
.tm-md code { padding: 1px 6px; border-radius: 6px; background: #f1f5f9; color: #be123c; font-size: .9em; }
.tm-md pre { margin: 0 0 10px; padding: 12px 14px; overflow-x: auto; border-radius: 12px; background: var(--tm-navy); color: #e2e8f0; font-size: 13px; line-height: 1.55; }
.tm-md pre code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: pre; }
.tm-md blockquote { margin: 0 0 10px; padding: 6px 12px; border-left: 3px solid var(--tm-orange); background: var(--tm-orange-bg); color: #7c2d12; border-radius: 0 8px 8px 0; }
.tm-md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--tm-line); }
.tm-table-wrap { margin: 0 0 10px; overflow-x: auto; border: 1px solid var(--tm-line); border-radius: 10px; }
.tm-md table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tm-md th { padding: 8px 10px; background: var(--tm-soft); color: #475569; font-weight: 800; text-align: left; border-bottom: 1px solid var(--tm-line); white-space: nowrap; }
.tm-md td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.tm-md tr:last-child td { border-bottom: 0; }
.tm-msg-tools { display: flex; gap: 6px; }
.tm-tool { min-height: 28px; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 0 8px; background: none; color: var(--tm-faint); font-size: 12px; font-weight: 700; cursor: pointer; }
.tm-tool:hover { background: #e2e8f0; color: var(--tm-ink); }
/* AI-MARK[TRANSMIND-UI:voice-reply] 2026-11-11 16:26 (GMT+7) — nút Nghe (đang tạo/đang đọc) + nút chọn cách đọc trên thanh trên; tái dùng token cam/navy | rel: transmind.js voicePrefHtml, syncSpeakButtons */
.tm-tool.is-loading { color: var(--tm-orange-d); cursor: progress; }
.tm-tool.is-speaking { background: var(--tm-orange-bg); color: #c2410c; box-shadow: inset 0 0 0 1px var(--tm-orange-line); }
.tm-spin--sm { width: 12px; height: 12px; border-width: 2px; }
/* AI-MARK[TRANSMIND-UI:answer-feedback] 2026-11-17 09:34 (GMT+7) — đánh giá hữu ích: nút 👍/👎 trong hàng công cụ, nhãn dấu, ô hỏi "có hữu ích không?" + chip lý do; chỉ dùng token sẵn có (cam/xanh lá/đỏ), nằm trong luồng tin (không z-index) | rel: transmind.js fbToolsHtml/fbAskHtml */
.tm-msg-tools { flex-wrap: wrap; align-items: center; }
.tm-fb-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.tm-fb-btn { padding: 0 7px; }
.tm-fb-btn.is-on { background: #ecfdf5; color: var(--tm-green); box-shadow: inset 0 0 0 1px #a7f3d0; }
.tm-fb-btn.is-on.is-down { background: #fef2f2; color: var(--tm-red); box-shadow: inset 0 0 0 1px #fecaca; }
.tm-fb-mark { margin-left: 4px; font-size: 11.5px; font-weight: 700; color: var(--tm-muted); }
.tm-fb-mark.is-up { color: var(--tm-green); }
.tm-fb-mark.is-down { color: var(--tm-red); }
.tm-fb-ask { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--tm-orange-line); border-radius: 12px; background: var(--tm-orange-bg); }
.tm-fb-q { font-size: 13px; font-weight: 800; color: var(--tm-ink); }
.tm-fb-q small { font-weight: 600; color: var(--tm-muted); }
.tm-fb-scope { flex-basis: 100%; order: 3; font-size: 12px; color: var(--tm-muted); }
.tm-fb-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tm-fb-yes:hover { border-color: #a7f3d0; color: var(--tm-green); }
.tm-fb-no:hover { border-color: #fecaca; color: var(--tm-red); }
.tm-fb-why { border-color: var(--tm-line); background: var(--tm-soft); }
.tm-fb-chip { min-height: 28px; padding: 0 10px; border: 1px solid var(--tm-line); border-radius: 999px; background: #fff; color: var(--tm-text); font-size: 12px; font-weight: 700; cursor: pointer; }
.tm-fb-chip:hover { border-color: var(--tm-orange-line); color: var(--tm-orange-d); }
.tm-fb-close { min-width: 28px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--tm-faint); cursor: pointer; }
.tm-fb-close:hover { background: #e2e8f0; color: var(--tm-ink); }
.tm-fb-chip:focus-visible, .tm-fb-close:focus-visible, .tm-fb-btn:focus-visible { outline: 3px solid rgba(255,107,43,.4); outline-offset: 2px; }
.tm-voice-pref { flex: 0 0 auto; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--tm-line); border-radius: 999px; background: #fff; color: var(--tm-text); font-size: 12.5px; font-weight: 800; cursor: pointer; box-shadow: 0 1px 2px rgba(15,23,42,.06); transition: border-color .15s ease, color .15s ease, background .15s ease; }
.tm-voice-pref:hover { border-color: var(--tm-orange-line); color: var(--tm-orange-d); }
.tm-voice-pref:focus-visible { outline: 3px solid rgba(255,107,43,.4); outline-offset: 2px; }
.tm-voice-pref.is-mic svg, .tm-voice-pref.is-always svg { color: var(--tm-orange); }
.tm-voice-pref.is-always { background: var(--tm-orange-bg); border-color: var(--tm-orange-line); color: #c2410c; }
.tm-voice-pref.is-off { color: var(--tm-muted); }

/* Thẻ kế hoạch (Agent) */
.tm-plan { border: 1px solid var(--tm-orange-line); border-radius: 14px; background: linear-gradient(180deg, #fffaf5, #fff); padding: 12px 14px; }
.tm-plan header { display: flex; align-items: center; gap: 8px; color: var(--tm-orange-d); font-size: 13px; }
.tm-plan ol { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.tm-plan li { display: flex; align-items: flex-start; gap: 8px; }
.tm-plan li > div { min-width: 0; display: grid; gap: 1px; }
.tm-plan li b { color: var(--tm-ink); font-size: 13.5px; font-weight: 800; overflow-wrap: anywhere; }
.tm-plan li span { color: var(--tm-muted); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.tm-plan-ok { flex: 0 0 auto; margin-top: 1px; color: var(--tm-green); }

/* AI-MARK[TRANSMIND-UI:strategy-dept] 2026-11-13 15:21 (GMT+7) — bảng Phòng Chiến lược (huy hiệu khả thi, chip tiêu chí cần, 2 khối chuyên viên mở/thu được; việc được giao, chip bước A/B, danh sách không cần; dòng chi phí + bậc + ghi chú hết ngân sách) + khối giới thiệu phòng ở lời chào; dùng token --tm-*, không overlay mới (không z-index) | rel: TRANSMIND-UI:strategy-dept (transmind.js deptHtml/rosterHtml), UI-L4-TransMind */
.tm-dept { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; padding: 12px 14px; border: 1px solid var(--tm-orange-line); border-radius: 14px; background: linear-gradient(180deg, #fffaf5, #fff); }
.tm-dept-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.tm-dept-title { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; min-width: 0; color: var(--tm-orange-d); font-size: 13px; }
.tm-dept-title b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.tm-dept-title small { flex: 0 0 auto; }
.tm-dept-title small { color: var(--tm-muted); font-size: 12px; font-weight: 600; }
.tm-dept-verdict { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.tm-dept-verdict > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-dept-verdict.is-ok, .tm-dept-chip.is-ok { background: #ecfdf5; color: var(--tm-green); }
.tm-dept-verdict.is-warn, .tm-dept-chip.is-warn { background: #fffbeb; color: #92400e; }
.tm-dept-verdict.is-bad, .tm-dept-chip.is-bad { background: #fef2f2; color: var(--tm-red); }
.tm-dept-verdict.is-mute, .tm-dept-chip.is-mute { background: #f1f5f9; color: var(--tm-muted); }
.tm-dept-crit { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tm-dept-crit > span { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tm-dept-crit > span > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-dept-crit .is-on { background: #ecfdf5; color: var(--tm-green); }
.tm-dept-crit .is-off { background: #f1f5f9; color: var(--tm-faint); text-decoration: line-through; }
.tm-dept-note { margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.tm-dept-note.is-warn { background: #fffbeb; color: #92400e; }
.tm-dept-note.is-bad { background: #fef2f2; color: var(--tm-red); }
.tm-dept-cell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.tm-dept-cell > h4 { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; color: var(--tm-ink); font-size: 12.5px; font-weight: 800; }
.tm-dept-cell > h4 svg { color: var(--tm-orange); }
.tm-dept-cell-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-dept-cell > h4 small { flex: 0 0 auto; margin-left: auto; color: var(--tm-muted); font-size: 11.5px; font-weight: 600; }
.tm-dept-members { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.tm-dept-mem { min-width: 0; border: 1px solid var(--tm-line); border-radius: 10px; background: #fff; }
.tm-dept-mem > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 7px 10px; list-style: none; cursor: pointer; }
.tm-dept-mem > summary::-webkit-details-marker { display: none; }
.tm-dept-mem > summary:focus-visible { outline: 2px solid var(--tm-orange); outline-offset: 2px; border-radius: 10px; }
.tm-dept-chev { color: var(--tm-faint); transition: transform .15s ease; }
.tm-dept-mem[open] > summary .tm-dept-chev { transform: rotate(90deg); }
.tm-dept-name { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tm-ink); font-size: 13px; font-weight: 700; }
.tm-dept-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.tm-dept-st, .tm-dept-chip, .tm-dept-conf { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tm-dept-st.is-done { background: #ecfdf5; color: var(--tm-green); }
.tm-dept-st.is-timeout { background: #fffbeb; color: #92400e; }
.tm-dept-st.is-error { background: #fef2f2; color: var(--tm-red); }
.tm-dept-conf { background: #eef2ff; color: #4338ca; }
.tm-dept-sum { padding: 2px 12px 10px; border-top: 1px solid var(--tm-line); font-size: 13.5px; line-height: 1.65; }
.tm-dept-job { flex: 1 1 100%; min-width: 0; padding-left: 20px; color: var(--tm-muted); font-size: 12px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tm-dept-job b { color: var(--tm-text); font-weight: 700; }
.tm-dept-mem[open] > summary .tm-dept-job { display: block; }
.tm-dept-stage { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.tm-dept-stage.is-A { background: var(--tm-orange-bg); color: #9a3412; }
.tm-dept-stage.is-B { background: #eef2ff; color: #4338ca; }
.tm-dept-flow { margin: 0; padding: 6px 10px; border-radius: 10px; background: #f8fafc; color: var(--tm-muted); font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.tm-dept-flow b { color: var(--tm-ink); }
.tm-dept-idle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; color: var(--tm-faint); font-size: 11.5px; font-weight: 600; }
.tm-dept-idle i { max-width: 100%; min-height: 20px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px dashed var(--tm-line); border-radius: 999px; font-style: normal; color: var(--tm-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-roster-tasks { margin: 0; color: var(--tm-muted); font-size: 11.5px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.tm-roster-tasks b { color: var(--tm-ink); font-weight: 800; }
.tm-dept-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; color: var(--tm-muted); font-size: 11.5px; font-weight: 600; }
.tm-dept-cost > span { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 22px; padding: 0 8px; border-radius: 999px; background: #f1f5f9; overflow-wrap: anywhere; line-height: 1.35; }
.tm-dept-cost .tm-dept-lvl.is-1 { background: #fffbeb; color: #92400e; }
.tm-dept-cost .tm-dept-lvl.is-2 { background: #fef2f2; color: var(--tm-red); }
.tm-dept-cost .tm-dept-trim { background: transparent; color: var(--tm-muted); padding: 0 2px; }
.tm-dept-cost .tm-dept-ledger { background: #eef2ff; color: #4338ca; }
.tm-dept-note.is-info { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; background: #f1f5f9; color: var(--tm-muted); }
.tm-dept-note.is-info > span { min-width: 0; }
.tm-dept-empty { margin: 8px 0 0; color: var(--tm-muted); font-size: 12.5px; font-weight: 600; }
.tm-roster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; max-width: 560px; min-width: 0; padding: 10px 12px; border: 1px solid var(--tm-line); border-radius: 12px; background: #fff; text-align: left; }
.tm-roster > header { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--tm-orange-d); font-size: 12.5px; }
.tm-roster > header b { font-weight: 800; }
.tm-roster > header small { margin-left: auto; color: var(--tm-muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tm-roster-cell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.tm-roster-cell-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tm-ink); font-size: 12px; font-weight: 800; }
.tm-roster-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tm-roster-chips > span { max-width: 100%; min-height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; background: var(--tm-orange-bg); color: #9a3412; font-size: 11.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .tm-dept { padding: 10px; }
  .tm-dept-sum { padding-left: 10px; padding-right: 10px; }
  .tm-roster > header small { display: none; }
}
@media (max-height: 560px) { .tm-roster { display: none; } }
@media (prefers-reduced-motion: reduce) { .tm-dept-chev { transition: none; } }

/* Đang trả lời + lỗi */
.tm-typing { display: inline-flex; gap: 5px; align-items: center; height: 24px; }
.tm-typing i { width: 7px; height: 7px; border-radius: 999px; background: var(--tm-orange); animation: tm-bounce 1.1s infinite ease-in-out; }
.tm-typing i:nth-child(2) { animation-delay: .15s; } .tm-typing i:nth-child(3) { animation-delay: .3s; }
.tm-typing-label { color: var(--tm-faint); font-size: 12px; font-weight: 600; }
@keyframes tm-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
.tm-err { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 12px; background: #fef2f2; color: #7f1d1d; font-size: 13.5px; font-weight: 600; }

/* ───────── Khung soạn ───────── */
.tm-composer-wrap { flex: 0 0 auto; width: 100%; max-width: 860px; margin: 0 auto; padding: 6px 20px 14px; }
.tm-composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border: 1px solid var(--tm-line); border-radius: 26px; background: #fff; box-shadow: 0 6px 24px rgba(15,23,42,.08); transition: border-color .15s ease, box-shadow .15s ease; }
.tm-composer:focus-within { border-color: var(--tm-orange-line); box-shadow: 0 6px 24px rgba(255,107,43,.14); }
.tm-input { flex: 1; min-width: 0; max-height: 180px; resize: none; border: 0; outline: none; background: transparent; padding: 9px 0; color: var(--tm-ink); font-size: 14.5px; font-weight: 500; line-height: 1.5; }
.tm-input::placeholder { color: var(--tm-faint); }
.tm-input:focus-visible { outline: none; }
.tm-composer-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.tm-rec-clock { color: var(--tm-red); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-rec-clock[hidden] { display: none; }
.tm-icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid var(--tm-line); border-radius: 999px; background: #fff; color: var(--tm-muted); cursor: pointer; transition: .15s ease; }
.tm-icon-btn:hover:not(:disabled) { border-color: var(--tm-orange-line); background: var(--tm-orange-bg); color: var(--tm-orange-d); }
.tm-icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.tm-send { border-color: transparent; background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; }
.tm-send:hover:not(:disabled) { border-color: transparent; background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; filter: brightness(1.06); }
.tm-send:disabled { background: #e2e8f0; color: #94a3b8; opacity: 1; }
.tm-mic.is-recording { border-color: var(--tm-red); background: var(--tm-red); color: #fff; animation: tm-rec 1.2s infinite; }
.tm-mic.is-recording:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.tm-mic.is-busy { opacity: 1; cursor: progress; }

/* AI-MARK[TRANSMIND-UI:live-voice] 2026-11-11 16:37 (GMT+7) — nút mở + lớp phủ trò chuyện trực tiếp kiểu Gemini Live (quả cầu nhịp theo --lvl, phụ đề, điều khiển). z-index 1200 = tầng hộp thoại (UI-STACKING-REGISTRY); toast dùng chung vẫn ở trên | rel: transmind.js startLive, liveOverlayHtml */
.tm-live-open { border-color: var(--tm-navy); background: var(--tm-navy); color: #fff; }
.tm-live-open:hover:not(:disabled) { border-color: var(--tm-orange-d); background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; }
.tm-live { position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; align-items: center; padding: 18px 20px 24px; color: #e2e8f0;
  background: radial-gradient(120% 80% at 50% 38%, #1b2a6b 0%, #0b1437 55%, #050a1f 100%); }
.tm-live-top { width: 100%; max-width: 760px; display: flex; align-items: center; gap: 12px; }
.tm-live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.tm-live-badge i { width: 8px; height: 8px; border-radius: 999px; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: tm-live-dot 1.6s infinite; }
.tm-live-clock { flex: 1; color: #94a3b8; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-live-x { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; }
.tm-live-x:hover { background: rgba(255,255,255,.16); }
.tm-live-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.tm-live-orb { --lvl: 0; position: relative; width: 168px; height: 168px; }
.tm-live-orb span { position: absolute; inset: 0; border-radius: 999px; }
.tm-live-orb span:nth-child(1) { background: radial-gradient(circle at 35% 30%, #ffb58a 0%, #ff7a3d 35%, #ea580c 70%, #9a3412 100%);
  box-shadow: 0 0 60px rgba(255,122,61,.45); transform: scale(calc(.86 + var(--lvl) * .32)); transition: transform .08s linear; }
.tm-live-orb span:nth-child(2), .tm-live-orb span:nth-child(3) { border: 2px solid rgba(255,140,80,.35); transform: scale(calc(1.05 + var(--lvl) * .45)); opacity: calc(.25 + var(--lvl) * .7); transition: transform .12s linear, opacity .12s linear; }
.tm-live-orb span:nth-child(3) { transform: scale(calc(1.22 + var(--lvl) * .7)); opacity: calc(.12 + var(--lvl) * .5); }
.tm-live-orb[data-state="connecting"] span:nth-child(1), .tm-live-orb[data-state="muted"] span:nth-child(1) { filter: grayscale(.9) brightness(.8); animation: tm-live-breathe 1.8s ease-in-out infinite; }
.tm-live-orb[data-state="listening"] span:nth-child(1) { animation: tm-live-breathe 2.6s ease-in-out infinite; }
.tm-live-orb[data-state="thinking"] span:nth-child(1) { background: conic-gradient(from 0deg, #ff7a3d, #fbbf24, #ea580c, #ff7a3d); animation: tm-rot 1.4s linear infinite; }
.tm-live-orb[data-state="speaking"] span:nth-child(1) { box-shadow: 0 0 90px rgba(255,122,61,.65); }
.tm-live-status { margin: 0; color: #fff; font-size: 17px; font-weight: 700; text-align: center; }
.tm-live-captions { width: 100%; max-width: 680px; min-height: 96px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; text-align: center; }
/* AI-MARK[TRANSMIND-UI:live-caption] 2026-11-16 11:32 (GMT+7) — phụ đề hiện ĐỦ chữ: bỏ cắt 4 dòng (TransMind) / 2 dòng (người dùng) — khung cuộn, chữ mới nhất luôn trong tầm nhìn (setCaption tự theo cuối), câu dài canh trái cho dễ đọc; màn thấp thu khung lại để không đè nút điều khiển | rel: transmind.js setCaption capRender */
.tm-live-captions p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tm-live-you { color: #94a3b8; font-size: 14.5px; font-weight: 600; max-height: 4.8em; }
.tm-live-bot { color: #f8fafc; font-size: 17px; font-weight: 600; line-height: 1.55; max-height: min(30vh, 12.4em); }
.tm-live-bot.is-long, .tm-live-you.is-long { text-align: left; }
.tm-live-captions p.is-empty { display: none; }
@media (max-height: 640px) { .tm-live-bot { max-height: 22vh; } .tm-live-strat { max-height: 24vh; } }
/* AI-MARK[TRANSMIND-UI:live-strategy] 2026-11-13 17:26 (GMT+7) — thẻ "Phòng Chiến lược" trong lớp phủ giọng nói trực tiếp: ai đang làm (chip), đồng hồ, kết quả + đánh giá khả thi. KHÔNG z-index mới (nằm trong .tm-live, tầng 1200) | rel: transmind.js liveStrategy, QAI-UI:strategy-dept */
.tm-live-strat { width: 100%; max-width: 680px; max-height: 32vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.07); color: #e2e8f0; }
.tm-live-strat[hidden] { display: none; }
.tm-live-strat-head { display: flex; align-items: center; gap: 8px; min-width: 0; color: #fdba74; font-size: 13.5px; }
.tm-live-strat-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 800; }
.tm-live-strat-time { color: #94a3b8; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-live-strat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-live-strat-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.06); color: #e2e8f0; font-size: 12px; font-weight: 700; }
.tm-live-strat-chip i { flex: none; width: 7px; height: 7px; border-radius: 999px; background: #94a3b8; }
.tm-live-strat-chip.is-working { border-color: rgba(255,160,110,.55); color: #fed7aa; }
.tm-live-strat-chip.is-working i { background: #ff7a3d; animation: tm-live-strat-pulse 1.2s ease-in-out infinite; }
.tm-live-strat-chip.is-done i { background: #4ade80; }
.tm-live-strat-chip.is-warn i { background: #fbbf24; }
.tm-live-strat-chip.is-bad i { background: #f87171; }
.tm-live-strat-chip.is-idle { opacity: .6; }
.tm-live-strat-note { margin: 0; color: #cbd5e1; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.tm-live-strat-note.is-done { color: #bbf7d0; }
.tm-live-strat-note.is-error { color: #fecaca; }
.tm-live-strat-verdict { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 800; }
@keyframes tm-live-strat-pulse { 0%, 100% { opacity: .4; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.tm-live-controls { display: flex; gap: 14px; }
.tm-live-btn { min-height: 52px; display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.08); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; transition: background .15s ease; }
.tm-live-btn:hover { background: rgba(255,255,255,.16); }
.tm-live-btn.is-muted { background: #fff; color: var(--tm-navy); }
.tm-live-btn--end { border-color: transparent; background: #dc2626; }
.tm-live-btn--end:hover { background: #b91c1c; }
.tm-live-btn:focus-visible, .tm-live-x:focus-visible { outline: 3px solid rgba(255,160,110,.7); outline-offset: 3px; }
.tm-live-hint { max-width: 560px; margin: 16px 0 0; color: #94a3b8; font-size: 12.5px; line-height: 1.5; text-align: center; }
.tm-bubble--live { display: inline-flex; gap: 6px; align-items: baseline; }
.tm-live-tag { display: inline-flex; color: #fdba74; }
.tm-live-mark { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; color: var(--tm-orange-d); font-size: 12px; font-weight: 700; }
@keyframes tm-live-dot { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); } 70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
@keyframes tm-live-breathe { 0%, 100% { transform: scale(.88); } 50% { transform: scale(.97); } }
@keyframes tm-rec { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.tm-spin { width: 16px; height: 16px; border: 2px solid #cbd5e1; border-top-color: var(--tm-orange); border-radius: 999px; animation: tm-rot .8s linear infinite; }
@keyframes tm-rot { to { transform: rotate(360deg); } }
.tm-hint { margin: 8px 6px 0; color: var(--tm-faint); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.4; }
.tm-hint.is-rec { color: var(--tm-red); }

/* ───────── Nút, cổng quyền, trang hướng dẫn ───────── */
.tm-btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--tm-line); border-radius: 10px; padding: 0 14px; background: #fff; color: var(--tm-text); font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; transition: .15s ease; }
.tm-btn:hover { border-color: var(--tm-orange-line); background: var(--tm-orange-bg); color: #c2410c; }
.tm-btn--primary { border-color: transparent; background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); color: #fff; }
.tm-btn--primary:hover { color: #fff; filter: brightness(1.05); background: linear-gradient(135deg, #ff7a3d, var(--tm-orange-d)); }
.tm-btn--sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
/* nút đỏ của hộp xác nhận xoá — đặt SAU .tm-btn/.tm-btn:hover để không bị đè */
.tm-btn--danger { border-color: transparent; background: #dc2626; color: #fff; }
.tm-btn--danger:hover { border-color: transparent; background: #b91c1c; color: #fff; }
.tm-gate { max-width: 460px; margin: 18vh auto 0; padding: 0 20px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.tm-gate-ico { width: 60px; height: 60px; display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; background: #fff; color: var(--tm-orange-d); border: 1px solid var(--tm-orange-line); }
.tm-gate-ico.is-spin svg { animation: tm-rot 1s linear infinite; }
.tm-gate h1 { margin: 4px 0 0; color: var(--tm-ink); font-size: 20px; font-weight: 800; }
.tm-gate p { margin: 0 0 6px; color: var(--tm-muted); font-size: 14px; line-height: 1.6; }

.tm-page { max-width: 1000px; margin: 0 auto; padding: 4px 20px 56px; display: grid; gap: 14px; }
.tm-head { display: grid; justify-items: start; gap: 6px; border: 1px solid var(--tm-line); border-radius: 12px; padding: 18px 20px; background: linear-gradient(120deg, #fff 0%, #fff 62%, #fff7ed 100%); box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.tm-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--tm-orange-d); font-size: 11.5px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.tm-head h1 { margin: 0; color: var(--tm-ink); font-size: 22px; font-weight: 900; line-height: 1.25; }
.tm-head p { margin: 0 0 6px; max-width: 720px; color: var(--tm-muted); font-size: 13.5px; font-weight: 600; line-height: 1.55; }
.tm-h2 { margin: 10px 0 0; color: var(--tm-ink); font-size: 15px; font-weight: 900; }
.tm-cards, .tm-two { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tm-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tm-card { display: grid; align-content: start; gap: 6px; border: 1px solid var(--tm-line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.tm-card svg { color: var(--tm-orange); }
.tm-card b { color: var(--tm-ink); font-size: 14px; font-weight: 800; }
.tm-card span { color: var(--tm-muted); font-size: 13px; font-weight: 500; line-height: 1.55; }
.tm-card--soft { background: var(--tm-soft); }
.tm-steps { margin: 0; padding: 14px 18px 14px 36px; border: 1px solid var(--tm-line); border-radius: 12px; background: #fff; list-style: decimal; color: var(--tm-text); font-size: 13.5px; line-height: 1.65; }
.tm-steps li { padding-left: 4px; margin: 4px 0; }
.tm-note { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 14px; background: #fffbeb; color: #78350f; }
.tm-note svg { flex: 0 0 auto; margin-top: 2px; color: #d97706; }
.tm-note > div { display: grid; gap: 2px; font-size: 13px; line-height: 1.55; }
.tm-note b { font-weight: 900; }

/* ───────── Responsive ───────── */
/* AI-MARK[TRANSMIND-UI:responsive] 2026-11-12 09:10 (GMT+7) — tối ưu mọi cỡ màn: ngăn kéo mobile rộng hơn (≤86vw), ô nhập 16px trên màn cảm ứng (iOS không tự phóng to), nút ⋯ luôn hiện + vùng chạm 40px khi không có chuột, tiêu đề cuộc trò chuyện xuống dòng riêng trên điện thoại, màn thấp/xoay ngang thu gọn lời chào để gợi ý không bị ô nhập che (vẫn giữ dòng lưu ý pháp lý), màn rộng nới cột đọc. Không dùng env(safe-area-*) vì trang không bật viewport-fit=cover (rà soát #7) | rel: transmind.js isNarrow PLACEHOLDER_SHORT */
@media (max-width: 1023px) {
  .tm-menu-btn { display: inline-flex; }
  .tm-topbar { padding: 10px 14px; }
  .tm-scroll { padding: 4px 14px 10px; }
  .tm-composer-wrap { padding: 4px 12px 10px; }
  .helen-rail.tm-rail-open { width: min(20rem, 86vw); }
  .helen-rail.tm-rail-open .helen-account-label { max-width: none; }
}
@media (max-width: 640px) {
  .tm-topbar { flex-wrap: wrap; row-gap: 4px; }
  .tm-topbar-title { order: 3; flex: 1 0 100%; text-align: center; font-size: 12px; }
  .tm-topbar-title:empty { display: none; }
  .tm-seg { margin-left: auto; margin-right: auto; }
  .tm-sugs { grid-template-columns: 1fr; }
  .tm-two { grid-template-columns: 1fr; }
  .tm-welcome h1 { font-size: 22px; }
  .tm-bubble { max-width: 92%; }
  .tm-hint { font-size: 11px; }
  .tm-rec-clock { font-size: 11.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .tm-voice-pref span { display: none; }
  .tm-voice-pref { padding: 0 10px; }
  .tm-composer { padding-left: 14px; }
  .tm-composer-actions { gap: 6px; }
  .tm-page { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 360px) {
  .tm-seg-btn { padding: 0 11px; }
  .tm-icon-btn { width: 36px; height: 36px; }
}
/* Màn cảm ứng (không rê chuột được): nút ⋯ luôn hiện, vùng chạm ≥ 40px, chữ ô nhập 16px để iOS không phóng to khi gõ */
@media (hover: none), (pointer: coarse) {
  .tm-hist-more { opacity: 1; width: 36px; height: 36px; margin-top: -18px; }
  /* cùng/cao hơn độ ưu tiên của quy tắc :hover/.is-active (36px) ⇒ chữ không chạy dưới nút ⋯ 36px — rà soát #7 */
  .tm-hist-item .tm-hist-open, .tm-hist-item:hover .tm-hist-open, .tm-hist-item:focus-within .tm-hist-open, .tm-hist-item.is-active .tm-hist-open { min-height: 40px; padding-right: 42px; }
  .tm-sec-btn { width: 36px; height: 36px; }
  .tm-pop-item { min-height: 44px; font-size: 14.5px; }
  .tm-input, .tm-search input, .tm-inline-input { font-size: 16px; }
  .tm-search { height: 40px; }
  .tm-inline-input { height: 40px; }
}
@media (hover: none), (pointer: coarse) {
  .tm-hist-item:has(.tm-hist-more.is-open) .tm-hist-open { padding-right: 42px; }
}
/* Màn thấp (điện thoại xoay ngang, laptop nhỏ có thanh công cụ): thu gọn lời chào + thanh trên để gợi ý không bị ô nhập che */
@media (max-height: 560px) {
  .tm-topbar { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .tm-welcome { min-height: 0; gap: 6px; padding: 2px 0 8px; }
  .tm-welcome-logo { display: none; }
  .tm-welcome h1 { margin: 0; font-size: 20px; }
  .tm-welcome p { font-size: 13.5px; line-height: 1.5; }
  .tm-sugs { margin-top: 4px; gap: 8px; }
  .tm-sug { padding: 8px 12px; font-size: 12.5px; }
  .tm-hint { margin-top: 3px; font-size: 10.5px; } /* giữ dòng lưu ý pháp lý, chỉ thu nhỏ */
  .tm-composer-wrap { padding-top: 2px; padding-bottom: 6px; }
  .tm-input { max-height: 96px; }
  .tm-gate { margin-top: 6vh; }
}
/* Màn rộng: nới cột đọc vừa phải (dòng quá dài khó đọc) */
@media (min-width: 1600px) {
  .tm-thread { max-width: 900px; }
  .tm-composer-wrap { max-width: 940px; }
  .tm-welcome h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-typing i, .tm-mic.is-recording, .tm-spin, .tm-gate-ico.is-spin svg { animation: none; }
  .tm-folder-chev, .tm-hist-more { transition: none; }
  .tm-sync-state.is-busy svg { animation: none; }
  .tm-loading-ico { animation: none; }
  .tm-live-orb span, .tm-live-badge i, .tm-live-strat-chip i { animation: none !important; transition: none; }
}
