/* TrustJai: shared product language.
   Modern Trust Blue & Ocean Fintech Style (แรงบันดาลใจจาก Billbau.com & Stripe):
   Clean soft canvas (#f4f8fd / #f8fafc), pure white elevated surfaces (#ffffff),
   ocean trust blue accents (#0284c7 / #0369a1), and soft gentle borders (#e2e8f0 / #e0f2fe).
   Spacious, comfortable, and easy to read on both mobile and desktop. */
body.tj-system {
  color-scheme: light;
  --bg: #f4f8fd;
  --bg-2: #e0f2fe;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --dim: #64748b;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --brand: #0284c7;
  --brand-2: #0369a1;
  --brand-ink: #075985;
  --brand-soft: #f0f9ff;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --ok: #0284c7;
  --ok-soft: #f0f9ff;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --r: 20px;
  --r-sm: 12px;
  --ring: 0 0 0 3.5px rgba(2, 132, 199, 0.2);
  --shadow-1: 0 1px 3px rgba(15, 23, 42, 0.03), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-2: 0 6px 20px -3px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --shadow-3: 0 20px 40px -10px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03), 0 0 0 1px rgba(226, 232, 240, 0.8);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(2, 132, 199, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(240, 249, 255, 0.6) 0%, transparent 100%);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 16px/1.75 "PlexThai", "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.tj-system a { text-underline-offset: 4px; transition: color 0.15s ease; color: #0284c7; }
