/* ลิงก์ติดตามผล เฟส 7: ที่มาของลูกค้าใหม่ (admin-chat-source.module.js) · แบบจาก Frontend/design/mockups/tracked-links-chat-source-v1.html */

#chat-source-card[hidden],
#chat-source-card [hidden] {
  display: none !important;
}

/* ---------- ป้ายกลางห้องแชท (แบบ B) อยู่ใน #chat-box: ห้าม animation / transition / transform ---------- */
.chat-source-chip-row {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  margin: -0.5rem 0 0.9rem;
}

.chat-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 420px);
  padding: 4px 12px;
  border: 1px solid rgba(106, 76, 245, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 #fff;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  box-sizing: border-box;
}

.chat-source-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-source-chip-platform {
  flex: none;
  white-space: nowrap;
}

.chat-source-icon {
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-source-chip .chat-source-icon {
  color: #6a4cf5;
}

/* ---------- การ์ด "ที่มาของลูกค้า" ใต้แท็กในแถบเครื่องมือ (ขอบเขตสูงเท่าการ์ดลิงก์ติดตามผล กันกฎปุ่มรวมของแถบเครื่องมือทับ) ---------- */
#app-container.app-container #tools-column #chat-source-card .chat-source-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(124, 92, 255, 0.14), rgba(16, 179, 200, 0.12));
  color: #6a4cf5;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-tile .chat-source-icon {
  width: 17px;
  height: 17px;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-titles {
  min-width: 0;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-kicker {
  margin: 0;
  color: #6a4cf5;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-name {
  margin: 1px 0 0;
  color: #1e293b;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-lines {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.5;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-media {
  color: #64748b;
  overflow-wrap: anywhere;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-platform {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-platform i {
  width: 14px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-method {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-method i {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
}

#app-container.app-container #tools-column #chat-source-card .chat-source-note {
  margin: 9px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

#app-container.app-container #tools-column #chat-source-card button.chat-source-stats-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 34px;
  margin-top: 11px;
  padding: 0 13px;
  border: 1px solid rgba(106, 76, 245, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.75);
  color: #6a4cf5;
  font: inherit;
  box-shadow: none;
  transform: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#app-container.app-container #tools-column #chat-source-card button.chat-source-stats-btn:hover {
  background: #fff;
}

#app-container.app-container #tools-column #chat-source-card button.chat-source-stats-btn:focus-visible {
  outline: 2px solid rgba(106, 76, 245, 0.5);
  outline-offset: 2px;
}
