/* =========================================================================
   HỢP ĐỒNG THẺ CHI TIẾT — 4 KHỐI RIÊNG BIỆT · 3 CỠ CHỮ · CO GIÃN 3 CỠ MÀN HÌNH
   Chuẩn hóa số Steve Jobs: Bo góc {4, 8, 16}px · Khoảng cách {4, 8, 12, 16, 24, 32}px
   1. KHỐI ĐANG-LÀM   (.khoi-dang-lam / .the-tom-tat-hero)
   2. KHỐI LỜI-NÓI    (.khoi-loi-noi / .the-tom-tat-copy-box / .the-tom-tat-loi-noi) — TO NHẤT & NỔI NHẤT
   3. KHỐI VIỆC-CỦA-JACK (.khoi-viec-cua-jack / .the-tom-tat-giao-viec)
   4. KHỐI XEM-THÊM   (.khoi-xem-them / .the-tom-tat-meta-grid / details.khoi-xem-them) — GẤP LẠI, CHÌM XUỐNG
   ========================================================================= */

.the-tom-tat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--tho-lon, 16px 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.the-tom-tat-overlay.is-active,
.the-tom-tat-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* KHUNG THẺ CHI TIẾT — CO GIÃN THEO 3 CỠ MÀN HÌNH */
.the-tom-tat-card,
.the-chi-tiet-card {
  width: min(540px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 48px));
  background: var(--the, #ffffff);
  border: 1px solid #0f172a;
  border-radius: var(--bo-lon, 14px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--chu, #0f172a);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease;
}

/* =========================================================================
   VIỆC 17: THẺ CỦA JACK — NẶNG NHẤT BỨC TRANH (COMMANDER EDITION)
   - Rộng 640px (rộng hơn hẳn thẻ đồng đội lớn nhất 540px)
   - Dải vương miện hoàng gia trên đỉnh
   - Khối VIỆC-CỦA-JACK lên đầu và to nhất
   ========================================================================= */
.the-tom-tat-card--jack,
.the-chi-tiet-card--jack,
[data-team-role="jack"] .the-tom-tat-card,
[data-team-role="jack"] .the-chi-tiet-card,
[data-team-role="jack"]#crewAgentDetailPanel,
#crewAgentDetailPanel[data-team-role="jack"] {
  width: min(640px, calc(100vw - 24px));
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-tron, 9999px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="dark"] .the-tom-tat-card--jack,
[data-theme="dark"] .the-chi-tiet-card--jack,
[data-theme="dark"] [data-team-role="jack"] .the-tom-tat-card,
[data-theme="dark"] [data-team-role="jack"] .the-chi-tiet-card,
[data-theme="dark"] [data-team-role="jack"]#crewAgentDetailPanel,
[data-theme="dark"] #crewAgentDetailPanel[data-team-role="jack"] {
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15) !important;
}

/* HEADER CỦA JACK — DẢI VÀNG VƯƠNG MIỆN HOÀNG GIA */
.the-tom-tat-card--jack .the-tom-tat-header,
.the-chi-tiet-card--jack .the-tom-tat-header,
[data-team-role="jack"] .the-tom-tat-header {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 50%, #38bdf8 100%) !important;
  border-bottom: 1px solid #0f172a !important;
  padding: var(--tho-modal, 16px 16px 24px 16px) !important;
}

