/* 3145379CANADA Live Chat — dark theme */
.tm-chat-wrap {
  background: #1c2024;
  border: 1px solid #434656;
  border-radius: 0.75rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  min-height: 520px;
  overflow: hidden;
}

.tm-chat-head {
  background: #0b0f12;
  color: #e0e2e8;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #434656;
}

.tm-chat-head .ic {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(184,195,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8c3ff;
  flex-shrink: 0;
}

.tm-chat-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0e2e8;
}

.tm-chat-head p {
  margin: 0;
  font-size: 0.78rem;
  color: #c4c5d9;
}

.tm-chat-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(46,91,255,0.25);
  color: #b8c3ff;
}

.tm-chat-start {
  padding: 24px 22px;
  flex: 1;
  overflow-y: auto;
}

.tm-chat-lead {
  margin: 0 0 1.25rem;
  color: #c4c5d9;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tm-chat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tm-chat-field {
  margin-bottom: 1rem;
}

.tm-chat-field label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8e90a2;
  margin-bottom: 0.4rem;
}

.tm-chat-field input,
.tm-chat-field select,
.tm-chat-field textarea {
  width: 100%;
  background: #181c20 !important;
  border: 1px solid #434656 !important;
  border-radius: 0.5rem;
  color: #e0e2e8 !important;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
}

.tm-chat-field input:focus,
.tm-chat-field select:focus,
.tm-chat-field textarea:focus {
  border-color: #b8c3ff !important;
  outline: none;
}

.tm-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: #101417;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 380px;
}

.tm-chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
}

.tm-chat-bubble.customer {
  align-self: flex-end;
  background: #2e5bff;
  color: #efefff;
  border-bottom-right-radius: 4px;
}

.tm-chat-bubble.admin {
  align-self: flex-start;
  background: #272a2e;
  color: #e0e2e8;
  border: 1px solid #434656;
  border-bottom-left-radius: 4px;
}

.tm-chat-bubble .meta {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
  opacity: 0.7;
}

.tm-chat-compose {
  display: flex;
  gap: 0.75rem;
  padding: 14px 16px;
  border-top: 1px solid #434656;
  background: #1c2024;
  align-items: flex-end;
}

.tm-chat-compose textarea {
  flex: 1;
  background: #181c20 !important;
  border: 1px solid #434656 !important;
  border-radius: 0.5rem;
  color: #e0e2e8 !important;
  padding: 0.7rem 0.85rem;
  resize: none;
  min-height: 48px;
}

.tm-chat-send {
  background: #2e5bff;
  color: #efefff;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tm-chat-send:hover { background: #124af0; }
.tm-chat-send:disabled { opacity: 0.55; cursor: not-allowed; }
.tm-chat-start-btn { width: 100%; margin-top: 0.5rem; }

.tm-chat-empty {
  text-align: center;
  color: #8e90a2;
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

.tm-chat-error {
  background: rgba(147,0,10,0.35);
  color: #ffdad6;
  border: 1px solid rgba(255,180,171,0.35);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

/* Admin chat modal */
.admin-chat-thread {
  background: #101417;
}
.admin-chat-compose {
  border-top: 1px solid #434656;
}
.admin-chat-thread .tm-chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  clear: both;
}
.admin-chat-thread .tm-chat-bubble.customer {
  float: left;
  background: #272a2e;
  color: #e0e2e8;
  border: 1px solid #434656;
}
.admin-chat-thread .tm-chat-bubble.admin {
  float: right;
  background: #2e5bff;
  color: #efefff;
}
.admin-chat-thread .tm-chat-bubble .meta {
  display: block;
  font-size: 0.65rem;
  margin-top: 6px;
  opacity: 0.7;
}

@media (max-width: 767px) {
  .tm-chat-grid { grid-template-columns: 1fr; }
  .tm-chat-wrap { min-height: 460px; }
  .tm-chat-messages { max-height: 300px; }
  .tm-chat-compose { flex-direction: column; align-items: stretch; }
  .tm-chat-send { width: 100%; }
}
