/* TDM Assistant — floating chatbot widget. Teal #1A7A8C, white, charcoal. */
/* Positioned ABOVE the site's green WhatsApp button (#ht-ctc-chat, 50x50,
   fixed bottom 15px / right 15px, i.e. it occupies bottom 15-65px).
   bottom: 92px leaves a 27px clear gap above the WhatsApp button. */
#tdm-assistant {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 99999;
  font-family: inherit;
  color: #22252a;
  line-height: 1.45;
}
#tdm-assistant * { box-sizing: border-box; }

/* Round logo button with teal ring + green online dot */
.tdm-a-fab {
  position: relative;
  width: 64px;
  height: 64px;
  margin-left: auto;
  border: 3px solid #1a7a8c;
  border-radius: 50%;
  background: #ffffff;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: block;
}
.tdm-a-fab img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.tdm-a-dot {
  position: absolute;
  right: 1px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
}

/* Small greeting bubble — appears ~2.5s after load, never opens chat itself */
.tdm-a-bubble {
  display: none;
  position: absolute;
  right: 74px;
  bottom: 8px;
  width: 262px;
  max-width: calc(100vw - 110px);
  background: #ffffff;
  color: #22252a;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 12px 34px 12px 14px;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.tdm-a-bubble.tdm-a-show { display: block; }
.tdm-a-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 18px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-right: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
  transform: rotate(-45deg);
}
.tdm-a-bubble-close {
  position: absolute;
  top: 4px;
  right: 8px;
  border: 0;
  background: transparent;
  color: #888888;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

/* Chat window */
.tdm-a-window {
  display: none;
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 190px);
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  flex-direction: column;
}
.tdm-a-window.tdm-a-open { display: flex; }
.tdm-a-head {
  background: #1a7a8c;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tdm-a-head img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  object-fit: cover;
  flex: 0 0 auto;
}
.tdm-a-head-titles { flex: 1; min-width: 0; }
.tdm-a-head-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.tdm-a-head-status { font-size: 12px; opacity: 0.9; }
.tdm-a-head-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 5px;
}
.tdm-a-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.tdm-a-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tdm-a-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tdm-a-msg-bot {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.tdm-a-msg-user {
  background: #1a7a8c;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.tdm-a-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  background: #f7f7f7;
}
.tdm-a-chip {
  border: 1px solid #1a7a8c;
  background: #ffffff;
  color: #1a7a8c;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tdm-a-chip:hover { background: #1a7a8c; color: #ffffff; }
.tdm-a-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e8e8e8;
  background: #ffffff;
}
.tdm-a-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cccccc;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.tdm-a-input:focus { border-color: #1a7a8c; }
.tdm-a-send {
  border: 0;
  background: #1a7a8c;
  color: #ffffff;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}
.tdm-a-send:hover { background: #14606e; }

/* Small screens — same clearance above the WhatsApp button:
   fab is 56px tall, bottom: 84px leaves a 19px gap above it. */
@media (max-width: 480px) {
  #tdm-assistant { right: 12px; bottom: 84px; }
  .tdm-a-fab { width: 56px; height: 56px; }
  .tdm-a-bubble { width: 238px; right: 64px; font-size: 13px; }
  .tdm-a-window { bottom: 68px; height: 520px; }
}
