/* ATS Hammond chat widget - v1 */
:root {
  --atschat-navy: #0f1c3f;
  --atschat-red: #c8102e;
  --atschat-bg: #ffffff;
  --atschat-user: #0f1c3f;
  --atschat-bot: #f2f4f8;
  --atschat-text: #1a1a1a;
  --atschat-muted: #6b7280;
}

#atschat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99998;
  background: var(--atschat-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 20px 14px 18px;
  font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
#atschat-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.34); }
#atschat-launcher .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,0.25); }
#atschat-launcher svg { width: 20px; height: 20px; }
#atschat-launcher.hidden { display: none; }
#atschat-launcher .label-short { display: none; }
@media (max-width: 600px) {
  #atschat-launcher .label-long { display: none; }
  #atschat-launcher .label-short { display: inline; }
}

#atschat-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 40px));
  background: var(--atschat-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--atschat-text);
}
#atschat-panel.open { display: flex; }

#atschat-header {
  background: var(--atschat-navy);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#atschat-header .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--atschat-red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
#atschat-header .name { font-weight: 700; font-size: 15px; }
#atschat-header .status { font-size: 12px; opacity: .82; }
#atschat-header .close {
  margin-left: auto; background: transparent; color: #fff; border: none;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
#atschat-header .close:hover { background: rgba(255,255,255,0.12); }

#atschat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 8px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.atschat-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.atschat-msg.bot {
  background: var(--atschat-bot);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--atschat-text);
}
.atschat-msg.user {
  background: var(--atschat-user);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.atschat-typing {
  align-self: flex-start;
  padding: 10px 14px;
  background: var(--atschat-bot);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: inline-flex;
  gap: 4px;
}
.atschat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #9aa3b2;
  animation: atschat-bounce 1.2s infinite;
}
.atschat-typing span:nth-child(2) { animation-delay: .15s; }
.atschat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes atschat-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.atschat-cta {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}
.atschat-cta button {
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  font: 700 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.atschat-cta .book { background: var(--atschat-red); color: #fff; }
.atschat-cta .book:hover { filter: brightness(1.08); }
.atschat-cta .call { background: #fff; color: var(--atschat-navy); border: 2px solid var(--atschat-navy); }
.atschat-cta .call:hover { background: var(--atschat-navy); color: #fff; }

#atschat-footer {
  border-top: 1px solid #e5e7eb;
  padding: 10px;
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
#atschat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  resize: none;
  max-height: 100px;
  outline: none;
  color: var(--atschat-text);
  background: #fff;
}
#atschat-input:focus { border-color: var(--atschat-navy); }
#atschat-send {
  background: var(--atschat-navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
#atschat-send:disabled { opacity: .5; cursor: not-allowed; }

#atschat-disclaimer {
  padding: 6px 12px 10px;
  font-size: 11px;
  color: var(--atschat-muted);
  text-align: center;
  background: #fff;
}

@media (max-width: 480px) {
  #atschat-panel {
    right: 10px; left: 10px; bottom: 10px;
    width: auto;
    height: min(80vh, 620px);
  }
  #atschat-launcher { right: 12px; bottom: 12px; padding: 13px 18px 13px 16px; font-size: 15px; font-weight: 800; box-shadow: 0 10px 26px rgba(0,0,0,0.35); }
}