body.tj-system a:hover { color: #0369a1; }
body.tj-system h1, body.tj-system h2, body.tj-system h3 { color: #0f172a; font-weight: 600; }
body.tj-system h1 { line-height: 1.35; letter-spacing: -0.6px; }
body.tj-system h2 { line-height: 1.45; letter-spacing: -0.3px; }
body.tj-system .small { font-size: 13px; line-height: 1.6; }
body.tj-system .hint { color: var(--dim); line-height: 1.75; font-size: 13.5px; }

/* Header: Clean Translucent Light Header with Crisp Slate Border */
body.tj-system header.top {
  min-height: 72px;
  padding: 14px max(28px, calc((100vw - 1280px)/2));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
  gap: 16px;
  color: #0f172a;
  position: sticky;
  top: 0;
  z-index: 100;
}
body.tj-system header.top::after { content: none; }
body.tj-system .logo {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: #0f172a;
  gap: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
body.tj-system .logo .mark {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.tj-system .logo .mark svg {
  width: 38px;
  height: 38px;
  filter: none;
}
body.tj-system .who {
  font-size: 13px;
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
}

body.tj-system main { max-width: 1200px; margin: 0 auto; padding: 36px 28px 64px; }

/* Cards: Pure White Crisp Surfaces with Delicate Slate Borders (IG & Stripe standard) */
body.tj-system .card {
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 8px 24px -4px rgba(15, 23, 42, 0.05);
  margin-bottom: 24px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
body.tj-system .card h2 { font-size: 21px; font-weight: 600; margin-bottom: 16px; color: #0f172a; }
body.tj-system .card h3 { color: #475569; font-size: 14px; letter-spacing: 0; text-transform: none; }

/* Buttons: Bitkub Emerald & Tactile Mobile Micro-press (Instagram & iOS standard) */
body.tj-system .btn {
  min-height: 50px;
  padding: 13px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  line-height: 1.5;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
body.tj-system .btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.38);
}
body.tj-system .btn:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}
body.tj-system .btn.small { min-height: 44px; padding: 10px 18px; font-size: 13.5px; border-radius: 999px; }
body.tj-system .btn.plain {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
body.tj-system .btn.plain:hover:not(:disabled) {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}
body.tj-system .btn.ghost {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0284c7;
  box-shadow: none;
}
body.tj-system .btn.ghost:hover:not(:disabled) { background: #e0f2fe; color: #0369a1; }
body.tj-system .btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.22);
  color: #fff;
}
body.tj-system .btn.danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.32);
}
body.tj-system .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
body.tj-system .btnrow { flex-wrap: wrap; gap: 10px; }
body.tj-system .btnrow .btn { flex: 1 1 140px; }

/* Form Controls: Crisp Light Inputs with Clear Slate Borders */
body.tj-system label { margin: 18px 0 7px; font-size: 13.5px; color: #334155; font-weight: 600; display: block; }
body.tj-system input, body.tj-system select, body.tj-system textarea {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.tj-system input::placeholder, body.tj-system textarea::placeholder { color: #94a3b8; opacity: 1; }
body.tj-system input:focus, body.tj-system select:focus, body.tj-system textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.18);
  background: #ffffff;
  outline: none;
}
body.tj-system input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0 8px 0 0; vertical-align: middle; accent-color: #0284c7; }
body.tj-system input[type=file] { padding: 12px; background: #f8fafc; border-style: dashed; border-color: #cbd5e1; min-height: 54px; color: #334155; }
body.tj-system input::file-selector-button {
  border: 0;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 8px;
  padding: 8px 14px;
  margin-right: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
body.tj-system input::file-selector-button:hover { background: #e0f2fe; }

body.tj-system .choice { gap: 10px; }
body.tj-system .choice input { min-height: 0; width: 1px; height: 1px; border: 0; padding: 0; }
body.tj-system .choice label {
  border: 1.5px solid #e2e8f0;
  padding: 13px 14px;
  min-height: 48px;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 14px;
  color: #475569;
  font-weight: 600;
  transition: all 0.18s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.tj-system .choice label:hover { border-color: #cbd5e1; color: #0f172a; background: #ffffff; }
body.tj-system .choice input:checked+label {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
  font-weight: 700;
}
body.tj-system .choice.big label { min-height: 94px; padding: 18px 14px; font-size: 16px; border-radius: 16px; flex-direction: column; }
body.tj-system .choice.big label span { margin-top: 5px; font-size: 12px; color: #64748b; }
body.tj-system .choice.big input:checked+label span { color: #e0f2fe; }

body.tj-system .bigin {
  font-size: 34px;
  font-weight: 700;
  padding-block: 13px;
  font-variant-numeric: tabular-nums;
  color: #0284c7;
}
body.tj-system .rows { border-color: #e2e8f0; margin-top: 16px; }
body.tj-system .rows>div { gap: 18px; padding: 13px 0; font-size: 14px; align-items: flex-start; border-bottom: 1px solid #f1f5f9; }
body.tj-system .rows>div>span { min-width: 0; overflow-wrap: anywhere; }
body.tj-system .rows>div>span:first-child { color: var(--dim); }
body.tj-system .rows>div>span:last-child { text-align: right; color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; }
body.tj-system .rows>div.total { font-size: 16px; border-top: 1.5px solid #e2e8f0; padding-top: 15px; border-bottom: 0; }
body.tj-system .rows>div.total>span { color: #0f172a; font-weight: 700; }
body.tj-system .rows>div.total>span:last-child { color: #0284c7; }
body.tj-system .money {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.3;
  color: #0369a1;
  letter-spacing: -1px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
body.tj-system .money small { color: #64748b; font-size: 15px; font-weight: 500; }

/* Status Tags & Pills */
body.tj-system .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 99px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.1px;
}
body.tj-system .tag.wait { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }
body.tj-system .tag.go { color: #0369a1; background: #f0f9ff; border: 1px solid #bae6fd; }
body.tj-system .tag.done { color: #0369a1; background: #f0f9ff; border: 1px solid #bae6fd; }
body.tj-system .tag.bad { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }

/* Notes / Alerts: High Readability on Clean Light Mode */
body.tj-system .note {
  font-size: 14px;
  line-height: 1.75;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
body.tj-system .note b { font-weight: 600; margin-bottom: 5px; display: block; }
body.tj-system .note.ok { color: #075985; background: #f0f9ff; border-color: #bae6fd; border-left: 5px solid #0284c7; }
body.tj-system .note.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; border-left: 5px solid #d97706; }
body.tj-system .note.bad { color: #991b1b; background: #fef2f2; border-color: #fecaca; border-left: 5px solid #dc2626; }

/* การ์ดพาไปเปิดในเบราว์เซอร์จริง (js/inapp.js) — ใช้ทั้งหน้าดีลและหน้าแรก
   ปุ่มเต็มความกว้างให้กดด้วยนิ้วโป้งง่าย · ตัวเลือกเบราว์เซอร์เฉพาะตัวเรียงสองคอลัมน์ */
body.tj-system .inapp p { margin: 8px 0 0; }
body.tj-system .inapp .btn { width: 100%; margin-top: 12px; }
body.tj-system .inapp .hint { margin-top: 6px; }
body.tj-system .inapp .inapp-or { margin-top: 16px; font-weight: 600; }
body.tj-system .inapp .inapp-steps { margin: 6px 0 0; padding-left: 22px; }
body.tj-system .inapp .inapp-steps li { margin: 4px 0; }
body.tj-system .inapp .inapp-url { width: 100%; margin-top: 10px; font-size: 13px; }
body.tj-system .inapp details.more { margin-top: 14px; }
body.tj-system .inapp .inapp-others { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
body.tj-system .inapp .inapp-others .btn { margin-top: 0; min-height: 44px; padding: 10px 8px; font-size: 14px; }
body.tj-system .formerr { font-size: 14px; color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; }

body.tj-system .accecho { display: block; margin: 7px 0 4px; font-size: 15px; font-weight: 700; color: #0284c7; font-variant-numeric: tabular-nums; }
body.tj-system label.tick { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 44px; font-size: 14px; font-weight: 500; color: #334155; cursor: pointer; }
body.tj-system label.tick input[type=checkbox] { flex: 0 0 22px; width: 22px; height: 22px; }
body.tj-system details.fold { padding: 0 24px; overflow: visible; }
body.tj-system details.fold>summary { min-height: 64px; padding: 18px 0; margin: 0; display: flex; align-items: center; gap: 14px; color: #0f172a; font-size: 15px; line-height: 1.7; font-weight: 600; list-style: none; cursor: pointer; }
body.tj-system details.fold>summary::-webkit-details-marker { display: none; }
body.tj-system details.fold>summary::after { content: '+'; margin-left: auto; font-size: 22px; color: #64748b; font-weight: 400; flex-shrink: 0; }
body.tj-system details.fold[open]>summary { border-bottom: 1px solid #e2e8f0; margin-bottom: 18px; }
body.tj-system details.fold[open]>summary::after { content: '−'; }
body.tj-system details.fold[open] { padding-bottom: 24px; }
body.tj-system details.more { border: 1px solid #e2e8f0; border-radius: 12px; padding: 0 18px; background: #f8fafc; }
body.tj-system details.more>summary { padding: 15px 0; font-size: 14px; cursor: pointer; color: #475569; }
body.tj-system details.more[open] { padding-bottom: 16px; }

/* Steps / Timeline (5-stage Deal tracker - Modern Fintech Style) */
body.tj-system .steps { padding: 12px 0 6px; margin: 0; list-style: none; }
body.tj-system .steps li {
  position: relative;
  font-size: 14.5px;
  color: #64748b;
  padding: 0 0 24px 34px;
  border-left: 2px solid #e2e8f0;
  margin-left: 10px;
  transition: all 0.2s ease;
}
body.tj-system .steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
body.tj-system .steps li::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #cbd5e1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
body.tj-system .steps li.done { color: #0f172a; font-weight: 500; border-left-color: #0ea5e9; }
body.tj-system .steps li.done::before {
  content: '✓';
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  background: #0ea5e9;
  border-color: #0ea5e9;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.35);
}
body.tj-system .steps li.now { color: #0284c7; font-weight: 700; border-left-color: #e2e8f0; }
body.tj-system .steps li.now::before {
  background: #0284c7;
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25);
  animation: tjStepPulse 2s infinite ease-in-out;
}
@keyframes tjStepPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25); }
  50% { box-shadow: 0 0 0 7px rgba(2, 132, 199, 0.1); }
}
body.tj-system .steps li .when { font-size: 12px; color: #64748b; margin-top: 3px; font-weight: 400; }

/* QR Code & Payment */
body.tj-system .qrbox {
  border-radius: 20px;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  padding: 28px;
  background: #ffffff;
  color: #0f172a;
  text-align: center;
}
body.tj-system .qrbox svg {
  border-radius: 14px;
  padding: 8px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  border: 1px solid #f1f5f9;
}

/* My Deals Cards (Billbau & Fintech Feed Clarity) */
body.tj-system .deal {
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  background: #ffffff;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
body.tj-system .deal:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
body.tj-system .deal .line1 { align-items: flex-start; gap: 12px; }
body.tj-system .deal .t { color: #0f172a; font-size: 16px; font-weight: 600; }
body.tj-system .deal .m { color: #64748b; font-size: 12.5px; }
body.tj-system .deal .act { color: #475569; font-size: 13.5px; font-weight: 500; }
body.tj-system .deal.turn {
  border-left: 5px solid #0ea5e9;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-color: #bae6fd;
  box-shadow: 0 4px 16px -2px rgba(2, 132, 199, 0.12);
}
body.tj-system .deal.turn .act { color: #0284c7; font-weight: 700; }

/* ❌ ปุ่มยกเลิกดีลบนการ์ดประวัติดีล (บอสสั่ง 15 ต.ค. 2569 — ใบงาน 039) */
body.tj-system .deal .deal-cancel-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}
body.tj-system .btn-cancel-deal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.05);
}
body.tj-system .btn-cancel-deal:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.12);
}
body.tj-system .btn-cancel-deal:active {
  transform: translateY(0);
}
body.tj-system .btn-cancel-deal:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
body.tj-system .chips { gap: 8px; }
body.tj-system .chip {
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.tj-system .chip:hover { border-color: #94a3b8; color: #0f172a; background: #f8fafc; }
body.tj-system .chip:active { transform: scale(0.97); }
body.tj-system .chip.on {
  background: #f0f9ff;
  border-color: #0ea5e9;
  color: #0284c7;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

/* Tables */
body.tj-system .rowtable { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 16px; background: #ffffff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03); }
body.tj-system .rowtable table { width: 100%; border-collapse: collapse; font-size: 13px; }
body.tj-system .rowtable th { padding: 14px 18px; background: #f8fafc; color: #475569; font-weight: 600; text-align: left; border-bottom: 1px solid #e2e8f0; }
body.tj-system .rowtable td { padding: 16px 18px; border-bottom: 1px solid #f1f5f9; font-variant-numeric: tabular-nums; color: #334155; }
body.tj-system .rowtable tr:last-child td { border-bottom: 0; }
body.tj-system .rowtable tr:hover td { background: #f8fafc; }

body.tj-system .backrow { margin: 0 0 24px; }
body.tj-system .back { min-height: 44px; color: #64748b; font-size: 13px; font-weight: 500; text-decoration: none; }
body.tj-system .back:hover { color: #0284c7; }
body.tj-system footer {
  padding: 36px 24px max(44px, env(safe-area-inset-bottom));
  background: #ffffff;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
}
body.tj-system .footbrand { color: #0f172a; font-size: 22px; font-weight: 700; }
body.tj-system .footbrand .mark { width: 28px; height: 28px; border-radius: 0; background: transparent; box-shadow: none; }
body.tj-system .footbrand .mark svg { width: 28px; height: 28px; }
body.tj-system :focus-visible { outline: 2px solid #0284c7; outline-offset: 3px; }
body.tj-system .btn:focus-visible { outline: 2px solid #0284c7; outline-offset: 3px; box-shadow: 0 0 0 3px #f8fafc; }
body.tj-system .choice input:focus-visible+label { outline: 2px solid #0284c7; outline-offset: 3px; }
body.tj-system [id] { scroll-margin-top: 104px; }

/* ---------- Deal Room (tj-deal) ---------- */
body.tj-deal main { max-width: 1180px; }
body.tj-deal #dealBody { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .8fr); gap: 20px 24px; align-items: start; }
body.tj-deal .deal-primary, body.tj-deal .deal-aside { min-width: 0; }
body.tj-deal .deal-aside { display: grid; gap: 18px; }
body.tj-deal .deal-aside>.card, body.tj-deal .deal-primary>.card { margin-bottom: 0; }

body.tj-deal .deal-action {
  padding: 32px;
  border-top: 4px solid #0284c7;
  border-radius: 20px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
  background: #ffffff;
}
body.tj-deal .deal-title { font-size: 26px; margin: 0; line-height: 1.45; font-weight: 700; color: #0f172a; }
body.tj-deal .deal-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 22px;
}
body.tj-deal .deal-meta>div { min-width: 0; }
body.tj-deal .deal-meta .tag { flex-shrink: 0; margin-top: 4px; }
body.tj-deal #dCode { color: #64748b; font-variant-numeric: tabular-nums; font-weight: 600; }
body.tj-deal #whatNow>h2 { font-size: 21px; margin: 18px 0 12px; font-weight: 600; color: #0f172a; }
body.tj-deal #whatNow>.money { margin: 20px 0 12px; }
body.tj-deal #whatNow .hero, body.tj-deal #whatNow .card { box-shadow: none; }

/* ---------- Deal Completed Grand Hero & Cards (บอสสั่ง 16 ก.ย. 2569) ---------- */
body.tj-deal .deal-completed-hero {
  margin: 10px 0 24px;
  padding: 36px 28px 32px;
  background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 55%, #bae6fd 100%);
  border: 2px solid #bae6fd;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 14px 34px -10px rgba(2, 132, 199, 0.16);
  position: relative;
  overflow: hidden;
}
body.tj-deal .deal-completed-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  pointer-events: none;
}
body.tj-deal .deal-completed-badge-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 25px -4px rgba(2, 132, 199, 0.38);
}
body.tj-deal .deal-completed-badge-icon svg {
  width: 38px;
  height: 38px;
}
body.tj-deal .deal-completed-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  border: 1px solid #bae6fd;
}
body.tj-deal .deal-completed-title {
  font-size: clamp(24px, 3.2vw, 30px);
  font-weight: 800;
  color: #0c4a6e;
  margin: 0 0 8px;
  line-height: 1.35;
  letter-spacing: -0.5px;
}
body.tj-deal .deal-completed-subtitle {
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 700;
  color: #0284c7;
  margin: 0 0 12px;
  line-height: 1.5;
}
body.tj-deal .deal-completed-desc {
  font-size: 14px;
  color: #334155;
  margin: 0 auto;
  max-width: 520px;
  line-height: 1.7;
}
body.tj-deal .deal-completed-summary-card {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: 16px;
  padding: 22px 24px;
  margin-top: 18px;
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.04);
}
body.tj-deal .deal-completed-summary-head,
body.tj-deal .deal-completed-payout-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f9ff;
}
body.tj-deal .deal-completed-summary-title {
  font-weight: 700;
  font-size: 16px;
  color: #0c4a6e;
}
body.tj-deal .deal-completed-payout-box {
  margin-top: 18px;
  border-radius: 16px;
  padding: 22px 24px;
  border: 1.5px solid #bae6fd;
  border-left: 6px solid #0284c7;
}
body.tj-deal .ok-text {
  color: #0284c7;
  font-weight: 700;
}

/* Deal Summary Money Card: High-trust Clean Vault Card */
body.tj-deal #dMoney {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  color: #0f172a;
  padding: 30px;
  border-radius: 22px;
  box-shadow: 0 10px 30px -5px rgba(2, 132, 199, 0.08);
}
body.tj-deal #dMoney h2 { color: #0c4a6e; font-size: 19px; font-weight: 700; margin-bottom: 12px; }
body.tj-deal #dMoney .rows { border-color: #e2e8f0; margin-top: 18px; }
body.tj-deal #dMoney .rows>div { border-color: #f1f5f9; font-size: 13.5px; padding: 12px 0; }
body.tj-deal #dMoney .rows>div>span:first-child { color: #64748b; }
body.tj-deal #dMoney .rows>div>span:last-child { color: #0f172a; font-weight: 600; }
body.tj-deal #dMoney .rows>div.total { border-color: #bae6fd; font-size: 16.5px; padding-top: 16px; }
body.tj-deal #dMoney .rows>div.total>span:last-child { color: #0369a1; }
body.tj-deal #dMoney .hint, body.tj-deal #dMoney .dim { color: #64748b; }
body.tj-deal #dMoney .money {
  color: #0369a1;
  font-weight: 800;
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -1px;
}
body.tj-deal #dMoney .money small { color: #64748b; font-weight: 400; font-size: 16px; margin-left: 6px; }
body.tj-deal #dealBody>details { grid-column: 2; }
body.tj-deal #dTrouble>summary, body.tj-deal #dCancel>summary { color: #dc2626; font-weight: 500; }
body.tj-deal #dParties .rows { margin-top: 12px; }
body.tj-deal #needAuth, body.tj-deal #inviteCard, body.tj-deal #notFound { max-width: 680px; margin: 24px auto; }
body.tj-deal #needAuth { padding: 40px; border-top: 4px solid #0284c7; border-radius: 20px; background: #ffffff; }
body.tj-deal .trust-lock { display: inline-flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; padding-bottom: 15px; }
body.tj-deal .trust-lock svg { width: 18px; height: 18px; color: #0284c7; }

/* Info / Reading pages */
body.tj-info main { max-width: 1120px; }
body.tj-info .info-head { padding: 24px 0 36px; margin: 0; border-bottom: 1px solid #e2e8f0; }
body.tj-info .info-head h1 { font-size: 40px; margin: 0 0 12px; font-weight: 700; color: #0f172a; }
body.tj-info .info-head p { max-width: 670px; color: #475569; font-size: 15px; margin: 0; line-height: 1.9; }
body.tj-info .info-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 44px; padding-top: 32px; align-items: start; }
body.tj-info .info-side { position: sticky; top: 106px; }
body.tj-info .info-side nav { display: grid; gap: 6px; }
body.tj-info .info-side a { display: block; padding: 11px 14px; border-radius: 10px; font-size: 14px; min-height: 44px; text-decoration: none; color: #475569; transition: all 0.15s ease; }
body.tj-info .info-side a:hover, body.tj-info .info-side a[aria-current] { background: #ecfdf5; color: #047857; font-weight: 600; }
body.tj-info .info-side p { margin: 22px 14px 0; font-size: 12px; line-height: 1.8; color: #94a3b8; }
body.tj-info .info-content { min-width: 0; }
body.tj-info .info-content .card { padding: 28px 30px; }
body.tj-info .info-content details.fold { padding: 0 28px; }
body.tj-info .info-content details.fold[open] { padding-bottom: 26px; }
body.tj-info .info-content details.fold>summary { font-size: 16px; min-height: 70px; color: #0f172a; }
body.tj-info .info-content p, body.tj-info .info-content li { font-size: 14px; line-height: 1.9; color: #334155; }
body.tj-info .info-content li { margin: 10px 0; padding-left: 4px; }
body.tj-info .info-content .note { font-size: 14px; }
body.tj-info .info-content .rows>div { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.4fr); font-size: 14px; }
body.tj-info .info-content .rows>div>span:last-child { text-align: left; font-weight: 500; color: #0f172a; }
body.tj-info .info-content #contactBox .btn { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 180px; }
body.tj-info .contact-steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
body.tj-info .contact-steps span { flex: 1 1 120px; padding: 14px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; color: #334155; font-size: 13px; font-weight: 500; }
body.tj-info .category-hero { display: flex; align-items: center; gap: 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px 20px; margin-bottom: 20px; }
body.tj-info .category-img { width: 68px; height: 68px; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.05)); }
body.tj-info .category-sub { margin: 6px 0 0; font-size: 13.5px; color: #475569; line-height: 1.6; }
body.tj-info details.fold>summary .summary-icon { width: 28px; height: 28px; vertical-align: middle; margin-right: 10px; display: inline-block; }

/* Payment Instructions */
body.tj-deal .payment-intro { text-align: center; margin: 0; }
body.tj-deal .payment-intro b { display: block; font-size: 15px; color: #0f172a; }
body.tj-deal .payment-intro span { display: block; font-size: 12px; color: #64748b; margin-top: 5px; }
body.tj-deal .payment-method { padding: 14px 0; margin: 0; text-align: center; }
body.tj-deal .payment-method b { display: block; color: #0f172a; font-size: 15px; }
body.tj-deal .payment-method span { display: block; color: #64748b; font-size: 12px; }
body.tj-deal .qrbox { padding: 24px; max-width: 320px; margin: 0 auto; border-radius: 20px; }
body.tj-deal .qrbox>svg { width: 210px; height: 210px; max-width: 100%; }
body.tj-deal .payment-caption { font-size: 12px; color: #64748b; line-height: 1.8; text-align: center; margin: 14px auto; max-width: 310px; }
body.tj-deal .payment-help { padding: 0; border: 0; margin: 12px 0 18px; background: none; }
body.tj-deal .payment-help summary { min-height: 44px; display: flex; align-items: center; color: #059669; font-size: 13px; font-weight: 500; cursor: pointer; }
body.tj-deal .payment-help summary::after { content: '+'; margin-left: auto; }
body.tj-deal .payment-help[open] summary::after { content: '−'; }
body.tj-deal .payment-help p { padding: 0 0 12px; margin: 0; font-size: 13px; color: #475569; }
body.tj-system ol.terms { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 12px; line-height: 1.7; color: #334155; }
body.tj-system ol.terms li { padding-left: 2px; }

/* ==========================================================================
   TrustJai Modern Chat Room (Clean Tone: White & Trust Blue #0284c7)
   ========================================================================== */
body.tj-deal .chat-card {
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

/* 🚀 หน้าต่างแชท Pop-up เด้งลอยมุมจอ (บอสสั่ง 19 ก.ย. 2569: เด้งขึ้นมาหลังเปิดดีล เหมือน LINE/Facebook คุย 3 ฝ่าย) */
body.tj-deal .chat-card.chat-popup-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(2, 132, 199, 0.22);
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(2, 132, 199, 0.12);
  animation: chatPopBounce 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
  margin: 0;
  overflow: hidden;
  padding: 0;
}
body.tj-deal .chat-popup-dock .chat-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
body.tj-deal .chat-popup-dock .chat-list {
  flex: 1 1 auto;
  min-height: 80px;
  max-height: min(340px, 42vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

body.tj-deal .chat-card.chat-popup-dock.is-minimized {
  height: auto !important;
  max-height: 52px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.18) !important;
}
body.tj-deal .chat-card.chat-popup-dock.is-minimized > *:not(summary) {
  display: none !important;
}
body.tj-deal .chat-card.chat-popup-dock.is-minimized > summary {
  border-bottom: 0 !important;
}

body.tj-deal .chat-card > summary {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
  list-style: none;
  flex-shrink: 0;
}
body.tj-deal .chat-card > summary::-webkit-details-marker {
  display: none;
}
body.tj-deal .chat-card > summary::after {
  display: none !important;
  content: none !important;
}
body.tj-deal .chat-title-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
body.tj-deal .chat-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0284c7;
  flex-shrink: 0;
}
body.tj-deal .chat-title-icon svg {
  width: 16px;
  height: 16px;
}
body.tj-deal .chat-title-text {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}
body.tj-deal .chat-parties-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
body.tj-deal .chat-proof {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  background: #f1f5f9;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
}
body.tj-deal .chat-popup-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
body.tj-deal .btn-chat-fold,
body.tj-deal #btnChatFold {
  display: none !important;
}
body.tj-deal .btn-chat-ctrl {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}
body.tj-deal .btn-chat-ctrl:hover {
  background: #e2e8f0;
  color: #0f172a;
}
body.tj-deal .btn-chat-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* 💬 ปุ่มลอยเปิดแชทมุมขวาล่าง (Floating Chat FAB) */
body.tj-deal .deal-chat-fab-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
}
body.tj-deal .btn-chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 60%, #0369a1 100%);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 24px -2px rgba(2, 132, 199, 0.45), 0 2px 8px rgba(2, 132, 199, 0.2);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  position: relative;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
body.tj-deal .btn-chat-fab .chat-fab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #22c55e;
  flex-shrink: 0;
}
body.tj-deal .btn-chat-fab:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px -2px rgba(2, 132, 199, 0.55), 0 4px 12px rgba(2, 132, 199, 0.3);
}
body.tj-deal .btn-chat-fab:active {
  transform: translateY(1px) scale(0.98);
}
body.tj-deal .btn-chat-fab .chat-fab-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid #38bdf8;
  opacity: 0.6;
  pointer-events: none;
  animation: chatFabPulseAnim 2.4s infinite cubic-bezier(0.24, 0, 0.38, 1);
}
@keyframes chatFabPulseAnim {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}
body.tj-deal .btn-chat-fab .chat-fab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: #ef4444;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* รองรับจอขนาดมือถือ */
@media (max-width: 640px) {
  body.tj-deal .chat-card.chat-popup-dock,
  html body.tj-deal #dChat.chat-popup-dock {
    left: 8px !important;
    right: 8px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: 20px !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  body.tj-deal .chat-card.chat-popup-dock .chat-list {
    max-height: 38vh;
    max-height: 38dvh;
  }
  body.tj-deal .deal-chat-fab-wrap {
    right: 16px;
    bottom: 18px;
  }
  body.tj-deal .btn-chat-fab {
    padding: 10px 16px;
    font-size: 13.5px;
  }
}
body.tj-deal .chat-notice {
  margin: 0;
  padding: 5px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
  text-align: center;
  flex-shrink: 0;
}
body.tj-deal .chat-list {
  background: #f8fafc;
  min-height: 80px;
  max-height: min(340px, 42vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  margin: 0;
  border: none;
}
body.tj-deal .chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  margin: auto;
  text-align: center;
  border: none;
  background: transparent;
}
body.tj-deal .chat-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.8;
}
body.tj-deal .chat-empty p {
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  margin: 0;
}
body.tj-deal .chat-message {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  word-break: break-word;
  animation: chatMsgFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes chatMsgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
body.tj-deal .chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
  padding: 0 4px;
}
body.tj-deal .chat-msg-who {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}
body.tj-deal .chat-msg-time {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}
body.tj-deal .chat-bubble {
  position: relative;
  padding: 9px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
body.tj-deal .chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

/* 1. Outgoing Messages (Right Side - Trust Blue #0284c7) */
body.tj-deal .chat-message.chat-mine {
  align-self: flex-end;
  align-items: flex-end;
}
body.tj-deal .chat-message.chat-mine .chat-msg-header {
  flex-direction: row-reverse;
}
body.tj-deal .chat-message.chat-mine .chat-msg-who {
  color: #0284c7;
}
body.tj-deal .chat-message.chat-mine .chat-bubble {
  background: #0284c7;
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px -1px rgba(2, 132, 199, 0.3);
}
body.tj-deal .chat-message.chat-mine .chat-bubble p {
  color: #ffffff;
}

/* 2. Peer Incoming Messages (Left Side - Clean White Slate Card) */
body.tj-deal .chat-message.chat-peer {
  align-self: flex-start;
  align-items: flex-start;
}
body.tj-deal .chat-message.chat-peer .chat-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 18px 18px 18px 4px;
}
body.tj-deal .chat-message.chat-peer .chat-bubble p {
  color: #1e293b;
}

/* 3. Escrow Midman / System Messages (Centered Shield Notice) */
body.tj-deal .chat-message.chat-midman {
  align-self: center;
  align-items: center;
  max-width: 90%;
  margin: 6px auto;
}
body.tj-deal .chat-message.chat-midman .chat-msg-header {
  justify-content: center;
  margin-bottom: 4px;
}
body.tj-deal .chat-message.chat-midman .chat-msg-who {
  color: #166534;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  padding: 2px 10px;
  border-radius: 99px;
  border: 1px solid #bbf7d0;
}
body.tj-deal .chat-message.chat-midman .chat-bubble {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 16px;
  color: #14532d;
  text-align: center;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.08);
}
body.tj-deal .chat-message.chat-midman .chat-bubble p {
  color: #14532d;
  font-weight: 500;
}

/* Composer Bar */
body.tj-deal .chat-input-label,
body.tj-deal .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
body.tj-deal .chat-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 8px !important;
  padding: 10px 14px !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}
body.tj-deal .chat-bar textarea {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 44px !important;
  max-height: 120px !important;
  padding: 10px 14px !important;
  margin: 0 !important;
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 20px !important;
  color: #0f172a !important;
  font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 16px !important;
  resize: none !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
}
body.tj-deal .chat-bar textarea:focus {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}
body.tj-deal .chat-bar textarea::placeholder {
  color: #94a3b8 !important;
  font-size: 14px;
}
body.tj-deal .chat-send-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 68px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  margin: 0 !important;
  border-radius: 22px !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28) !important;
  cursor: pointer !important;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease !important;
}
body.tj-deal .chat-send-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.38) !important;
  transform: translateY(-1px) !important;
}
body.tj-deal .chat-send-btn:active:not(:disabled) {
  transform: translateY(1px) !important;
}
body.tj-deal .chat-send-btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
body.tj-deal .chat-send-btn::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='22' y1='2' x2='11' y2='13'%3E%3C/line%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'%3E%3C/polygon%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='22' y1='2' x2='11' y2='13'%3E%3C/line%3E%3Cpolygon points='22 2 15 22 11 13 2 9 22 2'%3E%3C/polygon%3E%3C/svg%3E") no-repeat center / contain;
}

/* Chat Meta Information */
body.tj-deal .chat-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 10px;
  background: #ffffff;
  font-size: 11.5px;
  color: #94a3b8;
  flex-shrink: 0;
}
body.tj-deal .chat-shortcut {
  color: #94a3b8;
}
@media (hover: none) {
  body.tj-deal .chat-shortcut {
    display: none !important;
  }
}
body.tj-deal .chat-limit {
  margin-left: auto;
  color: #94a3b8;
}
body.tj-deal #chatWarning {
  margin: 0 16px 10px;
  border-radius: 12px;
  flex-shrink: 0;
}
body.tj-deal #chatMsg {
  margin: 0 16px 10px;
  flex-shrink: 0;
}

/* Override liquid-glass.css: ป้องกันการ์ดเงาซ้อนข้างหลังเป็นสองใบ */
html body.tj-deal .chat-card.chat-popup-dock,
html body.tj-deal #dChat.chat-popup-dock {
  background: #ffffff !important;
  border: 1px solid rgba(2, 132, 199, 0.22) !important;
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(2, 132, 199, 0.12) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  border-radius: 22px !important;
  transition: none !important;
}
html body.tj-deal .chat-card.chat-popup-dock:hover,
html body.tj-deal #dChat.chat-popup-dock:hover {
  transform: none !important;
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(2, 132, 199, 0.12) !important;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  body.tj-system header.top { padding-inline: 20px; }
  body.tj-system main { padding-inline: 20px; }
  body.tj-deal #dealBody { grid-template-columns: minmax(0, 1fr); }
  body.tj-deal .deal-action, body.tj-deal #dealBody>details { grid-column: 1; grid-row: auto; }
  body.tj-info .info-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 600px) {
  body.tj-system { font-size: 15px; }
  body.tj-system header.top { min-height: 68px; padding: 12px 18px; gap: 10px; }
  body.tj-system .logo { font-size: 22px; }
  body.tj-system .logo .mark { width: 32px; height: 32px; border-radius: 0; background: transparent; box-shadow: none; }
  body.tj-system .logo .mark svg { width: 32px; height: 32px; }
  body.tj-system .who { max-width: 120px; font-size: 11px; }
  body.tj-system main { padding: 20px 16px 48px; }
  body.tj-system .card { padding: 22px 18px; border-radius: 18px; margin-bottom: 16px; }
  body.tj-system .card h2 { font-size: 19px; }
  body.tj-system .rows>div { gap: 12px; font-size: 13px; }
  body.tj-system .rows>div.total { font-size: 14px; }
  body.tj-system .btnrow .btn { flex-basis: 110px; }
  body.tj-system .choice.big { gap: 8px; }
  body.tj-system .choice.big label { padding: 15px 8px; font-size: 15px; }
  body.tj-system .choice.big label span { font-size: 11px; }
  body.tj-system details.fold { padding-inline: 18px; }
  body.tj-system details.fold[open] { padding-bottom: 20px; }
  body.tj-system details.fold>summary { font-size: 14px; min-height: 60px; }
  body.tj-system .note { font-size: 13px; padding: 14px 15px; }
  body.tj-system .deal { padding: 18px 16px; }
  body.tj-system .rowtable th, body.tj-system .rowtable td { padding: 12px; }
  body.tj-deal .deal-title { font-size: 22px; }
  body.tj-deal .deal-meta { flex-wrap: wrap; }
  body.tj-deal #dMoney { padding: 24px 20px; }
  body.tj-deal #needAuth { padding: 26px 20px; }
  body.tj-info .info-head { padding: 12px 0 26px; }
  body.tj-info .info-head h1 { font-size: 30px; }
  body.tj-info .info-head p { font-size: 14px; }
  body.tj-info .info-layout { display: block; padding-top: 18px; }
  body.tj-info .info-side { position: static; margin-bottom: 22px; }
  body.tj-info .info-side nav { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 5px; }
  body.tj-info .info-side a { white-space: nowrap; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; padding: 10px 14px; color: #475569; }
  body.tj-info .info-side p { display: none; }
  body.tj-info .info-content .card { padding: 22px 18px; }
  body.tj-info .info-content details.fold { padding: 0 18px; }
  body.tj-info .info-content details.fold[open] { padding-bottom: 22px; }
  body.tj-info .info-content details.fold>summary { font-size: 15px; }
  body.tj-info .info-content .rows>div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ---------- หลังบ้าน: ค้นหาอัจฉริยะ ดีล ผู้ใช้ แชท และประวัติธุรกรรม (13 ก.ย. 2569 บอสสั่งเอง) ---------- */
body.tj-admin .ws-smart-search {
  border: 1px solid #D2E3D8;
  background: #FAFDFB;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(27, 56, 40, 0.04);
}
body.tj-admin .ws-search-head {
  margin-bottom: 14px;
}
body.tj-admin .ws-search-title {
  font-size: 17px;
  font-weight: 700;
  color: #1B3828;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.tj-admin .ws-search-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
body.tj-admin .chip-btn {
  background: #EAF4EE;
  border: 1px solid #CFE2D6;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 14px;
  color: #1E4620;
  cursor: pointer;
  transition: all 0.2s ease;
}
body.tj-admin .chip-btn:hover {
  background: #1B8A44;
  color: #ffffff;
  border-color: #1B8A44;
}

/* บัตรสรุปประวัติธุรกรรม */
body.tj-admin .tx-summary-card {
  background: #FFFFFF;
  border: 1px solid #D2E3D8;
  border-radius: 14px;
  padding: 18px 20px;
  margin: 18px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
body.tj-admin .tx-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
body.tj-admin .tx-summary-icon {
  font-size: 24px;
  line-height: 1;
}
body.tj-admin .tx-summary-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #14243A;
}
body.tj-admin .tx-summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
body.tj-admin .tx-stat-box {
  background: #F8FAF9;
  border: 1px solid #E1EBE4;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
body.tj-admin .tx-stat-val {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #14243A;
  line-height: 1.3;
}
body.tj-admin .tx-stat-lbl {
  font-size: 11.5px;
  color: #64728A;
}
body.tj-admin .tx-success .tx-stat-val { color: #1B8A44; }
body.tj-admin .tx-wait .tx-stat-val { color: #B5740C; }
body.tj-admin .tx-bad .tx-stat-val { color: #C02626; }
body.tj-admin .tx-highlight {
  background: #EAF7EE;
  border-color: #A9D7B7;
}
body.tj-admin .tx-highlight .tx-stat-val {
  color: #1B5E20;
}
body.tj-admin .tx-summary-details {
  padding-top: 12px;
  border-top: 1px dashed #DFE6F1;
  font-size: 13px;
  color: #344A69;
  display: grid;
  gap: 6px;
}

/* การ์ดผลค้นหาดีล */
body.tj-admin .ws-search-deal-card {
  background: #FFFFFF;
  border: 1px solid #DFE6F1;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
body.tj-admin .deal-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
body.tj-admin .deal-parties-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: #344A69;
  background: #F8FAFC;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #EEF2F6;
}
body.tj-admin .deal-chat-hit {
  margin-top: 8px;
  font-size: 12px;
  color: #854D0E;
  background: #FEF9C3;
  border: 1px solid #FDE047;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
}

/* กล่องแชทภายในผลค้นหาหลังบ้าน */
body.tj-admin .admin-deal-chat-box {
  margin-top: 14px;
  background: #F8FAF9;
  border: 1px solid #CFE2D6;
  border-radius: 14px;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
body.tj-admin .admin-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #1B3828;
  padding-bottom: 10px;
  border-bottom: 1px solid #E2ECE5;
  margin-bottom: 12px;
}
body.tj-admin .admin-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
body.tj-admin .admin-chat-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
body.tj-admin .admin-chat-row.buyer {
  align-self: flex-start;
}
body.tj-admin .admin-chat-row.seller {
  align-self: flex-end;
}
body.tj-admin .admin-chat-row.midman {
  align-self: center;
  max-width: 92%;
  width: 100%;
}
body.tj-admin .admin-chat-sender {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 3px;
}
body.tj-admin .admin-chat-row.buyer .admin-chat-sender {
  color: #344A69;
}
body.tj-admin .admin-chat-row.seller .admin-chat-sender {
  color: #1B5E20;
  text-align: right;
}
body.tj-admin .admin-chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
body.tj-admin .admin-chat-row.buyer .admin-chat-bubble {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
body.tj-admin .admin-chat-row.seller .admin-chat-bubble {
  background: #DCF8C6;
  border: 1px solid #C5E1A5;
  color: #0F172A;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
body.tj-admin .admin-midman-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
}
body.tj-admin .admin-midman-badge {
  display: inline-block;
  background: #D97706;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
body.tj-admin .admin-midman-text {
  font-size: 13.5px;
  color: #78350F;
  white-space: pre-wrap;
}
body.tj-admin .admin-chat-time {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 3px;
}
body.tj-admin .admin-chat-row.seller .admin-chat-time {
  text-align: right;
}
body.tj-admin .admin-chat-empty {
  text-align: center;
  padding: 20px;
  color: #94A3B8;
  font-size: 13px;
}
body.tj-admin .search-hl {
  background: #FDE047;
  color: #000000;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

/* App Share Buttons & Icons (บอสสั่งเพิ่มโลโก้จริง 14 ก.ย. 2569) */
body.tj-system .shapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
body.tj-system .shapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
body.tj-system .shapp svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: unset;
}

/* ========================================================
   INVITE CARD REDESIGN (บอสสั่งเอง 15 ก.ย. 2569)
   1. ส่วนคัดลอกลิงก์โชว์ก่อนเป็นเด่นๆ (Hero Action)
   2. ส่วนส่งผ่านแอปแชทรองลงมา ไม่รกตา แต่มีไอคอนครบทั้ง 8 แอป
   ======================================================== */

/* ส่วนคัดลอกลิงก์ (Hero Copy Box) */
body.tj-system .invite-hero-copy {
  margin: 16px 18px 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.tj-system .invite-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

body.tj-system .invite-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #059669;
  color: #ffffff;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.tj-system .invite-hero-hint {
  color: #166534;
  font-size: 13px;
  font-weight: 600;
}

/* ช่องแสดง URL พร้อมปุ่มคัดลอกเฉพาะลิงก์ */
body.tj-system .invite-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  background: #ffffff;
  border: 1.5px solid #d1fae5;
  border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

body.tj-system .invite-link-icon {
  display: inline-flex;
  align-items: center;
  color: #059669;
  flex: 0 0 auto;
}

body.tj-system .invite-link-icon svg {
  width: 18px;
  height: 18px;
}

body.tj-system .invite-url-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 6px 0;
  outline: none;
  text-overflow: ellipsis;
}

body.tj-system .invite-link-box .inv-link-quick {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 4px 12px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  color: #065f46;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

body.tj-system .invite-link-box .inv-link-quick:hover {
  background: #dcfce7;
  border-color: #4ade80;
  color: #047857;
}

/* ปุ่มหลักเด่นชัด: คัดลอกข้อความพร้อมลิงก์ */
body.tj-system .inv-copytext {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body.tj-system .inv-copytext:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.42);
}

body.tj-system .inv-copytext:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

body.tj-system .inv-copy-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

/* ส่วนส่งผ่านแอปแชท (รองลงมา ไม่ต้องเด่นมาก แต่มีไอคอนครบ) */
body.tj-system .invite-apps-section {
  padding: 0 18px 16px;
}

body.tj-system .invite-step-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.tj-system .invite-step-sub::before,
body.tj-system .invite-step-sub::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: #e2e8f0;
}

/* Grid ของปุ่มแอป 8 ตัว */
body.tj-system .shareapps-all {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  body.tj-system .shareapps-all {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ปุ่มแอปแต่ละตัว — เรียบร้อย สบายตา นุ่มนวล ไม่แข่งกับปุ่มคัดลอก */
body.tj-system .shareapps-all .shapp {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.16s ease;
}

body.tj-system .shareapps-all .shapp:hover {
  border-color: var(--app);
  background: color-mix(in srgb, var(--app) 6%, #ffffff);
  color: #0f172a;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

body.tj-system .shareapps-all .shapp svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

body.tj-system .shareapps-all .shapp span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ปุ่มแชร์ของเครื่อง */
body.tj-system .invite-apps-section .invite-more {
  border-top: 1px dashed #e2e8f0;
  padding-top: 6px;
}

body.tj-system .invite-apps-section .invite-more summary {
  color: #64748b;
  font-size: 12px;
  padding: 8px 4px;
}

@media (max-width: 480px) {
  body.tj-system .invite-hero-copy {
    margin: 12px 14px 10px;
    padding: 14px 14px;
    border-radius: 14px;
  }
  body.tj-system .invite-apps-section {
    padding: 0 14px 14px;
  }
  body.tj-system .invite-link-box {
    flex-wrap: wrap;
    padding: 8px 10px;
  }
  body.tj-system .invite-link-box .inv-link-quick {
    width: 100%;
    margin-top: 4px;
  }
}

/* Bank Visual Quick-Select & Chosen Badge (บอสสั่งเพิ่มไอคอนธนาคาร 14 ก.ย. 2569) */
body.tj-system .bank-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 10px;
}
@media (max-width: 540px) {
  body.tj-system .bank-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
body.tj-system .bank-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  color: #1e293b;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}
body.tj-system .bank-pill:hover {
  border-color: #94a3b8;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
body.tj-system .bank-pill.selected {
  border-color: var(--pill-color, #15803d);
  background: var(--pill-bg, #f0fdf4);
  box-shadow: 0 0 0 1.5px var(--pill-color, #15803d), 0 4px 12px rgba(0, 0, 0, 0.08);
}
body.tj-system .bank-pill svg,
body.tj-system .bank-pill img {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Custom Bank Selector with SVG Logos (บอสสั่งเพิ่มโลโก้ทุกธนาคาร 16 ก.ย. 2569) */
body.tj-system select.bank-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

body.tj-system .bank-custom-picker {
  position: relative;
  margin-top: 4px;
  margin-bottom: 6px;
  width: 100%;
}

body.tj-system .bank-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.16s ease;
  box-sizing: border-box;
  text-align: left;
}
body.tj-system .bank-picker-trigger:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
body.tj-system .bank-picker-trigger:focus,
body.tj-system .bank-picker-trigger[aria-expanded="true"] {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

body.tj-system .bank-picker-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}
body.tj-system .bank-picker-empty-icon {
  font-size: 18px;
  opacity: 0.7;
}
body.tj-system .bank-picker-text {
  color: #64748b;
  font-weight: 500;
}
body.tj-system .bank-picker-name {
  font-weight: 700;
  font-size: 14px;
}
body.tj-system .bank-code-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}
body.tj-system .bank-picker-arrow {
  font-size: 11px;
  color: #94a3b8;
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}
body.tj-system .bank-picker-trigger[aria-expanded="true"] .bank-picker-arrow {
  transform: rotate(180deg);
}

body.tj-system .bank-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 100;
  overflow: hidden;
  animation: bankMenuFade 0.15s ease-out;
}
@keyframes bankMenuFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

body.tj-system .bank-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
body.tj-system .bank-picker-search-icon {
  font-size: 14px;
  opacity: 0.6;
}
body.tj-system .bank-picker-search-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 4px 0 !important;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
  box-shadow: none !important;
  outline: none !important;
  margin: 0 !important;
}
body.tj-system .bank-picker-search-input::placeholder {
  color: #94a3b8;
}

body.tj-system .bank-picker-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 0;
}
body.tj-system .bank-picker-list::-webkit-scrollbar {
  width: 6px;
}
body.tj-system .bank-picker-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

body.tj-system .bank-picker-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 6px 14px 2px;
  letter-spacing: 0.5px;
}

body.tj-system .bank-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
body.tj-system .bank-picker-option:hover {
  background: var(--opt-bg, #f8fafc);
}
body.tj-system .bank-picker-option.selected {
  background: var(--opt-bg, #f0fdf4);
  font-weight: 700;
}
body.tj-system .bank-picker-option img,
body.tj-system .bank-picker-option svg {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
body.tj-system .bank-picker-opt-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
body.tj-system .bank-picker-opt-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.tj-system .bank-picker-option.selected .bank-picker-opt-title {
  color: var(--opt-color, #059669);
  font-weight: 700;
}
body.tj-system .bank-picker-opt-sub {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
body.tj-system .bank-picker-opt-check {
  color: var(--opt-color, #059669);
  font-weight: 900;
  font-size: 15px;
  flex: 0 0 auto;
}
body.tj-system .bank-picker-empty {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

body.tj-system .bank-chosen-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  transition: all 0.18s ease;
}
body.tj-system .bank-chosen-badge svg,
body.tj-system .bank-chosen-badge img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
body.tj-system .bank-chosen-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.tj-system .bank-chosen-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
body.tj-system .bank-chosen-meta {
  font-size: 12px;
  color: #64748b;
}

/* ---------- TrueMoney Wallet Payment Card (14 ก.ย. 2569 บอสสั่ง: ให้เห็นที่จะโอนง่ายๆ) ---------- */
.wallet-paycard,
body.tj-system .wallet-paycard {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 18px;
  padding: 20px 16px;
  margin: 14px 0;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.08);
}
.wpc-header,
body.tj-system .wpc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #fdba74;
  margin-bottom: 14px;
}
.wpc-title,
body.tj-system .wpc-title {
  font-size: 17px;
  font-weight: 800;
  color: #c2410c;
  line-height: 1.3;
}
.wpc-subtitle,
body.tj-system .wpc-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}
.wpc-field-box,
body.tj-system .wpc-field-box {
  background: #fff7ed;
  border: 1.5px solid #ffedd5;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.wpc-field-box.highlight,
body.tj-system .wpc-field-box.highlight {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.wpc-field-head,
body.tj-system .wpc-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.wpc-label,
body.tj-system .wpc-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #9a3412;
}
.wpc-field-box.highlight .wpc-label,
body.tj-system .wpc-field-box.highlight .wpc-label {
  color: #166534;
}
.wpc-copy-btn,
body.tj-system .wpc-copy-btn {
  background: #ffffff;
  border: 1px solid #fdba74;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.wpc-field-box.highlight .wpc-copy-btn,
body.tj-system .wpc-field-box.highlight .wpc-copy-btn {
  border-color: #86efac;
  color: #15803d;
}
.wpc-copy-btn:hover,
body.tj-system .wpc-copy-btn:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}
.wpc-field-box.highlight .wpc-copy-btn:hover,
body.tj-system .wpc-field-box.highlight .wpc-copy-btn:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}
.wpc-copy-btn.copied,
body.tj-system .wpc-copy-btn.copied {
  background: #15803d !important;
  color: #ffffff !important;
  border-color: #15803d !important;
}
.wpc-phone-display,
body.tj-system .wpc-phone-display {
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.5px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.wpc-amount-row,
body.tj-system .wpc-amount-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.wpc-amount-val,
body.tj-system .wpc-amount-val {
  font-size: 30px;
  font-weight: 900;
  color: #15803d;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.wpc-amount-unit,
body.tj-system .wpc-amount-unit {
  font-size: 16px;
  font-weight: 800;
  color: #166534;
}
.wpc-name-row,
body.tj-system .wpc-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.wpc-name-label,
body.tj-system .wpc-name-label {
  color: #64748b;
}
.wpc-name-val,
body.tj-system .wpc-name-val {
  font-weight: 700;
  color: #0f172a;
}
.wpc-steps,
body.tj-system .wpc-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
.wpc-step-item,
body.tj-system .wpc-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}
.wpc-step-num,
body.tj-system .wpc-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ea580c;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 🪙 การ์ดสะสมแต้มสไตล์ Modern Fintech / XP Gauge (17 ก.ย. 2569 — ใบงาน 027) */
body.tj-system #dPoints,
body.tj-system #myPoints,
body.tj-system .compact-points {
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.08), 0 4px 10px -2px rgba(2, 132, 199, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.tj-system #dPoints:hover,
body.tj-system #myPoints:hover {
  box-shadow: 0 14px 30px -5px rgba(2, 132, 199, 0.12), 0 6px 14px -2px rgba(2, 132, 199, 0.06);
}

body.tj-system .pts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

body.tj-system .pts-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.tj-system .pts-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #e0f2fe;
  border-radius: 10px;
  border: 1px solid #bae6fd;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
  flex-shrink: 0;
}

body.tj-system #dPoints h2,
body.tj-system #myPoints h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

body.tj-system #dPoints .hint,
body.tj-system #myPoints .hint {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 14px;
}

body.tj-system .pts-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

body.tj-system .pts-pill-idle { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
body.tj-system .pts-pill-info { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
body.tj-system .pts-pill-fire { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; animation: ptsPulse 2s infinite ease-in-out; }
body.tj-system .pts-pill-ready { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; animation: ptsPulse 2s infinite ease-in-out; }
body.tj-system .pts-pill-max { background: #fefce8; color: #ca8a04; border: 1px solid #fef08a; font-weight: 700; }

@keyframes ptsPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

body.tj-system .pts-stat-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 8px;
}

body.tj-system .pts-score-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

body.tj-system .pts-score-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #0284c7;
  letter-spacing: -0.02em;
}

body.tj-system .pts-score-label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}

body.tj-system .pts-target-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.tj-system .pts-target-tag {
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 6px;
}

body.tj-system .pts-pct-num {
  font-size: 16px;
  font-weight: 700;
  color: #0284c7;
}

body.tj-system .pts-tube-wrap {
  width: 100%;
  margin: 10px 0 16px;
}

body.tj-system .pts-tube-track {
  width: 100%;
  height: 16px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid #cbd5e1;
}

body.tj-system .pts-tube-fill {
  height: 100%;
  min-width: 12px;
  background: linear-gradient(90deg, #38bdf8 0%, #0284c7 55%, #0369a1 100%);
  border-radius: 9999px;
  position: relative;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

body.tj-system .pts-tube-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: ptsShimmer 2.5s infinite linear;
}

@keyframes ptsShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

body.tj-system .pts-milestones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

body.tj-system .pts-mile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

body.tj-system .pts-mile.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

body.tj-system .pts-mile.active {
  background: #f0f9ff;
  border-color: #7dd3fc;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

body.tj-system .pts-mile-dot {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  flex-shrink: 0;
}

body.tj-system .pts-mile.done .pts-mile-dot {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

body.tj-system .pts-mile.active:not(.done) .pts-mile-dot {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

body.tj-system .pts-mile-info {
  display: flex;
  flex-direction: column;
}

body.tj-system .pts-mile-info b { font-size: 12px; color: #0f172a; }
body.tj-system .pts-mile-info span { font-size: 11px; color: #64748b; }
body.tj-system .pts-mile.done .pts-mile-info b { color: #166534; }
body.tj-system .pts-mile.active .pts-mile-info b { color: #0369a1; }

body.tj-system .pts-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

body.tj-system .pts-callout-icon { font-size: 18px; flex-shrink: 0; }
body.tj-system .pts-callout-body { flex: 1; }
body.tj-system .pts-callout.is-normal { background: #f8fafc; border: 1px solid #e2e8f0; color: #334155; }
body.tj-system .pts-callout.is-near { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-weight: 500; }
body.tj-system .pts-callout.is-ready { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
body.tj-system .pts-callout.is-max { background: #fefce8; border: 1px solid #fef08a; color: #854d0e; }
body.tj-system .pts-callout-sub { font-size: 12px; color: #0369a1; margin-top: 2px; }

@media (max-width: 600px) {
  body.tj-system #dPoints,
  body.tj-system #myPoints,
  body.tj-system .compact-points {
    padding: 16px 18px;
  }
  body.tj-system .pts-milestones {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tj-system *, body.tj-system *::before, body.tj-system *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* deal-fab-room: เผื่อที่ท้ายหน้าดีลให้ปุ่มลอย "แชท 3 ฝ่าย" — ไม่งั้นลิงก์ล่างสุดโดนทับ แตะไม่ได้ (18 ต.ค. 2569) */
body.tj-deal footer { padding-bottom: max(110px, calc(90px + env(safe-area-inset-bottom))) !important; }

/* slip-qr-note: เตือนรูปสลิปที่ไม่มี QR อ่านไม่ออก ต้องรอคนกลางตรวจเอง (18 ต.ค. 2569) */
body.tj-system .slip-qr-note {
  font-size: 13.5px;
  line-height: 1.6;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0 0;
}

/* ══════════════════════════════════════════════════════════════
   ปุ่มหลังบ้านเด่น ๆ เฉพาะบัญชีแอดมิน (บอสสั่ง 18 ต.ค. 2569)
   ══════════════════════════════════════════════════════════════ */

/* 1. ปุ่มเม็ดยาหลังบ้านบน header.top (index.html, deal.html) */
header.top .btn-admin-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #0f172a;
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: all 0.15s ease;
}
header.top .btn-admin-top:hover {
  background: #1e293b;
  color: #ffffff !important;
  transform: translateY(-1px);
}
header.top .btn-admin-top.hide {
  display: none !important;
}

@media (max-width: 600px) {
  header.top .btn-admin-top {
    padding: 4px 8px;
    font-size: 11.5px;
  }
  header.top .who {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* 2. การ์ดแอดมินหน้าแรก (#secHome #adminCard) — ย้ายขึ้นบนสุดของพื้นที่ดีลและทำให้เด่น */
body.home.tj-system #secHome #adminCard,
body.tj-system #secHome > #adminCard {
  order: 1.5 !important;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0369a1 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 20px !important;
  padding: 20px 24px !important;
  color: #ffffff !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.28) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 16px !important;
}

body.home.tj-system #secHome #adminCard.hide,
body.tj-system #secHome > #adminCard.hide {
  display: none !important;
}

#adminCard h2 {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#adminCard .admin-card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#adminCard .admin-card-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.15s ease;
  margin: 0;
  cursor: pointer;
}

#adminCard .admin-btn-primary {
  background: #ffffff !important;
  color: #0f172a !important;
  border: none !important;
  flex: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#adminCard .admin-btn-primary:hover {
  background: #f8fafc !important;
  transform: translateY(-1px);
}

#adminCard .admin-btn-secondary {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(8px);
  flex: 1;
}

#adminCard .admin-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  body.home.tj-system #secHome #adminCard,
  body.tj-system #secHome > #adminCard {
    padding: 16px 18px !important;
    gap: 14px !important;
  }
  #adminCard .admin-card-actions {
    flex-direction: column;
  }
  #adminCard .admin-card-actions .btn {
    width: 100%;
  }
}

/* 3. แถบเด่นบนสุดของเนื้อหาดีล (#adminDealBar) */
.admin-deal-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
}

.admin-deal-bar.hide {
  display: none !important;
}

.admin-deal-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-deal-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-deal-bar-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-deal-bar-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.admin-deal-bar-desc {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

.admin-deal-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #38bdf8 !important;
  color: #0f172a !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  padding: 9px 18px !important;
  border-radius: 999px !important;
  border: none !important;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
  transition: all 0.15s ease;
}

.admin-deal-bar-btn:hover {
  background: #7dd3fc !important;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .admin-deal-bar-content {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-deal-bar-btn {
    justify-content: center;
    width: 100%;
  }
}

/* 4. ไฮไลต์การ์ดดีลในหลังบ้าน 2 วินาที */
.deal-highlight {
  outline: 3px solid #0284c7 !important;
  box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.3) !important;
  transition: outline 0.3s ease, box-shadow 0.3s ease;
}

/* 6. ปรับแต่งหัวห้องแชท #dChat > summary บนมือถือ */
@media (max-width: 640px) {
  body.tj-deal #dChat > summary,
  html body.tj-deal #dChat.chat-popup-dock > summary {
    padding: 10px 12px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    box-sizing: border-box !important;
  }
  body.tj-deal #dChat > summary .chat-title-group {
    min-width: 0 !important;
    overflow: hidden !important;
    flex: 1 1 auto !important;
  }
  body.tj-deal #dChat > summary .chat-title-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  body.tj-deal #dChat > summary .chat-popup-ctrls {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
  body.tj-deal #dChat > summary .btn-chat-ctrl {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    box-sizing: border-box !important;
  }
}


/* qr-amount: ยอดที่ต้องโอนติดใต้ QR (18 ต.ค. 2569 — ดีล 090685 ผู้ซื้อโอนแค่ราคาของ ไม่รวมค่าบริการ) */
body.tj-system .qr-amount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 12px auto 4px;
  padding: 12px 18px;
  max-width: 340px;
  text-align: center;
  background: #ecfdf5;
  border: 2px solid #34d399;
  border-radius: 16px;
}
body.tj-system .qr-amount span { font-size: 13px; font-weight: 600; color: #047857; }
body.tj-system .qr-amount b { font-size: 34px; line-height: 1.2; font-weight: 800; color: #065f46; font-variant-numeric: tabular-nums; }
body.tj-system .qr-amount small { font-size: 12px; color: #4b5563; line-height: 1.5; }