[data-theme="dark"] .the-tom-tat-card--jack .the-tom-tat-header,
[data-theme="dark"] .the-chi-tiet-card--jack .the-tom-tat-header,
[data-theme="dark"] [data-team-role="jack"] .the-tom-tat-header {
  background: linear-gradient(135deg, #161b22 0%, #38bdf8 50%, #38bdf8 100%) !important;
  border-bottom-color: #38bdf8 !important;
}

.the-tom-tat-card--jack .the-tom-tat-app-badge,
.the-chi-tiet-card--jack .the-tom-tat-app-badge,
[data-team-role="jack"] .the-tom-tat-app-badge {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  padding: var(--tho-lon, 16px 16px) !important;
}

[data-theme="dark"] .the-tom-tat-card--jack .the-tom-tat-app-badge,
[data-theme="dark"] .the-chi-tiet-card--jack .the-tom-tat-app-badge,
[data-theme="dark"] [data-team-role="jack"] .the-tom-tat-app-badge {
  background: #0f172a !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

.the-tom-tat-card--jack .the-tom-tat-title-label,
.the-chi-tiet-card--jack .the-tom-tat-title-label,
[data-team-role="jack"] .the-tom-tat-title-label {
  font-size: var(--chu-lon, 16px) !important;
  font-weight: 900 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .the-tom-tat-card--jack .the-tom-tat-title-label,
[data-theme="dark"] .the-chi-tiet-card--jack .the-tom-tat-title-label,
[data-theme="dark"] [data-team-role="jack"] .the-tom-tat-title-label {
  color: #ffffff !important;
}

/* ĐỔI NGÔI: KHỐI VIỆC-CỦA-JACK LÊN ĐẦU TIÊN VÀ TO NHẤT TRONG THẺ JACK */
.the-tom-tat-card--jack .the-chi-tiet-body,
.the-chi-tiet-card--jack .the-chi-tiet-body,
.crew-command-agent-detail--jack {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.the-tom-tat-card--jack .khoi-viec-cua-jack,
.the-chi-tiet-card--jack .khoi-viec-cua-jack,
.crew-command-agent-detail--jack .crew-detail-block--viec-cua-jack,
[data-team-role="jack"] .crew-detail-block--viec-cua-jack {
  order: -1 !important;
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%) !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-lon, 14px) !important;
  padding: var(--tho-modal, 16px 16px 24px 16px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="dark"] .the-tom-tat-card--jack .khoi-viec-cua-jack,
[data-theme="dark"] .the-chi-tiet-card--jack .khoi-viec-cua-jack,
[data-theme="dark"] .crew-command-agent-detail--jack .crew-detail-block--viec-cua-jack,
[data-theme="dark"] [data-team-role="jack"] .crew-detail-block--viec-cua-jack {
  background: linear-gradient(135deg, #161b22 0%, #161b22 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

.the-tom-tat-card--jack .khoi-viec-cua-jack .khoi-viec-cua-jack-cau-lenh,
.crew-command-agent-detail--jack .crew-detail-block--viec-cua-jack .crew-detail-block-title,
[data-team-role="jack"] /* Removed redundant viec-cua-jack title override */

[data-theme="dark"] .the-tom-tat-card--jack .khoi-viec-cua-jack .khoi-viec-cua-jack-cau-lenh,
[data-theme="dark"] .crew-command-agent-detail--jack .crew-detail-block--viec-cua-jack .crew-detail-block-title,
[data-theme="dark"] [data-team-role="jack"] /* Removed redundant viec-cua-jack title override */

/* =========================================================================
   VIỆC 19: TÁI CẤU TRÚC DANH SÁCH VIỆC CỦA JACK THÀNH DANH SÁCH THẬT SỰ
   1. Ô tick và chữ CÙNG MỘT DÒNG (flex-direction: row, align-items: flex-start)
   2. MỌI DÒNG CÙNG CHIỀU RỘNG 100% (chiếm hết bề ngang khối)
   3. CHỮ CĂN TRÁI 100% (text-align: left, không bao giờ căn giữa)
   4. TIÊU ĐỀ DÀI DỪNG Ở 2 DÒNG (-webkit-line-clamp: 2)
   5. BA TẦNG CHỮ PHÂN BIỆT RÕ RỆT (Tiêu đề đậm -> Ai đề nghị -> Bao lâu rồi)
   6. VIỆC CHỜ LÂU NHẤT NỔI BẬT LÊN (Dải viền đỏ cam cháy + Huy hiệu dạ quang)
   7. Ô GÕ PHÂN TÁCH RÕ RÀNG VỚI KHỐI DANH SÁCH
/* =========================================================================
   VIỆC 23: KHỐI VIỆC CHỈ JACK CẦN QUYẾT (GỌN GÀNG, ĐỌC LƯỚT 9 VIỆC CÙNG LÚC)
   1 việc = 1 dòng gọn (~34-36px). Đủ 3 thứ: Tên việc, Ai + bao lâu, Ô tick.
   Chữ gốc và giải thích: GẤP LẠI (hidden), bấm mới mở.
   Việc chờ lâu nhất: dấu nhỏ tinh tế, không phình khối.
   Đủ 3 cỡ màn hình: Rộng (9 việc không cuộn) · Vừa · Hẹp.
   ========================================================================= */

.crew-jack-open-tasks {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  max-height: 380px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: var(--tho-nho, 4px 8px) !important;
  margin-top: 8px !important;
  margin-bottom: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 1 & 2 & 3: TỪNG DÒNG VIỆC GỌN (1 DÒNG ĐỌC LƯỚT, CAO ~34-36px) */
div[data-jack-task],
.crew-jack-task-row,
.crew-jack-task-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: var(--tho-vua, 8px 12px) !important;
  background: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-nho, 6px) !important;
  box-shadow: 1.5px 1.5px 0px #0f172a !important;
  text-align: left !important;
  transition: transform 100ms ease, box-shadow 100ms ease, border-color 100ms ease !important;
  position: relative !important;
  margin: 0 !important;
}

div[data-jack-task]:hover,
.crew-jack-task-row:hover,
.crew-jack-task-item:hover {
  transform: translate(-1px, -1px) !important;
  box-shadow: 2.5px 2.5px 0px #0f172a !important;
  border-color: #0284c7 !important;
}

[data-theme="dark"] div[data-jack-task],
[data-theme="dark"] .crew-jack-task-row,
[data-theme="dark"] .crew-jack-task-item {
  background: #161b22 !important;
  border-color: #161b22 !important;
  box-shadow: 1.5px 1.5px 0px #161b22 !important;
}

[data-theme="dark"] div[data-jack-task]:hover,
[data-theme="dark"] .crew-jack-task-row:hover,
[data-theme="dark"] .crew-jack-task-item:hover {
  border-color: #38bdf8 !important;
  box-shadow: 2.5px 2.5px 0px #0f172a !important;
}

/* 1. Ô TICK GỌN GÀNG BÊN TRÁI */
div[data-jack-task] input[type="checkbox"],
input[data-jack-task-check],
.crew-jack-checkbox {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  min-height: 17px !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-nho, 6px) !important;
  background: #ffffff !important;
  cursor: pointer !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  transition: all 100ms ease !important;
}

div[data-jack-task] input[type="checkbox"]:hover,
input[data-jack-task-check]:hover,
.crew-jack-checkbox:hover {
  border-color: #0284c7 !important;
  transform: scale(1.08) !important;
}

div[data-jack-task] input[type="checkbox"]:checked,
input[data-jack-task-check]:checked,
.crew-jack-checkbox.is-checked {
  background: #38bdf8 !important;
  border-color: #0f172a !important;
}

div[data-jack-task] input[type="checkbox"]:checked::after,
input[data-jack-task-check]:checked::after,
.crew-jack-checkbox.is-checked::after {
  content: '✓' !important;
  color: #ffffff !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 900 !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  line-height: 1 !important;
}

[data-theme="dark"] div[data-jack-task] input[type="checkbox"],
[data-theme="dark"] input[data-jack-task-check],
[data-theme="dark"] .crew-jack-checkbox {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

/* 2 & 3. KHỐI THÂN VIỆC */
.crew-jack-task-file,
.crew-jack-task-content {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  text-align: left !important;
}

.crew-jack-task-toggle,
.crew-jack-task-title {
  width: 100% !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  text-align: left !important;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  color: #0f172a !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
  box-shadow: none !important;
}

[data-theme="dark"] .crew-jack-task-toggle,
[data-theme="dark"] .crew-jack-task-title {
  color: #f8fafc !important;
}

.crew-jack-task-meta-line,
.crew-jack-task-sub {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  font-size: var(--chu-nho, 12px) !important;
  margin-top: 0 !important;
  line-height: 1.2 !important;
}

.crew-jack-task-requester {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: #0369a1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: var(--chu-nho, 12px) !important;
}

[data-theme="dark"] .crew-jack-task-requester {
  color: #38bdf8 !important;
}

.crew-jack-task-age {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 800 !important;
  color: #38bdf8 !important;
  background: #ffffff !important;
  padding: var(--tho-nho, 4px 8px) !important;
  border-radius: var(--bo-nho, 6px) !important;
  border: 1px solid #ffffff !important;
  font-size: var(--chu-nho, 12px) !important;
  line-height: 1.2 !important;
}

[data-theme="dark"] .crew-jack-task-age {
  background: #161b22 !important;
  color: #38bdf8 !important;
  border-color: #161b22 !important;
}

/* 4. VIỆC CHỜ LÂU NHẤT NỔI BẬT TINH TẾ (DẤU NHỎ TRÊN DÒNG GỌN, KHÔNG PHÌNH KHỐI) */
.crew-jack-task-item--urgent,
div[data-jack-task]:has(.crew-jack-task-item--urgent),
[data-jack-task-oldest="true"] {
  border: 1px solid #38bdf8 !important;
  border-left: 1px solid #38bdf8 !important;
  background: #ffffff !important;
  box-shadow: 1.5px 1.5px 0px #38bdf8 !important;
  position: relative !important;
  margin: 0 !important;
}

.crew-jack-task-item--urgent::after,
div[data-jack-task]:has(.crew-jack-task-item--urgent)::after,
[data-jack-task-oldest="true"]::after {
  content: '🔥 LÂU NHẤT' !important;
  position: absolute !important;
  top: 3px !important;
  right: 6px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  color: #38bdf8 !important;
  background: #ffffff !important;
  padding: var(--tho-nho, 4px 8px) !important;
  border-radius: var(--bo-nho, 6px) !important;
  border: 1px solid #ffffff !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
}

[data-theme="dark"] .crew-jack-task-item--urgent,
[data-theme="dark"] div[data-jack-task]:has(.crew-jack-task-item--urgent),
[data-theme="dark"] [data-jack-task-oldest="true"] {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  border-left-color: #38bdf8 !important;
  box-shadow: 1.5px 1.5px 0px #161b22 !important;
}

[data-theme="dark"] .crew-jack-task-item--urgent::after,
[data-theme="dark"] div[data-jack-task]:has(.crew-jack-task-item--urgent)::after,
[data-theme="dark"] [data-jack-task-oldest="true"]::after {
  background: #161b22 !important;
  color: #ffffff !important;
  border-color: #161b22 !important;
}

/* 5. KHỐI CHI TIẾT GẤP LẠI (HIDDEN KHI ĐÓNG, CHỈ HIỆN KHI MỞ) */
.crew-jack-task-detail[hidden],
[hidden].crew-jack-task-detail,
.crew-jack-task-detail:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  height: 0 !important;
  min-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.crew-jack-task-detail:not([hidden]) {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 8px !important;
  padding-top: var(--tho-nho, 4px 8px) !important;
  border-top: 1px solid var(--vien, #cbd5e1) !important;
  width: 100% !important;
}

[data-theme="dark"] .crew-jack-task-detail:not([hidden]) {
  border-top-color: #161b22 !important;
}

.crew-jack-task-raw-label {
  font-family: 'Outfit', sans-serif !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  color: #0369a1 !important;
  letter-spacing: 0.04em !important;
}

[data-theme="dark"] .crew-jack-task-raw-label {
  color: #38bdf8 !important;
}

.crew-jack-task-raw,
.crew-jack-task-raw-text {
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
  background: #f8fafc !important;
  border: 1px solid #64748b !important;
  border-left: 1px solid #0284c7 !important;
  border-radius: var(--bo-nho, 6px) !important;
  padding: var(--tho-vua, 8px 12px) !important;
  margin: 0 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  max-height: 140px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

[data-theme="dark"] .crew-jack-task-raw,
[data-theme="dark"] .crew-jack-task-raw-text {
  background: #161b22 !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
  color: #64748b !important;
}

.crew-jack-task-copy-raw,
.crew-jack-task-raw-copy {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: var(--tho-vua, 8px 12px) !important;
  border-radius: var(--bo-nho, 6px) !important;
  border: 1px solid #0f172a !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  box-shadow: 1.5px 1.5px 0px #0f172a !important;
  transition: all 100ms ease !important;
  user-select: none !important;
  align-self: flex-start !important;
}

.crew-jack-task-copy-raw:hover,
.crew-jack-task-raw-copy:hover {
  background: #ffffff !important;
  color: #0369a1 !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.crew-jack-task-raw-time {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 700 !important;
  color: #64748b !important;
}

/* =========================================================================
   ĐỦ 3 CỠ MÀN HÌNH (RESPONSIVE CHO KHỐI VIỆC CỦA JACK)
   ========================================================================= */

@media (max-width: 1200px) {
  .crew-jack-open-tasks {
    gap: 4px !important;
  }
  div[data-jack-task],
  .crew-jack-task-row,
  .crew-jack-task-item {
    padding: var(--tho-vua, 8px 12px) !important;
    gap: 8px !important;
  }
  .crew-jack-task-toggle,
  .crew-jack-task-title {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  }
  .crew-jack-task-meta-line {
    font-size: var(--chu-nho, 12px) !important;
  }
}

@media (max-width: 768px) {
  .crew-jack-open-tasks {
    gap: 4px !important;
  }
  div[data-jack-task],
  .crew-jack-task-row,
  .crew-jack-task-item {
    padding: var(--tho-nho, 4px 8px) !important;
    gap: 4px !important;
    border-radius: var(--bo-nho, 6px) !important;
  }
  .crew-jack-task-toggle,
  .crew-jack-task-title {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  }
  .crew-jack-task-requester,
  .crew-jack-task-age {
    font-size: var(--chu-nho, 12px) !important;
  }
  div[data-jack-task] input[type="checkbox"],
  input[data-jack-task-check],
  .crew-jack-checkbox {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
  }
}

[data-theme="dark"] .crew-jack-task-raw,
[data-theme="dark"] .crew-jack-task-raw-text {
  background: #161b22 !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
  color: #64748b !important;
}

.crew-jack-task-copy-raw,
.crew-jack-task-raw-copy {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: var(--tho-vua, 8px 12px) !important;
  border-radius: var(--bo-vua, 10px) !important;
  border: 1px solid #0f172a !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  transition: all 100ms ease !important;
  user-select: none !important;
  align-self: flex-start !important;
}

.crew-jack-task-copy-raw:hover,
.crew-jack-task-raw-copy:hover {
  background: #ffffff !important;
  color: #0369a1 !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.crew-jack-task-raw-time {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 700 !important;
  color: #64748b !important;
}

/* =========================================================================
   HỢP ĐỒNG 2: KHỐI MÁY TRẢ LỜI (.crew-advice-*)
   - Nằm DƯỚI chữ gốc, nhìn là biết ngay chữ máy đoán
   ========================================================================= */
.crew-advice-ask {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: var(--tho-lon, 16px 16px) !important;
  border-radius: var(--bo-vua, 10px) !important;
  border: 1px solid #0f172a !important;
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 100%) !important;
  color: #ffffff !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  transition: all 100ms ease !important;
  margin-top: 8px !important;
}

.crew-advice-ask:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 100%) !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.crew-advice-answer {
  background: #ffffff !important;
  border: 1px solid #38bdf8 !important;
  border-radius: var(--bo-vua, 10px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
  color: #161b22 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-style: italic !important;
  line-height: 1.55 !important;
  margin-top: 8px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

[data-theme="dark"] .crew-advice-answer {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

.crew-advice-model {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 800 !important;
  color: #161b22 !important;
  display: block !important;
  margin-top: 4px !important;
}

[data-theme="dark"] .crew-advice-model {
  color: #ffffff !important;
}

.crew-advice-error {
  background: #ffffff !important;
  border: 1px solid #dc2626 !important;
  color: #161b22 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  padding: var(--tho-vua, 8px 12px) !important;
  border-radius: var(--bo-vua, 10px) !important;
  margin-top: 8px !important;
}

[data-theme="dark"] .crew-advice-error {
  background: #161b22 !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
}

/* =========================================================================
   HỢP ĐỒNG Ô GHI CHÚ CỦA JACK (VIỆC 22 — 6 TÊN CHỐT)
   1. crew-note-box: cả khối ghi chú trong thẻ nhân vật
   2. crew-note-input: ô Jack gõ chữ vào (nhiều dòng, mời gọi)
   3. crew-note-save: nút lưu
   4. crew-note-status: dòng báo kết quả (rỗng thì không chiếm chỗ, không nhảy)
   5. crew-note-status--ok / crew-note-status--fail: 3 trạng thái phân biệt trong nửa giây
   6. crew-note-list: danh sách các dòng đã ghi (cuộn trong khối, đọc lướt)
   ========================================================================= */

/* 1. KHỐI GHI CHÚ TỔNG THỂ */
.crew-note-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 12px 0 8px 0 !important;
  padding: var(--tho-lon, 16px 16px) !important;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 100%) !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-vua, 10px) !important;
  box-shadow: 2.5px 2.5px 0px #0f172a !important;
  transition: all 200ms ease !important;
}

[data-theme="dark"] .crew-note-box {
  background: linear-gradient(180deg, #161b22 0%, #0f172a 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 2.5px 2.5px 0px #161b22 !important;
}

/* 2. Ô GÕ CHỮ JACK (MỜI GỌI, RỘNG RÃI, NHIỀU DÒNG) */
.crew-note-input {
  width: 100% !important;
  box-sizing: border-box !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 600 !important;
  line-height: 1.55 !important;
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-vua, 10px) !important;
  padding: var(--tho-vua, 8px 12px) !important;
  resize: vertical !important;
  min-height: 76px !important;
  max-height: 260px !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: border-color 100ms ease, box-shadow 100ms ease !important;
}

.crew-note-input::placeholder {
  font-family: 'Inter', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-style: italic !important;
  font-weight: 500 !important;
  color: #8b949e !important;
}

.crew-note-input:focus,
.crew-note-input:focus-visible {
  outline: none !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22), 2.5px 2.5px 0px #0f172a !important;
}

[data-theme="dark"] .crew-note-input {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] .crew-note-input::placeholder {
  color: #64748b !important;
}

[data-theme="dark"] .crew-note-input:focus,
[data-theme="dark"] .crew-note-input:focus-visible {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28), 2.5px 2.5px 0px #38bdf8 !important;
}

/* 3. NÚT LƯU */
.crew-note-save {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  align-self: flex-start !important;
  padding: var(--tho-lon, 16px 16px) !important;
  border-radius: var(--bo-vua, 10px) !important;
  border: 1px solid #0f172a !important;
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 100%) !important;
  color: #ffffff !important;
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  box-shadow: 2.5px 2.5px 0px #0f172a !important;
  transition: transform 100ms ease, box-shadow 100ms ease, filter 100ms ease !important;
  user-select: none !important;
}

.crew-note-save:hover {
  transform: translate(-1px, -1px) !important;
  box-shadow: 3.5px 3.5px 0px #0f172a !important;
  filter: brightness(1.08) !important;
}

.crew-note-save:active {
  transform: translate(1px, 1px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  filter: brightness(0.95) !important;
}

[data-theme="dark"] .crew-note-save {
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 2.5px 2.5px 0px #161b22 !important;
}

[data-theme="dark"] .crew-note-save:hover {
  box-shadow: 3.5px 3.5px 0px #38bdf8 !important;
}

/* 4. DÒNG BÁO KẾT QUẢ (LUÔN CÓ MẶT, RỖNG THÌ KHÔNG CHIẾM CHỖ - KHÔNG NHẢY KHUNG) */
.crew-note-status {
  box-sizing: border-box !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  border-radius: var(--bo-vua, 10px) !important;
  display: block !important;
  transition: opacity 200ms ease, margin 200ms ease, padding 200ms ease !important;
}

.crew-note-status:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  height: 0 !important;
  min-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.crew-note-status:not(:empty) {
  margin-top: 8px !important;
  padding: var(--tho-vua, 8px 12px) !important;
  opacity: 1 !important;
}

/* 5. BA TRẠNG THÁI PHÂN BIỆT TRONG NỬA GIÂY */
/* Trạng thái 2: Lưu xong (Success) */
.crew-note-status--ok,
.crew-note-status.crew-note-status--ok,
.crew-note-status--success,
.crew-note-saved {
  background: #ffffff !important;
  border: 1px solid #38bdf8 !important;
  border-left: 1px solid #38bdf8 !important;
  color: #161b22 !important;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.12) !important;
}

[data-theme="dark"] .crew-note-status--ok,
[data-theme="dark"] .crew-note-status.crew-note-status--ok,
[data-theme="dark"] .crew-note-status--success,
[data-theme="dark"] .crew-note-saved {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  border-left-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

/* Trạng thái 3: Lưu hỏng (Error / Fail) */
.crew-note-status--fail,
.crew-note-status.crew-note-status--fail,
.crew-note-status--error {
  background: #ffffff !important;
  border: 1px solid #dc2626 !important;
  border-left: 1px solid #dc2626 !important;
  color: #161b22 !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.12) !important;
}

[data-theme="dark"] .crew-note-status--fail,
[data-theme="dark"] .crew-note-status.crew-note-status--fail,
[data-theme="dark"] .crew-note-status--error {
  background: #161b22 !important;
  border-color: #f87171 !important;
  border-left-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

/* 6. DANH SÁCH NHỮNG DÒNG ĐÃ GHI TRONG SỔ (CUỘN TRONG KHỐI, ĐỌC LƯỚT ĐƯỢC) */
.crew-note-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-height: 180px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  margin-top: 8px !important;
  padding: var(--tho-nho, 4px 8px) !important;
  border-top: 1px solid var(--vien, #cbd5e1) !important;
  scrollbar-width: thin !important;
  scrollbar-color: #8b949e transparent !important;
}

.crew-note-list:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  height: 0 !important;
  min-height: 0 !important;
  opacity: 0 !important;
}

.crew-note-list::-webkit-scrollbar {
  width: 5px !important;
}

.crew-note-list::-webkit-scrollbar-track {
  background: transparent !important;
}

.crew-note-list::-webkit-scrollbar-thumb {
  background: #8b949e !important;
  border-radius: var(--bo-nho, 6px) !important;
}

.crew-note-list::-webkit-scrollbar-thumb:hover {
  background: #64748b !important;
}

[data-theme="dark"] .crew-note-list {
  border-top-color: #161b22 !important;
  scrollbar-color: #161b22 transparent !important;
}

[data-theme="dark"] .crew-note-list::-webkit-scrollbar-thumb {
  background: #161b22 !important;
}

[data-theme="dark"] .crew-note-list::-webkit-scrollbar-thumb:hover {
  background: #38bdf8 !important;
}

/* Từng dòng ghi chú trong danh sách */
.crew-note-list > *,
.crew-note-list li,
.crew-note-list > div,
.crew-note-item,
.crew-note-line {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: var(--tho-vua, 8px 12px) !important;
  background: #ffffff !important;
  border: 1px solid #64748b !important;
  border-left: 1px solid #38bdf8 !important;
  border-radius: var(--bo-nho, 6px) !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 600 !important;
  color: #161b22 !important;
  line-height: 1.45 !important;
  word-break: break-word !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  transition: background-color 100ms ease, border-color 100ms ease !important;
}

.crew-note-list > *:hover,
.crew-note-list li:hover,
.crew-note-list > div:hover,
.crew-note-item:hover,
.crew-note-line:hover {
  background: #ffffff !important;
  border-color: #64748b !important;
  border-left-color: #38bdf8 !important;
}

[data-theme="dark"] .crew-note-list > *,
[data-theme="dark"] .crew-note-list li,
[data-theme="dark"] .crew-note-list > div,
[data-theme="dark"] .crew-note-item,
[data-theme="dark"] .crew-note-line {
  background: #161b22 !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="dark"] .crew-note-list > *:hover,
[data-theme="dark"] .crew-note-list li:hover,
[data-theme="dark"] .crew-note-list > div:hover,
[data-theme="dark"] .crew-note-item:hover,
[data-theme="dark"] .crew-note-line:hover {
  background: #161b22 !important;
  border-left-color: #38bdf8 !important;
}

/* =========================================================================
   ĐỦ 3 CỠ MÀN HÌNH (RESPONSIVE BREAKPOINTS: RỘNG · VỪA · HẸP)
   ========================================================================= */

/* Cỡ Vừa (Tablet / Màn hình phụ / Cửa sổ chia đôi <= 1200px) */
@media (max-width: 1200px) {
  .crew-note-box {
    padding: var(--tho-vua, 8px 12px) !important;
    gap: 8px !important;
  }
  .crew-note-input {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
    min-height: 70px !important;
    padding: var(--tho-vua, 8px 12px) !important;
  }
  .crew-note-save {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
    padding: var(--tho-lon, 16px 16px) !important;
  }
  .crew-note-list {
    max-height: 160px !important;
  }
}

/* Cỡ Hẹp (Mobile / Ngăn kéo hẹp <= 768px) */
@media (max-width: 768px) {
  .crew-note-box {
    padding: var(--tho-vua, 8px 12px) !important;
    gap: 8px !important;
    border-width: 1px !important;
    border-radius: var(--bo-vua, 10px) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  }
  .crew-note-input {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
    min-height: 60px !important;
    padding: var(--tho-vua, 8px 12px) !important;
    border-width: 1px !important;
    box-shadow: 1.5px 1.5px 0px #0f172a !important;
  }
  .crew-note-save {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
    padding: var(--tho-vua, 8px 12px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-width: 1px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  }
  .crew-note-status:not(:empty) {
    padding: var(--tho-vua, 8px 12px) !important;
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  }
  .crew-note-list {
    max-height: 140px !important;
    margin-top: 8px !important;
    padding-top: var(--tho-nho, 4px 8px) !important;
  }
  .crew-note-list > *,
  .crew-note-list li,
  .crew-note-list > div,
  .crew-note-item,
  .crew-note-line {
    font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
    padding: var(--tho-vua, 8px 12px) !important;
  }
}

/* 7. PHÂN TÁCH RÕ RÀNG Ô GÕ BÊN DƯỚI */
.the-tom-tat-card--jack .the-tom-tat-giao-viec,
.the-chi-tiet-card--jack .the-tom-tat-giao-viec,
.crew-command-agent-detail--jack .the-tom-tat-giao-viec,
.khoi-viec-cua-jack-input-group {
  margin-top: 16px !important;
  border-top: 1px solid var(--vien, #cbd5e1) !important;
  padding-top: var(--tho-lon, 16px 16px) !important;
}

[data-theme="dark"] .the-tom-tat-card--jack .the-tom-tat-giao-viec,
[data-theme="dark"] .the-chi-tiet-card--jack .the-tom-tat-giao-viec,
[data-theme="dark"] .crew-command-agent-detail--jack .the-tom-tat-giao-viec,
[data-theme="dark"] .khoi-viec-cua-jack-input-group {
  border-top-color: #161b22 !important;
}

/* ẨN CHỮ MÁY MÓC NỘI BỘ TRÊN BẢNG JACK */
.crew-command-small-note,
[data-jack-board-count] {
  display: none !important;
}

/* CA A: TRẠNG THÁI RỖNG (0 VIỆC) — NHÌN RA LÀ "ĐANG YÊN", KHÔNG PHẢI "ĐANG HỎNG" */
.crew-jack-open-tasks:empty::before,
.crew-jack-open-tasks > div:only-child:not(.crew-jack-task-item),
.crew-jack-empty-state {
  content: '✨ Mọi việc đang trôi chảy · Không có việc nào cần anh can thiệp lúc này' !important;
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-weight: 800 !important;
  color: #38bdf8 !important;
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  border-radius: var(--bo-vua, 10px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
  text-align: center !important;
  display: block !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="dark"] .crew-jack-open-tasks:empty::before,
[data-theme="dark"] .crew-jack-open-tasks > div:only-child:not(.crew-jack-task-item),
[data-theme="dark"] .crew-jack-empty-state {
  background: #161b22 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

.the-tom-tat-overlay.is-active .the-tom-tat-card,
.the-tom-tat-overlay.is-open .the-tom-tat-card {
  transform: scale(1);
}

[data-theme="dark"] .the-tom-tat-card,
[data-theme="dark"] .the-chi-tiet-card {
  background: #161b22;
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

/* HEADER: TÊN AGENT & NÚT ĐÓNG */
.the-tom-tat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--tho-modal, 16px 16px 24px 16px);
  background: var(--the-noi, #f8fafc);
  border-bottom: 1px solid #0f172a;
  flex-shrink: 0;
}

[data-theme="dark"] .the-tom-tat-header {
  background: #161b22;
  border-bottom-color: #38bdf8;
}

.the-tom-tat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.the-tom-tat-app-badge {
  font-size: var(--chu-nho, 12px);
  font-weight: 900;
  font-family: 'Outfit', 'JetBrains Mono', monospace;
  padding: var(--tho-vua, 8px 12px);
  border-radius: var(--bo-tron, 9999px);
  background: #ffffff;
  color: #0369a1;
  border: 1px solid #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

[data-theme="dark"] .the-tom-tat-app-badge {
  background: #0369a1;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.the-tom-tat-title-label {
  font-family: 'Outfit', sans-serif;
  font-size: var(--chu-nhan, 16px);
  font-weight: 900;
  color: var(--chu, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .the-tom-tat-title-label {
  color: #f8fafc;
}

.the-tom-tat-close-btn {
  background: #ffffff;
  border: 1px solid #0f172a;
  font-size: var(--chu-nhan, 16px);
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bo-tron, 9999px);
  box-shadow: 1.5px 1.5px 0px #0f172a;
  transition: all 100ms ease;
  line-height: 1;
}

.the-tom-tat-close-btn:hover {
  background: #ffffff;
  color: #dc2626;
  transform: scale(1.08);
}

[data-theme="dark"] .the-tom-tat-close-btn {
  background: #161b22;
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 1.5px 1.5px 0px #38bdf8;
}

/* BODY: CHỨA ĐÚNG 4 KHỐI THEO THỨ TỰ HỢP ĐỒNG */
.the-tom-tat-body,
.the-chi-tiet-body {
  padding: var(--tho-modal, 16px 16px 24px 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* =========================================================================
   CÂU 1: KHỐI ĐANG-LÀM (.khoi-dang-lam / .the-tom-tat-hero)
   - Một dòng, chữ to nhất (18px - 20px, font-weight 900)
   - Kèm biển trạng thái + thời lượng bao lâu rồi
   ========================================================================= */
.khoi-dang-lam,
.the-tom-tat-hero,
[data-khoi="dang-lam"] {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  border: 1px solid #0f172a;
  border-radius: var(--bo-lon, 14px);
  padding: var(--tho-lon, 16px 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 3.5px 3.5px 0px #0f172a;
}

[data-theme="dark"] .khoi-dang-lam,
[data-theme="dark"] .the-tom-tat-hero,
[data-theme="dark"] [data-khoi="dang-lam"] {
  background: linear-gradient(135deg, #161b22 0%, #0f172a 100%);
  border-color: #38bdf8;
  box-shadow: 3.5px 3.5px 0px #0284c7;
}

.the-tom-tat-hero-header,
.khoi-dang-lam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.the-tom-tat-hero-tag,
.khoi-dang-lam-tag {
  font-size: var(--chu-nho, 12px);
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .the-tom-tat-hero-tag,
[data-theme="dark"] .khoi-dang-lam-tag {
  color: #38bdf8;
}

.khoi-dang-lam-thoi-luong,
.the-tom-tat-hero-time {
  font-size: var(--chu-vua, 14px);
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #0369a1;
  background: rgba(255, 255, 255, 0.85);
  padding: var(--tho-vua, 8px 12px);
  border-radius: var(--bo-tron, 9999px);
  border: 1px solid #0f172a;
}

[data-theme="dark"] .khoi-dang-lam-thoi-luong,
[data-theme="dark"] .the-tom-tat-hero-time {
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.85);
  border-color: #38bdf8;
}

/* CHỮ VIỆC ĐANG LÀM — CỠ LỚN (18px - 20px), ĐẬM NÉT NHẤT */
.the-tom-tat-dang-lam-gi,
.khoi-dang-lam-text {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: var(--chu-lon, 16px);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .the-tom-tat-dang-lam-gi,
[data-theme="dark"] .khoi-dang-lam-text {
  color: #ffffff;
}

/* =========================================================================
   CÂU 2: KHỐI LỜI-NÓI (.khoi-loi-noi / .the-tom-tat-copy-box / .the-tom-tat-loi-noi)
   - KHỐI LỚN NHẤT, CHIẾM NHIỀU CHỖ NHẤT TRONG THẺ!
   - Hiện nguyên văn câu nói cuối cùng, khung thoại truyện tranh cao cấp
   - Nút chép ngay góc trên bên phải nổi bật
   ========================================================================= */
.khoi-loi-noi,
.the-tom-tat-copy-box,
.the-tom-tat-loi-noi,
[data-khoi="loi-noi"] {
  background: #ffffff;
  border: 1px solid #0f172a;
  border-radius: var(--bo-lon, 14px);
  padding: var(--tho-lon, 16px 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 4.5px 4.5px 0px #0f172a;
  position: relative;
  min-height: 130px;
}

[data-theme="dark"] .khoi-loi-noi,
[data-theme="dark"] .the-tom-tat-copy-box,
[data-theme="dark"] .the-tom-tat-loi-noi,
[data-theme="dark"] [data-khoi="loi-noi"] {
  background: #161b22;
  border-color: #38bdf8;
  box-shadow: 4.5px 4.5px 0px #0284c7;
}

.khoi-loi-noi-header,
.the-tom-tat-copy-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #ffffff;
  padding-bottom: var(--tho-nho, 4px 8px);
}

[data-theme="dark"] .khoi-loi-noi-header,
[data-theme="dark"] .the-tom-tat-copy-box-header {
  border-bottom-color: #161b22;
}

.khoi-loi-noi-label {
  font-size: var(--chu-vua, 14px);
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .khoi-loi-noi-label {
  color: #f8fafc;
}

/* NÚT CHÉP NỔI BẬT GÓC TRÊN */
.the-tom-tat-btn-copy,
.btn-chep-loi-noi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--tho-lon, 16px 16px);
  border-radius: var(--bo-vua, 10px);
  border: 1px solid #0f172a;
  background: #f8fafc;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-size: var(--chu-vua, 14px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: all 100ms ease;
  user-select: none;
}

.the-tom-tat-btn-copy:hover,
.btn-chep-loi-noi:hover {
  background: #ffffff;
  color: #0369a1;
  transform: translate(-1px, -1px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.the-tom-tat-btn-copy:active,
.btn-chep-loi-noi:active {
  transform: translate(1px, 1px);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .the-tom-tat-btn-copy,
[data-theme="dark"] .btn-chep-loi-noi {
  background: #161b22;
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.the-tom-tat-btn-copy.is-copied,
.btn-chep-loi-noi.is-copied {
  background: #38bdf8 !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

/* NỘI DUNG NGUYÊN VĂN LỜI NÓI — CỠ VỪA (15px - 16px), DỄ ĐỌC */
.the-tom-tat-copy-preview,
.khoi-loi-noi-content,
.the-tom-tat-vua-xong,
.the-tom-tat-recent-msg {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: var(--chu-nhan, 16px);
  font-weight: 700;
  line-height: 1.6;
  color: #161b22;
  background: #f8fafc;
  padding: var(--tho-lon, 16px 16px);
  border-radius: var(--bo-vua, 10px);
  border: 1px solid #64748b;
  border-left: 1px solid #0284c7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
  margin: 0;
}

[data-theme="dark"] .the-tom-tat-copy-preview,
[data-theme="dark"] .khoi-loi-noi-content,
[data-theme="dark"] .the-tom-tat-vua-xong,
[data-theme="dark"] .the-tom-tat-recent-msg {
  background: #161b22;
  border-color: #161b22;
  border-left-color: #38bdf8;
  color: #64748b;
}

/* =========================================================================
   CÂU 3: KHỐI VIỆC-CỦA-JACK (.khoi-viec-cua-jack / .the-tom-tat-giao-viec)
   - Lời sai khiến trực tiếp: "Bên này chờ anh 23 phút — trả lời đi"
   - Ô nhập việc + Nút giao việc cam rực rỡ
   ========================================================================= */
.khoi-viec-cua-jack,
.the-tom-tat-giao-viec,
[data-khoi="viec-cua-jack"] {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  border: 1px solid #0f172a;
  border-radius: var(--bo-lon, 14px);
  padding: var(--tho-lon, 16px 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 3.5px 3.5px 0px #0f172a;
}

[data-theme="dark"] .khoi-viec-cua-jack,
[data-theme="dark"] .the-tom-tat-giao-viec,
[data-theme="dark"] [data-khoi="viec-cua-jack"] {
  background: linear-gradient(135deg, #161b22 0%, #161b22 100%);
  border-color: #38bdf8;
  box-shadow: 3.5px 3.5px 0px #38bdf8;
}

.the-tom-tat-giao-viec-header,
.khoi-viec-cua-jack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.the-tom-tat-giao-viec-label,
.khoi-viec-cua-jack-cau-lenh {
  font-family: 'Outfit', sans-serif;
  font-size: var(--chu-vua, 14px);
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .the-tom-tat-giao-viec-label,
[data-theme="dark"] .khoi-viec-cua-jack-cau-lenh {
  color: #38bdf8;
}

.the-tom-tat-giao-viec-hint {
  font-size: var(--chu-nho, 12px);
  color: #161b22;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

[data-theme="dark"] .the-tom-tat-giao-viec-hint {
  color: #ffffff;
}

.the-tom-tat-giao-viec-input,
.khoi-viec-cua-jack-input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--chu-nhan, 16px);
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #0f172a;
  border-radius: var(--bo-vua, 10px);
  padding: var(--tho-lon, 16px 16px);
  line-height: 1.45;
  resize: vertical;
  min-height: 60px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: all 100ms ease;
}

.the-tom-tat-giao-viec-input:focus,
.khoi-viec-cua-jack-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

[data-theme="dark"] .the-tom-tat-giao-viec-input,
[data-theme="dark"] .khoi-viec-cua-jack-input {
  background: #0f172a;
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.the-tom-tat-giao-viec-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.the-tom-tat-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--chu-nho, 12px);
  font-weight: 700;
  color: #161b22;
  background: #ffffff;
  border: 1px solid #0f172a;
  border-radius: var(--bo-nho, 6px);
  padding: var(--tho-vua, 8px 12px);
}

[data-theme="dark"] .the-tom-tat-kbd {
  background: #161b22;
  color: #ffffff;
  border-color: #38bdf8;
}

.the-tom-tat-giao-viec-btn,
.khoi-viec-cua-jack-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--tho-lon, 16px 16px);
  border-radius: var(--bo-vua, 10px);
  border: 1px solid #0f172a;
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: var(--chu-vua, 14px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2.5px 2.5px 0px #0f172a;
  transition: all 100ms ease;
  user-select: none;
}

.the-tom-tat-giao-viec-btn:hover:not(:disabled),
.khoi-viec-cua-jack-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8 0%, #161b22 100%);
  transform: translate(-1px, -1px);
  box-shadow: 3.5px 3.5px 0px #0f172a;
}

.the-tom-tat-giao-viec-btn:active:not(:disabled),
.khoi-viec-cua-jack-btn:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1.5px 1.5px 0px #0f172a;
}

/* =========================================================================
   VIỆC 21: HỢP ĐỒNG DÒNG BÁO DƯỚI NÚT "GỬI" (GIAO VIỆC)
   1. .crew-dispatch-status (dòng báo chung, luôn có mặt)
   2. .crew-dispatch-status--sending (lúc đang gửi: đang chạy, chưa xong)
   3. .crew-dispatch-status--ok (lúc đã nhận: xong rồi, yên tâm)
   4. .crew-dispatch-status--fail (lúc không gửi được: có chuyện, phải đọc)
   5. .crew-dispatch-target (dòng nhỏ nói rơi vào đâu)
   ========================================================================= */

@keyframes dispatchPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.995); }
}

.crew-dispatch-status,
.the-tom-tat-giao-viec-feedback {
  width: 100% !important;
  box-sizing: border-box !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  border-radius: var(--bo-vua, 10px) !important;
  transition: all 200ms ease !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  white-space: pre-wrap !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

.crew-dispatch-status:empty,
.the-tom-tat-giao-viec-feedback:empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  border: none !important;
}

/* 1. TRẠNG THÁI ĐANG GỬI (.crew-dispatch-status--sending) */
.crew-dispatch-status--sending,
.the-tom-tat-giao-viec-feedback.is-sending {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: var(--tho-lon, 16px 16px) !important;
  margin-top: 8px !important;
  background: #ffffff !important;
  border: 1px solid var(--vien-dam, #0284c7) !important;
  color: #0369a1 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
  animation: dispatchPulse 1.8s ease-in-out 3 !important;
}

[data-theme="dark"] .crew-dispatch-status--sending,
[data-theme="dark"] .the-tom-tat-giao-viec-feedback.is-sending {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

/* 2. TRẠNG THÁI ĐÃ NHẬN (.crew-dispatch-status--ok) */
.crew-dispatch-status--ok,
.the-tom-tat-giao-viec-feedback.is-success {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: var(--tho-lon, 16px 16px) !important;
  margin-top: 8px !important;
  background: #ffffff !important;
  border: 1px solid #38bdf8 !important;
  color: #161b22 !important;
  box-shadow: 2.5px 2.5px 0px #38bdf8 !important;
}

[data-theme="dark"] .crew-dispatch-status--ok,
[data-theme="dark"] .the-tom-tat-giao-viec-feedback.is-success {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 2.5px 2.5px 0px #38bdf8 !important;
}

/* 3. TRẠNG THÁI KHÔNG GỬI ĐƯỢC (.crew-dispatch-status--fail) */
.crew-dispatch-status--fail,
.the-tom-tat-giao-viec-feedback.is-error {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: var(--tho-lon, 16px 16px) !important;
  margin-top: 8px !important;
  background: #ffffff !important;
  border: 1px solid #dc2626 !important;
  color: #161b22 !important;
  box-shadow: 2.5px 2.5px 0px #dc2626 !important;
}

[data-theme="dark"] .crew-dispatch-status--fail,
[data-theme="dark"] .the-tom-tat-giao-viec-feedback.is-error {
  background: #161b22 !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 2.5px 2.5px 0px #dc2626 !important;
}

/* 4. DÒNG NHỎ: RƠI VÀO ĐÂU (.crew-dispatch-target) */
.crew-dispatch-target,
.the-tom-tat-giao-viec-target {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 700 !important;
  color: #161b22 !important;
  margin-top: 4px !important;
  line-height: 1.4 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

[data-theme="dark"] .crew-dispatch-target,
[data-theme="dark"] .the-tom-tat-giao-viec-target {
  color: #8b949e !important;
}

/* =========================================================================
   CÂU 4: KHỐI XEM-THÊM (.khoi-xem-them / details.khoi-xem-them / .the-tom-tat-meta-grid)
   - GẤP LẠI, CHÌM XUỐNG, KHÔNG TRANH CHỖ
   - Chứa ID, PID, thư mục làm việc, lịch sử...
   ========================================================================= */
.khoi-xem-them,
details.khoi-xem-them,
.the-tom-tat-meta-grid,
[data-khoi="xem-them"] {
  background: #f8fafc;
  border: 1px solid #64748b;
  border-radius: var(--bo-vua, 10px);
  padding: var(--tho-lon, 16px 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="dark"] .khoi-xem-them,
[data-theme="dark"] details.khoi-xem-them,
[data-theme="dark"] .the-tom-tat-meta-grid,
[data-theme="dark"] [data-khoi="xem-them"] {
  background: #0f172a;
  border-color: #161b22;
}

details.khoi-xem-them summary,
.khoi-xem-them-header {
  font-family: 'Outfit', sans-serif;
  font-size: var(--chu-vua, 14px);
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

[data-theme="dark"] details.khoi-xem-them summary,
[data-theme="dark"] .khoi-xem-them-header {
  color: #8b949e;
}

details.khoi-xem-them[open] summary {
  color: #0f172a;
  border-bottom: 1px solid var(--vien, #cbd5e1);
  padding-bottom: var(--tho-nho, 4px 8px);
}

[data-theme="dark"] details.khoi-xem-them[open] summary {
  color: #f8fafc;
  border-bottom-color: #161b22;
}

.the-tom-tat-meta-item,
.khoi-xem-them-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.the-tom-tat-meta-label,
.khoi-xem-them-label {
  font-size: var(--chu-nho, 12px);
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .the-tom-tat-meta-label,
[data-theme="dark"] .khoi-xem-them-label {
  color: #8b949e;
}

.the-tom-tat-meta-val,
.khoi-xem-them-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--chu-vua, 14px);
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere; word-break: break-word;
}

[data-theme="dark"] .the-tom-tat-meta-val,
[data-theme="dark"] .khoi-xem-them-val {
  color: #64748b;
}

/* =========================================================================
   FOOTER: ĐIỀU HƯỚNG GIỮA CÁC PHIÊN VÀ ĐÓNG
   ========================================================================= */
.the-tom-tat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--tho-modal, 16px 16px 24px 16px);
  background: var(--the-noi, #f8fafc);
  border-top: 1px solid #0f172a;
  flex-shrink: 0;
  gap: 8px;
}

[data-theme="dark"] .the-tom-tat-footer {
  background: #161b22;
  border-top-color: #38bdf8;
}

.the-tom-tat-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.the-tom-tat-nav-btn,
.the-tom-tat-btn-close {
  padding: var(--tho-lon, 16px 16px);
  border-radius: var(--bo-vua, 10px);
  border: 1px solid #0f172a;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-size: var(--chu-vua, 14px);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 1.5px 1.5px 0px #0f172a;
  transition: all 100ms ease;
}

[data-theme="dark"] .the-tom-tat-nav-btn,
[data-theme="dark"] .the-tom-tat-btn-close {
  background: #161b22;
  border-color: #38bdf8;
  color: #f8fafc;
  box-shadow: 1.5px 1.5px 0px #38bdf8;
}

.the-tom-tat-nav-btn:hover:not(:disabled),
.the-tom-tat-btn-close:hover {
  background: #ffffff;
  transform: translate(-1px, -1px);
  box-shadow: 2.5px 2.5px 0px #0f172a;
}

[data-theme="dark"] .the-tom-tat-nav-btn:hover:not(:disabled),
[data-theme="dark"] .the-tom-tat-btn-close:hover {
  background: #161b22;
}

.the-tom-tat-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.the-tom-tat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   RESPONSIVE: CO GIÃN THEO 3 CỠ MÀN HÌNH (HẸP <480px · VỪA 480-768px · RỘNG >768px)
   ========================================================================= */
@media (max-width: 480px) {
  .the-tom-tat-card,
  .the-chi-tiet-card {
    width: calc(100vw - 16px);
    border-radius: var(--bo-lon, 14px);
    max-height: calc(100vh - 24px);
  }
  .the-tom-tat-header,
  .the-tom-tat-footer {
    padding: var(--tho-lon, 16px 16px);
  }
  .the-tom-tat-body,
  .the-chi-tiet-body {
    padding: var(--tho-lon, 16px 16px);
    gap: 12px;
  }
  .the-tom-tat-dang-lam-gi,
  .khoi-dang-lam-text {
    font-size: var(--chu-nhan, 16px);
  }
  .the-tom-tat-copy-preview,
  .khoi-loi-noi-content {
    font-size: var(--chu-vua, 14px);
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .the-tom-tat-card,
  .the-chi-tiet-card {
    width: min(520px, calc(100vw - 32px));
  }
}

@media (min-width: 769px) {
  .the-tom-tat-card,
  .the-chi-tiet-card {
    width: 580px;
  }
}

/* =========================================================================
   HUY HIỆU TRẠNG THÁI (.the-trang-thai) TRÊN THẺ VÀ POPUP (VIỆC 12)
   ========================================================================= */

/* =========================================================================
   HỢP ĐỒNG THẺ CHI TIẾT — KHUÔN RENDER CỦA DEV 1 (.crew-detail-block)
   1. .crew-detail-block--dang-lam
   2. .crew-detail-block--loi-noi (TO NHẤT & NỔI NHẤT)
   3. .crew-detail-block--viec-cua-jack
   4. .crew-detail-block--xem-them (GẤP LẠI, CHÌM XUỐNG)
   ========================================================================= */

.crew-detail-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.crew-detail-block-title {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-weight: 800 !important;
  color: var(--chu, #0f172a) !important;
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* 1. KHỐI ĐANG-LÀM */
.crew-detail-block--dang-lam,
.the-tom-tat-hero,
.khoi-dang-lam {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%) !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-lon, 14px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
  box-shadow: 3.5px 3.5px 0px #0f172a !important;
}

/* Removed redundant dang-lam title override */

.crew-detail-doing,
.khoi-dang-lam-text,
.the-tom-tat-dang-lam-gi {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-lon, 16px) !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  line-height: 1.4 !important;
  word-break: break-word !important;
}

.crew-detail-doing-meta {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-top: 4px !important;
}

.crew-detail-elapsed,
.khoi-dang-lam-thoi-luong {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 800 !important;
  color: #0369a1 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  padding: var(--tho-vua, 8px 12px) !important;
  border-radius: var(--bo-tron, 9999px) !important;
  border: 1px solid #0f172a !important;
}

/* 2. KHỐI LỜI-NÓI (TO NHẤT, NỔI NHẤT) */
.crew-detail-block--loi-noi,
.the-tom-tat-copy-box,
.khoi-loi-noi {
  background: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-lon, 14px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
  box-shadow: 4.5px 4.5px 0px #0f172a !important;
}

/* Removed redundant loi-noi title override */

.crew-detail-speech,
.khoi-loi-noi-content,
.the-tom-tat-copy-preview {
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  color: #161b22 !important;
  background: #f8fafc !important;
  border: 1px solid #64748b !important;
  border-left: 1px solid #0284c7 !important;
  border-radius: var(--bo-vua, 10px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
  margin: 4px 0 8px 0 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  min-height: 48px !important;
  max-height: 180px !important;
  overflow-y: auto !important;
}

.crew-detail-copy-speech,
.the-tom-tat-btn-copy {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: var(--tho-lon, 16px 16px) !important;
  border-radius: var(--bo-vua, 10px) !important;
  border: 1px solid #0f172a !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  transition: all 100ms ease !important;
  user-select: none !important;
  align-self: flex-start !important;
}

.crew-detail-copy-speech:hover,
.the-tom-tat-btn-copy:hover {
  background: #ffffff !important;
  color: #0369a1 !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.crew-detail-speech-meta {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 700 !important;
  color: #64748b !important;
  margin-top: 4px !important;
}

/* 3. KHỐI VIỆC-CỦA-JACK */
.crew-detail-block--viec-cua-jack,
.the-tom-tat-giao-viec,
.khoi-viec-cua-jack {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%) !important;
  border: 1px solid #0f172a !important;
  border-radius: var(--bo-lon, 14px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
  box-shadow: 3.5px 3.5px 0px #0f172a !important;
}

/* Removed redundant viec-cua-jack title override */

.crew-detail-jack-request,
.khoi-viec-cua-jack-cau-lenh {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-weight: 900 !important;
  color: #161b22 !important;
  line-height: 1.45 !important;
  margin-bottom: 8px !important;
}

/* 4. KHỐI XEM-THÊM (GẤP LẠI, CHÌM XUỐNG) */
.crew-detail-block--xem-them,
.the-tom-tat-meta-grid,
.khoi-xem-them {
  background: #f8fafc !important;
  border: 1px solid #64748b !important;
  border-radius: var(--bo-vua, 10px) !important;
  padding: var(--tho-lon, 16px 16px) !important;
}

/* Removed redundant xem-them title override */

.crew-detail-layer {
  display: grid;
  gap: 4px;
  padding: var(--tho-vua, 8px 12px) !important;
  border: 1px solid #64748b !important;
  border-radius: var(--bo-vua, 10px) !important;
  background: #ffffff !important;
}

.crew-detail-layer-label {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 800 !important;
  color: #0369a1 !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
}

.crew-detail-layer-value {
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  overflow-wrap: anywhere !important;
}

/* =========================================================================
   DARK MODE CHO CÁC KHỐI DEV 1 (.crew-detail-block)
   ========================================================================= */
[data-theme="dark"] .crew-detail-block--dang-lam,
[data-canvas-bg="ban-dem"] .crew-detail-block--dang-lam,
[data-canvas-bg="phong-may"] .crew-detail-block--dang-lam,
[data-canvas-bg="tram-vu-tru"] .crew-detail-block--dang-lam {
  background: linear-gradient(135deg, #161b22 0%, #0f172a 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 3.5px 3.5px 0px #0284c7 !important;
}
[data-theme="dark"] .crew-detail-doing,
[data-canvas-bg="ban-dem"] .crew-detail-doing {
  color: #ffffff !important;
}
[data-theme="dark"] .crew-detail-elapsed,
[data-canvas-bg="ban-dem"] .crew-detail-elapsed {
  color: #38bdf8 !important;
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: #38bdf8 !important;
}

[data-theme="dark"] .crew-detail-block--loi-noi,
[data-canvas-bg="ban-dem"] .crew-detail-block--loi-noi,
[data-canvas-bg="phong-may"] .crew-detail-block--loi-noi,
[data-canvas-bg="tram-vu-tru"] .crew-detail-block--loi-noi {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  box-shadow: 4.5px 4.5px 0px #0284c7 !important;
}
/* Removed redundant dark loi-noi title */
[data-theme="dark"] .crew-detail-copy-speech,
[data-canvas-bg="ban-dem"] .crew-detail-copy-speech {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

[data-theme="dark"] .crew-detail-block--viec-cua-jack,
[data-canvas-bg="ban-dem"] .crew-detail-block--viec-cua-jack,
[data-canvas-bg="phong-may"] .crew-detail-block--viec-cua-jack,
[data-canvas-bg="tram-vu-tru"] .crew-detail-block--viec-cua-jack {
  background: linear-gradient(135deg, #161b22 0%, #161b22 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 3.5px 3.5px 0px #38bdf8 !important;
}
[data-theme="dark"] .crew-detail-jack-request,
[data-canvas-bg="ban-dem"] .crew-detail-jack-request {
  color: #38bdf8 !important;
}

[data-theme="dark"] .crew-detail-block--xem-them,
[data-canvas-bg="ban-dem"] .crew-detail-block--xem-them {
  background: #0f172a !important;
  border-color: #161b22 !important;
}
/* Removed redundant dark xem-them title */
[data-theme="dark"] .crew-detail-layer-value,
[data-canvas-bg="ban-dem"] .crew-detail-layer-value {
  color: #f8fafc !important;
}
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: var(--tho-vua, 8px 12px) !important;
  border-radius: var(--bo-tron, 9999px) !important;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-nho, 12px) !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  border: 1px solid #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  user-select: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  transition: transform 100ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 100ms ease !important;
}

.the-trang-thai.tt-dang-lam,
.tt-dang-lam {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15) !important;
}
.the-trang-thai.tt-dang-lam::before {
  content: '⚡';
  display: inline-block;
  font-size: var(--chu-vua, 14px);
}

.the-trang-thai.tt-dang-cho,
.tt-dang-cho {
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 100%) !important;
  color: #0f172a !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15) !important;
}
.the-trang-thai.tt-dang-cho::before {
  content: '⏳';
  display: inline-block;
  font-size: var(--chu-vua, 14px);
}

.the-trang-thai.tt-dang-nghi,
.tt-dang-nghi {
  background: linear-gradient(135deg, #f8fafc 0%, #64748b 100%) !important;
  color: #161b22 !important;
  border-color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}
.the-trang-thai.tt-dang-nghi::before {
  content: '💤';
  display: inline-block;
  font-size: var(--chu-vua, 14px);
}

.the-trang-thai.tt-gap-loi,
.tt-gap-loi {
  background: linear-gradient(135deg, #dc2626 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15) !important;
}
.the-trang-thai.tt-gap-loi::before {
  content: '⚠️';
  display: inline-block;
  font-size: var(--chu-vua, 14px);
}

@media (prefers-reduced-motion: reduce) {
  .the-tom-tat-overlay,
  .the-tom-tat-card,
  .the-tom-tat-giao-viec-btn,
  .the-tom-tat-giao-viec-feedback,
  .the-tom-tat-btn-copy,
  .the-tom-tat-nav-btn,
  .the-trang-thai,
  .can-jack,
  .can-jack.can-jack-nong {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
}

/* =========================================================================
   DẤU "ĐANG CHỜ JACK QUYẾT" (.can-jack) (VIỆC 13)
   ========================================================================= */

.can-jack:empty,
.can-jack[data-dem="0"],
.can-jack.is-hidden,
.can-jack.an {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.can-jack {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: var(--tho-lon, 16px 16px) !important;
  border-radius: var(--bo-tron, 9999px) !important;
  background: linear-gradient(135deg, #38bdf8 0%, #38bdf8 50%, #161b22 100%) !important;
  color: #ffffff !important;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.2 !important;
  border: 1px solid #0f172a !important;
  box-shadow: 3.5px 3.5px 0px #0f172a, 0 0 16px rgba(249, 115, 22, 0.5) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  user-select: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

.can-jack::before {
  content: '⚡';
  display: inline-block;
  font-size: var(--chu-nhan, 16px);
}

.can-jack-dem {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 22px !important;
  height: 22px !important;
  padding: var(--tho-nho, 4px 8px) !important;
  border-radius: var(--bo-tron, 9999px) !important;
  background: #ffffff !important;
  color: #161b22 !important;
  font-family: 'Outfit', 'Inter', sans-serif !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 900 !important;
  border: 1px solid #0f172a !important;
  box-shadow: 1.5px 1.5px 0px #0f172a !important;
  text-shadow: none !important;
  line-height: 1 !important;
}

.can-jack.can-jack-nong,
.can-jack-nong {
  background: linear-gradient(135deg, #dc2626 0%, #dc2626 50%, #161b22 100%) !important;
  border-color: #0f172a !important;
  border-width: 1px !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15) !important;
}

.can-jack.can-jack-nong::before,
.can-jack-nong::before {
  content: '🔥';
  display: inline-block;
  font-size: var(--chu-nhan, 16px);
}

.can-jack.can-jack-nong .can-jack-dem,
.can-jack-nong .can-jack-dem {
  background: #ffffff !important;
  color: #161b22 !important;
  border-color: #0f172a !important;
  border-width: 1px !important;
  font-size: var(--chu-vua, 14px) !important;
  line-height: 20px !important;
  font-weight: 900 !important;
}

/* AK — hàng thẻ đọc nhanh xếp NGANG, cuộn ngang mượt mà, có chỗ thêm mục mới (WO-FIX-221) */
.crew-detail-tab-list,
.crew-command-composer .crew-detail-tab-list,
.crew-command-composer .crew-detail-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  padding: 8px 8px !important;
  background: var(--the-noi, #f8fafc) !important;
  border-radius: var(--bo-vua, 10px) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  flex-shrink: 0 !important;
}

.crew-detail-tab,
.crew-command-composer .crew-detail-tab {
  display: inline-flex !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  padding: 4px 8px !important;
  border: 1px solid var(--vien, #64748b) !important;
  border-radius: 9999px !important;
  background: var(--the, #fff) !important;
  color: var(--chu, #0f172a) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: clamp(10.5px, 2.2vw, 12.5px) !important;
  font-style: normal !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

.crew-command-composer .crew-detail-tab.crew-detail-tab--active {
  border-color: #0284c7 !important;
  background: #ffffff !important;
  color: #0369a1 !important;
}

@media (max-width: 600px) {
  .crew-detail-tab-list,
  .crew-command-composer .crew-detail-tab-list,
  .crew-command-composer .crew-detail-tabs {
    gap: 4px !important;
    padding: 4px 0 8px 0 !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }
  .crew-detail-tab,
  .crew-command-composer .crew-detail-tab {
    padding: 4px 8px !important;
    font-size: 12px !important;
    line-height: 16px !important;
    height: 30px !important;
    min-height: 28px !important;
    line-height: 1.15 !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

.crew-command-composer .crew-detail-tab-panes,
.crew-command-composer .crew-detail-tab-pane {
  display: grid !important;
  gap: 8px !important;
}

.crew-command-composer .crew-detail-tab-pane[hidden] {
  display: none !important;
}

.crew-command-composer .crew-text-size-control {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #0f172a !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-style: normal !important;
  font-weight: 800 !important;
}

.crew-command-composer .crew-text-size-control select {
  min-height: 34px !important;
  padding: var(--tho-vua, 8px 12px) !important;
  border: 1px solid #64748b !important;
  border-radius: var(--bo-vua, 10px) !important;
  background: #fff !important;
  color: #0f172a !important;
  font: 800 15px/1.25 Inter, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.crew-command-composer[data-crew-text-size="nho"] { --crew-readable-size: 15px; }
.crew-command-composer[data-crew-text-size="vua"] { --crew-readable-size: 16px; }
.crew-command-composer[data-crew-text-size="lon"] { --crew-readable-size: 18px; }

/* Removed calc title override */

.crew-command-composer .crew-detail-block-body,
.crew-command-composer .crew-detail-layer-value,
.crew-command-composer .crew-detail-doing,
.crew-command-composer .crew-detail-progress,
.crew-command-composer .crew-detail-speech,
.crew-command-composer .crew-detail-speech-meta,
.crew-command-composer .crew-detail-doing-meta,
.crew-command-composer .crew-detail-elapsed,
.crew-command-composer .crew-detail-file-row,
.crew-command-composer .crew-detail-jack-request {
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-style: normal !important;
  line-height: 1.5 !important;
}

.crew-command-composer .crew-detail-copy-speech {
  min-height: 38px !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: var(--chu-nhan, 16px) !important;
  font-style: normal !important;
}

/* =========================================================================
   ĐOẠN TRAO ĐỔI CLAUDE (loiTraoDoiClaude)
   ========================================================================= */
.crew-detail-block--loi-trao-doi {
  display: grid;
  gap: var(--crew-detail-gap, 8px);
}

.crew-detail-exchange-banner {
  box-sizing: border-box;
  width: 100%;
}

.crew-detail-exchange-stream {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  scrollbar-width: thin;
}

.crew-exchange-turn {
  box-sizing: border-box;
  width: 100%;
  transition: background 100ms ease, border-color 100ms ease;
}

.crew-exchange-turn--human {
  background: #ffffff;
  border-left: 1px solid var(--xanh-bien, #0284c7) !important;
}

.crew-exchange-turn--assistant {
  background: #ffffff;
  border-left: 1px solid var(--xanh-la, #38bdf8) !important;
}

[data-theme="dark"] .crew-exchange-turn--human,
[data-canvas-bg="ban-dem"] .crew-exchange-turn--human {
  background: #161b22 !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
}

[data-theme="dark"] .crew-exchange-turn--assistant,
[data-canvas-bg="ban-dem"] .crew-exchange-turn--assistant {
  background: #0f172a !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
}

[data-theme="dark"] .crew-exchange-cut-alert,
[data-canvas-bg="ban-dem"] .crew-exchange-cut-alert {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .crew-detail-exchange-banner,
[data-canvas-bg="ban-dem"] .crew-detail-exchange-banner {
  background: #161b22 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .crew-exchange-message {
  color: #f8fafc !important;
}

/* THẺ TÓM TẮT - ĐOẠN TRAO ĐỔI */
.the-tom-tat-exchange-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--vien, #64748b);
}

.the-tom-tat-exchange-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.the-tom-tat-exchange-hint {
  font-size: var(--chu-nho, 12px);
  color: var(--chu-phu, #64748b);
  font-weight: 700;
}

.the-tom-tat-exchange-stream {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}

.the-tom-tat-exchange-turn {
  padding: var(--tho-vua, 8px 12px);
  border-radius: var(--bo-vua, 10px);
  border: 1px solid var(--vien, #64748b);
  background: var(--the, #ffffff);
  font-family: Inter, sans-serif;
}

.the-tom-tat-exchange-turn.is-human {
  border-left: 1px solid var(--xanh-bien, #0284c7);
  background: #ffffff;
}

.the-tom-tat-exchange-turn.is-assistant {
  border-left: 1px solid var(--xanh-la, #38bdf8);
  background: #ffffff;
}

.the-tom-tat-turn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.the-tom-tat-turn-speaker {
  font-size: var(--chu-nho, 12px);
  font-weight: 800;
  color: var(--chu, #0f172a);
}

.the-tom-tat-turn-time {
  font-size: var(--chu-nho, 12px);
  color: var(--chu-phu, #64748b);
  font-family: JetBrains Mono, monospace;
}

.the-tom-tat-turn-text {
  font-size: var(--chu-vua, 14px);
  font-weight: 600;
  line-height: 1.5;
  color: var(--chu, #0f172a);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.the-tom-tat-exchange-cut {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: var(--bo-nho, 6px);
  background: #ffffff;
  border: 1px solid #38bdf8;
  color: #161b22;
  font-size: var(--chu-nho, 12px);
  font-weight: 700;
}

.the-tom-tat-exchange-empty {
  padding: var(--tho-vua, 8px 12px);
  border-radius: var(--bo-vua, 10px);
  border: 1px solid var(--vien, #cbd5e1);
  color: var(--chu-phu, #64748b);
  font-size: var(--chu-vua, 14px);
  font-weight: 700;
  background: var(--the-noi, #f8fafc);
}

[data-theme="dark"] .the-tom-tat-exchange-turn.is-human {
  background: #161b22 !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
}

[data-theme="dark"] .the-tom-tat-exchange-turn.is-assistant {
  background: #0f172a !important;
  border-color: #161b22 !important;
  border-left-color: #38bdf8 !important;
}

[data-theme="dark"] .the-tom-tat-turn-text,
[data-theme="dark"] .the-tom-tat-turn-speaker {
  color: #f8fafc !important;
}

/* =========================================================================
   HỘP CHỌN TÓM TẮT & BẢN TÓM TẮT ĐỘI NGŨ — Jack 2/9 (WO-2026-09-02-DEV2-NUT-TOM-TAT)
   ========================================================================= */
.hop-chon-tom-tat-overlay,
.ban-tom-tat-doi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.hop-chon-tom-tat-overlay.is-open,
.hop-chon-tom-tat-overlay.is-active,
.ban-tom-tat-doi-overlay.is-open,
.ban-tom-tat-doi-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}
.hop-chon-tom-tat-card,
.ban-tom-tat-doi-card {
  width: min(580px, 95vw);
  max-height: min(82vh, 760px);
  background: var(--the, #ffffff);
  border: 1px solid var(--vien-dam, #0f172a);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ban-tom-tat-doi-card {
  width: min(780px, 96vw);
}

.summary-agent-chip {
  background: var(--the-noi, #ffffff);
  border: 1px solid var(--vien, #64748b);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--chu, #0f172a);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 100ms ease;
}
.summary-agent-chip:hover {
  border-color: #0284c7;
  color: #0284c7;
}
.summary-agent-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 700;
}

.summary-choice-btn {
  background: #ffffff;
  border: 1px solid var(--vien, #64748b);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--chu, #0f172a);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 100ms ease;
}
.summary-choice-btn:hover {
  border-color: #0284c7;
  color: #0284c7;
}
.summary-choice-btn.active {
  background: #ffffff;
  border-color: #0284c7;
  color: #0369a1;
  font-weight: 700;
}

/* =========================================================================
   THIẾT KẾ ĐÃ DỰNG: ICON CÁI LOA & MENU NHỎ BẤM GIỮ LÂU (WO-UX-242)
   1. Vùng bấm loa đạt chuẩn >= 44x44px (ngón tay bấm trúng 100%)
   2. Menu nhỏ nổi 2 lựa chọn: Chỉ chuông báo vs Có thêm giọng nói
   ========================================================================= */

.crew-btn-bell {
  cursor: pointer !important;
  pointer-events: all !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation !important;
}

.crew-btn-bell rect:not(.crew-btn-bell-hitbox) {
  transition: transform 100ms ease, stroke 100ms ease, fill 100ms ease;
}

.crew-btn-bell:hover rect:not(.crew-btn-bell-hitbox) {
  fill: #ffffff !important;
  stroke: #0284c7 !important;
}

.crew-btn-bell:active rect:not(.crew-btn-bell-hitbox) {
  transform: scale(0.92);
}

/* Hitbox vô hình đạt chuẩn >= 44x44px quanh icon loa */
.crew-btn-bell-hitbox {
  fill: transparent !important;
  stroke: none !important;
  pointer-events: all !important;
  cursor: pointer !important;
}

/* Khung menu nhỏ xuất hiện khi bấm giữ lâu (Mini Loa Context Menu) */
.menu-loa-mini {
  position: fixed;
  z-index: 2147483640;
  width: 250px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f8fafc;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateY(4px);
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-loa-mini.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.menu-loa-mini__header {
  padding: 8px 8px 8px 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-loa-mini__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px; /* Chuẩn 44 điểm cho ngón tay */
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: all 100ms ease;
}

.menu-loa-mini__item:hover,
.menu-loa-mini__item:focus {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

.menu-loa-mini__item.is-active {
  background: rgba(2, 132, 199, 0.28);
  border-color: #0284c7;
}

.menu-loa-mini__icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
}

.menu-loa-mini__text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 4px;
}

.menu-loa-mini__label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.menu-loa-mini__desc {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #8b949e;
  line-height: 1.2;
}

.menu-loa-mini__check {
  font-size: 14px;
  font-weight: 900;
  color: #38bdf8;
  opacity: 0;
  transition: opacity 100ms ease;
}

.menu-loa-mini__item.is-active .menu-loa-mini__check {
  opacity: 1;
}

/* Toast thông báo nhẹ khi đổi âm thanh */
.loa-toast-feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  opacity: 0;
  z-index: 2147483647;
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.loa-toast-feedback.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================================
   THIẾT KẾ: ẨN HIỆN AGENT NHANH & PHÂN BIỆT AGENT JACK ĐẶT TÊN (WO-UX-243)
   1. Nút ẩn nhanh trên từng thẻ agent (hitbox >= 44x44px)
   2. Phân biệt nhãn ⭐ JACK vs 🤖 TỰ MỌC
   3. Khay nổi hiển thị danh sách agent đang ẩn (#khayAgentBiAn)
   4. Modal quản lý bật lại / ẩn sạch agent tự phát sinh (#hopDanhSachAgentAn)
   ========================================================================= */

/* 1. Nút ẩn nhanh trên thẻ */
.crew-btn-quick-hide {
  cursor: pointer !important;
  pointer-events: all !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation !important;
}

.crew-btn-quick-hide .crew-btn-hide-bg {
  transition: transform 100ms ease, stroke 100ms ease, fill 100ms ease;
}

.crew-btn-quick-hide:hover .crew-btn-hide-bg {
  fill: #ffffff !important;
  stroke: #dc2626 !important;
}

.crew-btn-quick-hide:active .crew-btn-hide-bg {
  transform: scale(0.92);
}

.crew-btn-hide-hitbox {
  fill: transparent !important;
  stroke: none !important;
  pointer-events: all !important;
  cursor: pointer !important;
}

.crew-agent-origin-badge {
  pointer-events: none !important;
  user-select: none !important;
}

/* 2. Khay nổi hiển thị danh sách agent đang ẩn (Floating Restore Button) */
.khay-agent-bi-an {
  position: fixed !important;
  right: 16px !important;
  bottom: 144px !important;
  z-index: 2147483000;
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #f8fafc;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 12px rgba(245, 158, 11, 0.15);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.khay-agent-bi-an:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1), 0 0 20px rgba(245, 158, 11, 0.15);
}

.khay-agent-bi-an:active {
  transform: translateY(1px) scale(0.98);
}

.khay-agent-bi-an__icon {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.khay-agent-bi-an.has-hidden {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  animation: pulseHiddenKhay 3s ease 3;
}

@keyframes pulseHiddenKhay {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 10px rgba(245, 158, 11, 0.15); }
  50% { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 0 18px rgba(245, 158, 11, 0.15); }
}

@media (max-width: 903.98px) {
  .khay-agent-bi-an {
    right: 12px !important;
    bottom: 144px !important;
    padding: 0 12px;
    font-size: 12px;
    line-height: 16px;
    height: 44px;
  }
}

/* 3. Modal Khung Danh Sách Agent Đang Ẩn (#hopDanhSachAgentAn) */
.hop-danh-sach-agent-an {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.hop-danh-sach-agent-an.is-open {
  opacity: 1;
  pointer-events: auto;
}

.hop-danh-sach-card {
  width: min(580px, 95vw);
  max-height: min(84vh, 720px);
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f8fafc;
}

.hop-danh-sach-card__header {
  padding: 16px 24px;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hop-danh-sach-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.hop-danh-sach-card__count {
  background: #38bdf8;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 9999px;
}

.hop-danh-sach-card__close {
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 20px;
  line-height: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: all 100ms ease;
}

.hop-danh-sach-card__close:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.hop-danh-sach-card__actions {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-action-restore-all,
.btn-action-hide-auto {
  min-height: 44px; /* Chuẩn 44 điểm cho ngón tay */
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 100ms ease;
  user-select: none;
}

.btn-action-restore-all {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #38bdf8;
}

.btn-action-restore-all:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-action-hide-auto {
  background: rgba(245, 158, 11, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(245, 158, 11, 0.6);
}

.btn-action-hide-auto:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.hop-danh-sach-card__body {
  padding: 16px 24px;
  overflow-y: auto;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-hidden-state {
  text-align: center;
  padding: 32px 24px;
}

.hidden-group-header {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
}

.group-title {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 900;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hidden-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hidden-agent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 100ms ease;
}

.hidden-agent-row:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
}

.hidden-agent-row.is-jack-named {
  border-left: 1px solid #38bdf8;
}

.hidden-agent-row.is-auto-spawned {
  border-left: 1px solid #64748b;
}

.hidden-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-grow: 1;
}

.agent-avatar-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
}

.agent-name-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.agent-primary-name {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-sub-info {
  font-size: 12px;
  line-height: 16px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-restore-single {
  min-height: 44px; /* Chuẩn 44 điểm cho ngón tay */
  padding: 8px 16px;
  border-radius: 10px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 100ms ease;
}

.btn-restore-single:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.hop-danh-sach-card__footer {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}

.btn-action-close {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 700;
  cursor: pointer;
}

.btn-action-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────────
 * DÒNG NHỎ KẾ BÊN NHÂN VẬT KHI RÊ CHUỘT (Jack chốt 13:05 04/09)
 * Tên + Đang làm gì + Bao lâu · Không che gì · Không làm mờ nền
 * ───────────────────────────────────────────────────────────────────────── */
.dos-agent-mini-hover-tag {
  position: fixed !important;
  z-index: 999998 !important;
  display: none;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #38bdf8 !important;
  border-radius: 10px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  max-width: 360px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  animation: miniHoverTagFadeIn 100ms ease-out !important;
}

@keyframes miniHoverTagFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dos-agent-mini-hover-tag .mini-hover-name {
  font-weight: 800 !important;
  color: #38bdf8 !important;
}

.dos-agent-mini-hover-tag .mini-hover-sep {
  color: #64748b !important;
}

.dos-agent-mini-hover-tag .mini-hover-task {
  color: #f8fafc !important;
  max-width: 180px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dos-agent-mini-hover-tag .mini-hover-time {
  color: #8b949e !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * MENU TÁC VỤ 5 MỤC BẤM CỦA AGENT (Jack chốt: HIỆN CẠNH NHÂN VẬT, KHÔNG MỜ NỀN)
 * Chuẩn Fitts: Cạnh ngắn luôn >= 44px (min-height: 52px, padding: 8px 16px)
 * ───────────────────────────────────────────────────────────────────────── */
.menu-hanh-dong-agent-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483640 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  display: none !important;
  box-sizing: border-box !important;
  pointer-events: all !important;
}

.menu-hanh-dong-agent-overlay.is-open {
  display: block !important;
}

.menu-hanh-dong-card {
  position: fixed !important;
  z-index: 2147483641 !important;
  background: #ffffff !important;
  border-radius: 14px !important;
  border: 1px solid #64748b !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  width: 100% !important;
  max-width: 360px !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: #0f172a !important;
  animation: slideMenuHanhDongUp 200ms ease-out !important;
}

@keyframes slideMenuHanhDongUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-hanh-dong-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid #64748b !important;
  background: #f8fafc !important;
}

.menu-hanh-dong-title {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.menu-agent-avatar {
  font-size: 28px !important;
  line-height: 1 !important;
}

.menu-agent-identity {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.menu-agent-name {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.menu-agent-role {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

.menu-hanh-dong-close {
  background: transparent !important;
  border: none !important;
  font-size: 20px !important;
  color: #64748b !important;
  cursor: pointer !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  transition: all 100ms ease !important;
}

.menu-hanh-dong-close:hover {
  background: #161b22 !important;
  color: #dc2626 !important;
}

.menu-hanh-dong-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 16px !important;
}

/* WO-UI-236 / Jack 4-9: menu phải quét được trong một màn hình hẹp. */
.menu-hanh-dong-list--compact {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 12px !important;
}

.menu-hanh-dong-list--compact .menu-group-header {
  grid-column: 1 / -1 !important;
}

.menu-hanh-dong-list--compact .menu-hanh-dong-btn {
  min-width: 44px !important;
  min-height: 52px !important;
  padding: 8px 6px !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 5px !important;
  text-align: center !important;
}

.menu-hanh-dong-list--compact .menu-btn-icon {
  font-size: 20px !important;
}

.menu-hanh-dong-list--compact .menu-btn-content {
  min-width: 0 !important;
  width: 100% !important;
  display: block !important;
}

.menu-hanh-dong-list--compact .menu-btn-label {
  font-size: 12px !important;
  line-height: 16px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.menu-hanh-dong-list--compact .menu-btn-desc {
  display: none !important;
}

/* =========================================================================
   THIẾT KẾ MENU NHÂN VẬT CHO MÀN HÌNH RỘNG / TABLET (Jack 18:10 - 06/09)
   - Bố cục 2 cột khi màn hình >= 600px, card rộng tối đa 680px
   - Thấy hết 100% mục, ZERO SCROLL trên tablet
   - Đưa 2 mục giá trị cao (Biểu đồ DAG & Hỏi đáp AI) lên đầu làm Hero button
   - Nút chuẩn Fitts >= 44px, chữ rõ ràng
   ========================================================================= */

.menu-hanh-dong-btn--hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  border: 1px solid #0284c7 !important;
  min-height: 56px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12) !important;
}

.menu-hanh-dong-btn--hero:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
  border-color: #0369a1 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
  transform: translateY(-1px) !important;
}

.menu-hanh-dong-btn--hero .menu-btn-label {
  color: #0369a1 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.menu-hanh-dong-btn--hero .menu-btn-icon {
  font-size: 24px !important;
}

.menu-hanh-dong-btn--hero .menu-btn-desc {
  color: #0284c7 !important;
  opacity: 0.9 !important;
  font-weight: 600 !important;
}

.menu-group-header--hero {
  color: #0284c7 !important;
}
.menu-group-header--hero::after {
  background: #bae6fd !important;
}

@media (min-width: 600px) {
  .menu-hanh-dong-card,
  #menuHanhDongCard {
    width: min(680px, calc(100vw - 32px)) !important;
    max-width: 680px !important;
    max-height: calc(100vh - 32px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
    border-radius: 14px !important;
  }

  .menu-hanh-dong-list.menu-hanh-dong-list--tablet-grid,
  #menuHanhDongMainList.menu-hanh-dong-list--tablet-grid,
  .menu-hanh-dong-list--tablet-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 12px !important;
    padding: 12px 16px 16px !important;
  }

  .menu-hanh-dong-list--tablet-grid .menu-group-header {
    grid-column: 1 / -1 !important;
    margin-top: 4px !important;
    margin-bottom: 2px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
  }

  .menu-hanh-dong-list--tablet-grid .menu-hanh-dong-btn {
    min-height: 52px !important;
    padding: 8px 12px !important;
    gap: 10px !important;
    text-align: left !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
  }

  .menu-hanh-dong-list--tablet-grid .menu-btn-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .menu-hanh-dong-list--tablet-grid .menu-btn-label {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .menu-hanh-dong-list--tablet-grid .menu-btn-desc {
    display: block !important;
    font-size: 11.5px !important;
    color: #64748b !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .menu-agent-composer-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .menu-agent-message-input {
    min-height: 42px !important;
    height: 42px !important;
    padding: 8px 12px !important;
    resize: none !important;
  }

  .menu-agent-composer-actions {
    width: auto !important;
    flex-shrink: 0 !important;
  }
}

@media (max-width: 480px) {
  .menu-hanh-dong-card,
  #menuHanhDongCard {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 56px) !important;
    left: 8px !important;
    right: 8px !important;
    margin: 0 !important;
  }

  .menu-hanh-dong-list,
  .menu-hanh-dong-list--compact {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 10px !important;
  }

  .menu-hanh-dong-list--compact .menu-hanh-dong-btn {
    flex-direction: row !important;
    justify-content: flex-start !important;
    text-align: left !important;
    min-height: 48px !important;
    padding: 8px 12px !important;
    gap: 10px !important;
  }

  .menu-hanh-dong-list--compact .menu-btn-content {
    display: flex !important;
    flex-direction: column !important;
  }

  .menu-hanh-dong-list--compact .menu-btn-label {
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  .menu-hanh-dong-list--compact .menu-btn-desc {
    display: block !important;
    font-size: 11px !important;
    color: #64748b !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

.menu-agent-composer {
  display: grid !important;
  gap: 6px !important;
  padding: 12px 12px 4px !important;
  border-bottom: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
}

.menu-agent-composer-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.menu-agent-message-input {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  box-sizing: border-box !important;
  resize: vertical !important;
  padding: 10px 12px !important;
  border: 1px solid #64748b !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font: 600 13px/1.35 Inter, sans-serif !important;
}

.menu-agent-message-input:focus {
  outline: none !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16) !important;
}

.menu-agent-composer-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.menu-agent-attach-button {
  min-width: 44px !important;
  height: 44px !important;
  padding: 8px 12px !important;
  border: 1px solid #64748b !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 18px !important;
  box-sizing: border-box !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  flex-shrink: 0 !important;
}

.menu-agent-composer-actions .dos-nut-mic {
  min-width: 80px !important;
  height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid #0284c7 !important;
  border-radius: 10px !important;
  background: #f0f9ff !important;
  color: #0284c7 !important;
  font: 700 13px Inter, sans-serif !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.menu-agent-send-button {
  margin-left: auto !important;
  min-width: 84px !important;
  height: 44px !important;
  padding: 0 16px !important;
  border: 1px solid #0284c7 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font: 800 14px Inter, sans-serif !important;
  box-sizing: border-box !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}

.menu-agent-attach-button:disabled,
.menu-agent-send-button:disabled {
  opacity: 0.55 !important;
  cursor: wait !important;
}

.menu-agent-image-preview {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  padding: 4px 8px !important;
  border: 1px solid #64748b !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font: 600 11px/1.3 Inter, sans-serif !important;
}

.menu-agent-image-preview[hidden] {
  display: none !important;
}

.menu-agent-image-preview img {
  width: 32px !important;
  height: 32px !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  border: 1px solid #64748b !important;
}

.menu-agent-image-preview span {
  min-width: 0 !important;
  flex: 1 !important;
  overflow-wrap: anywhere !important;
}

.menu-agent-image-preview button {
  min-width: 44px !important;
  min-height: 44px !important;
  border: 0 !important;
  background: transparent !important;
  color: #dc2626 !important;
  cursor: pointer !important;
  font-size: 20px !important;
}

.menu-agent-composer-status {
  min-height: 16px !important;
  color: #64748b !important;
  font: 600 11px/1.35 Inter, sans-serif !important;
  overflow-wrap: anywhere !important;
}

.menu-agent-composer.is-dragging .menu-agent-message-input {
  border-color: #0284c7 !important;
  background: #eff6ff !important;
}

.menu-agent-name {
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

.menu-sub-header {
  min-width: 0 !important;
  gap: 8px !important;
}

.menu-sub-header > span {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow-wrap: anywhere !important;
}

.btn-dong-sub-panel {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

.menu-hanh-dong-btn {
  min-height: 52px !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 8px 16px !important;
  border-radius: 10px !important;
  border: 1px solid #64748b !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  cursor: pointer !important;
  text-align: left !important;
  box-sizing: border-box !important;
  transition: all 100ms ease !important;
}

.menu-hanh-dong-btn:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15) !important;
  transform: translateY(-1px) !important;
}

.menu-hanh-dong-btn:active {
  transform: translateY(0) !important;
}

.menu-btn-icon {
  font-size: 20px !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}

.menu-btn-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 1 !important;
}

.menu-btn-label {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.menu-btn-desc {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.35 !important;
}

.menu-hanh-dong-btn.menu-btn--hide:hover {
  border-color: #dc2626 !important;
  background: #f8fafc !important;
}

.menu-hanh-dong-btn.menu-btn--hide:hover .menu-btn-label {
  color: #dc2626 !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * KHỐNG CHẾ TRÀN MÉP & CHÌM ĐÁY CHO MENU 5 MỤC & 5 VIỆC GẦN NHẤT (LỖI 5)
 * ───────────────────────────────────────────────────────────────────────── */
.menu-group-header {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 8px 4px 4px 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.menu-group-header::after {
  content: '' !important;
  flex: 1 !important;
  height: 1px !important;
  background: #cbd5e1 !important;
}

.menu-hanh-dong-card {
  max-height: calc(100vh - 32px) !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.menu-5-viec-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 16px !important;
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.menu-5-viec-panel[style*="display: none"],
.menu-5-viec-panel[style*="display:none"] {
  display: none !important;
}

.menu-sub-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #64748b !important;
}

.btn-dong-sub-panel {
  background: #f8fafc !important;
  border: 1px solid #64748b !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  cursor: pointer !important;
  min-height: 44px !important;
  min-width: 80px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  transition: background 100ms ease !important;
}

.btn-dong-sub-panel:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
}

.menu-5-viec-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.menu-5-viec-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  border: 1px solid #64748b !important;
  font-size: 12px !important;
  line-height: 16px !important;
  color: #0f172a !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * KHUNG NHỎ TOOLTIP CHO TỆP CHỮ / VẼ / TÀI NGUYÊN (LỖI 3)
 * Cấm nhận sự kiện chuột · Vị trí tính theo ô được rê · Không giật
 * ───────────────────────────────────────────────────────────────────────── */
#dosTip,
.dos-tool-tooltip {
  pointer-events: none !important;
}

.dos-tool-tooltip {
  position: fixed !important;
  z-index: 999998 !important;
  display: none;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #38bdf8 !important;
  border-radius: 10px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 12px !important;
  line-height: 16px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  max-width: 360px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  animation: none !important;
  transform: none !important;
  transition: left 0.12s cubic-bezier(0.16, 1, 0.3, 1), top 0.12s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.08s ease-out !important;
}


/* WO-UI-236: Khay nút luôn hiển thị để Jack bấm 1 chạm ẩn người không hoạt động */
.khay-agent-bi-an,
.khay-agent-bi-an:not(.has-hidden) {
  display: inline-flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
@media (max-width: 903.98px) {
  .khay-agent-bi-an,
  .khay-agent-bi-an:not(.has-hidden) {
    display: inline-flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    right: 12px !important;
    bottom: 130px !important;
    padding: 0 12px;
    font-size: 12px;
    line-height: 16px;
    height: 44px;
    min-height: 44px;
  }
}


/* WO-UI-236: Banner thông báo lỗi kết nối /phien/doc màu đỏ và nút Thử lại */
.crew-chat-error-banner {
  background: #fef2f2 !important;
  border: 1px solid #ef4444 !important;
  color: #b91c1c !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  margin: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.12) !important;
}

.crew-chat-error-text {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 !important;
}

.crew-chat-error-icon {
  font-size: 18px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.crew-chat-error-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.crew-chat-error-title {
  color: #b91c1c !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.crew-chat-error-detail {
  color: #7f1d1d !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.crew-chat-retry-btn {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  transition: background 0.15s ease, transform 0.1s ease !important;
}

.crew-chat-retry-btn:hover:not(:disabled) {
  background: #b91c1c !important;
  transform: translateY(-1px) !important;
}

.crew-chat-retry-btn:active:not(:disabled) {
  background: #991b1b !important;
  transform: translateY(0) !important;
}

.crew-chat-retry-btn:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

/* ─────────────────────────────────────────────────────────────────────────
 * NÚT HỎI LUÔN NHÌN THẤY ĐƯỢC & HỘP NHỎ 3 CÂU HỎI SẴN (PHẦN 7 THIẾT KẾ)
 * Cửa vào tầng HỎI — không nằm trong menu, chạm 1 cái là tới
 * ───────────────────────────────────────────────────────────────────────── */
.nut-hoi-nhanh-ai-float {
  position: fixed !important;
  right: 16px !important;
  bottom: 84px !important;
  z-index: 2147483500 !important;
  height: 44px !important;
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 0 16px !important;
  border-radius: 9999px !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid #38bdf8 !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  user-select: none !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nut-hoi-nhanh-ai-float:hover {
  background: #0369a1 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.5) !important;
}

.nut-hoi-nhanh-ai-float:active {
  transform: translateY(0) !important;
}

@media (max-width: 903.98px) {
  /* Jack 6/9: Ẩn nút hỏi nhanh nổi cũ trên di động vì đã có dock Người Trực ở đáy */
  .nut-hoi-nhanh-ai-float,
  button.nut-hoi-nhanh-ai-float {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

.hop-hoi-nhanh-ai-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483645 !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.hop-hoi-nhanh-ai-overlay.is-open {
  display: flex !important;
}

.hop-hoi-nhanh-ai-card {
  position: relative !important;
  width: 100% !important;
  max-width: 380px !important;
  background: #ffffff !important;
  border-radius: 14px !important;
  border: 1px solid #64748b !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  max-height: calc(100vh - 48px) !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
  animation: slideHoiNhanhUp 150ms ease-out !important;
}

@keyframes slideHoiNhanhUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hop-hoi-nhanh-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  border-radius: 14px 16px 0 0 !important;
}

.hop-hoi-nhanh-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.hop-hoi-nhanh-close {
  background: transparent !important;
  border: none !important;
  font-size: 20px !important;
  color: #64748b !important;
  cursor: pointer !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  transition: all 100ms ease !important;
}

.hop-hoi-nhanh-close:hover {
  background: #e2e8f0 !important;
  color: #dc2626 !important;
}

.hop-hoi-nhanh-body {
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  box-sizing: border-box !important;
}

.hop-hoi-nhanh-target-bar {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  font-size: 12px !important;
}

.hoi-nhanh-target-text {
  color: #334155 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.hoi-nhanh-target-text strong {
  color: #0284c7 !important;
}

.btn-doi-target-hoi-nhanh {
  background: #ffffff !important;
  border: 1px solid #64748b !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  min-height: 32px !important;
}

.btn-doi-target-hoi-nhanh:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
}

.hop-hoi-nhanh-section-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.hop-hoi-nhanh-presets {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.btn-cau-hoi-san {
  width: 100% !important;
  min-height: 46px !important;
  padding: 10px 14px !important;
  background: #f8fafc !important;
  border: 1px solid #64748b !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  text-align: left !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
  transition: all 120ms ease !important;
}

.btn-cau-hoi-san:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15) !important;
  transform: translateY(-1px) !important;
}

.btn-cau-hoi-san:active {
  transform: translateY(0) !important;
}

.btn-cau-hoi-san-icon {
  font-size: 18px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

.hop-hoi-nhanh-custom-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.input-cau-hoi-tu-do {
  width: 100% !important;
  min-height: 52px !important;
  padding: 10px 12px !important;
  border: 1px solid #64748b !important;
  border-radius: 10px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  color: #0f172a !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  resize: vertical !important;
}

.input-cau-hoi-tu-do:focus {
  outline: none !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
}

.hop-hoi-nhanh-footer-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

.btn-gui-cau-hoi-tu-do {
  min-height: 44px !important;
  min-width: 88px !important;
  padding: 0 16px !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  transition: background 120ms ease, transform 100ms ease !important;
}

.btn-gui-cau-hoi-tu-do:hover:not(:disabled) {
  background: #0369a1 !important;
  transform: translateY(-1px) !important;
}

.btn-gui-cau-hoi-tu-do:active:not(:disabled) {
  transform: translateY(0) !important;
}

.btn-gui-cau-hoi-tu-do:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

.hop-hoi-nhanh-ket-qua-area {
  display: block !important;
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
  padding: 14px 16px !important;
  border-radius: 0 0 14px 14px !important;
  max-height: 240px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

.hoi-nhanh-trang-thai {
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  color: #0284c7 !important;
  margin-bottom: 8px !important;
}

.hoi-nhanh-ket-qua-content {
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
}

.hoi-nhanh-ket-qua-content pre,
.hoi-nhanh-ket-qua-content code {
  background: #e2e8f0 !important;
  border-radius: 6px !important;
  font-family: ui-monospace, monospace !important;
  font-size: 12px !important;
}

/* TRIỆT TIÊU ĐÈ MA: Modal, backdrop và popover phụ khi chưa có .is-open thì tuyệt đối không hiển thị */
.modal-dialog-overlay:not(.is-open),
#themeStudioModal:not(.is-open),
#sessionDetailModal:not(.is-open),
#exportModal:not(.is-open),
#customDialogModal:not(.is-open),
.popover-cong-cu-phu:not(.is-open) {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

