/* Accurate Digitizing — Quote Chatbot
   Drop-in widget. Uses the site's existing /contact-submit/ endpoint,
   so every chat lead lands in the same inbox as the quote form
   (info@accuratedigitizing.com). No new backend, no paid service. */

.ad-chat-btn {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: #e8613c; color: #fff; font-size: 28px;
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
  font-family: Nunito, system-ui, sans-serif;
}
.ad-chat-btn:hover { background: #d14e2c; }
.ad-chat-btn .ad-chat-badge {
  position: absolute; top: -4px; right: -4px;
  background: #1c2340; color: #fff; font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}
.ad-chat-panel {
  position: fixed; right: 18px; bottom: 90px; z-index: 9999;
  width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px));
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  display: none; flex-direction: column;
  font-family: Nunito, system-ui, sans-serif;
}
.ad-chat-panel.open { display: flex; }
.ad-chat-head {
  background: #1c2340; color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.ad-chat-head .ad-chat-logo {
  width: 36px; height: 36px; border-radius: 50%; background: #e8613c;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex: none;
}
.ad-chat-head b { display: block; font-size: 15px; }
.ad-chat-head small { opacity: .85; font-size: 12px; }
.ad-chat-head .ad-chat-close {
  margin-left: auto; background: none; border: 0; color: #fff;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.ad-chat-body {
  flex: 1; overflow-y: auto; padding: 14px;
  background: #f6f7fb; display: flex; flex-direction: column; gap: 8px;
}
.ad-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-line; }
.ad-msg.bot { background: #fff; border: 1px solid #e6e8f0; align-self: flex-start; border-bottom-left-radius: 4px; }
.ad-msg.user { background: #1c2340; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ad-msg.user a { color: #ffd9cc; }
.ad-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-quick button {
  border: 1px solid #e8613c; background: #fff; color: #e8613c;
  border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.ad-quick button:hover { background: #e8613c; color: #fff; }
.ad-chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e6e8f0; background: #fff; }
.ad-chat-input input[type="text"], .ad-chat-input input[type="email"], .ad-chat-input input[type="tel"] {
  flex: 1; border: 1px solid #d5d8e6; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; min-width: 0;
}
.ad-chat-input button {
  background: #e8613c; color: #fff; border: 0; border-radius: 10px;
  padding: 0 16px; font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.ad-chat-input button:disabled { opacity: .6; cursor: wait; }
.ad-chat-file { padding: 0 10px 10px; background: #fff; font-size: 12px; color: #555; }
.ad-chat-file input { font-size: 12px; }
.ad-chat-note { padding: 0 12px 8px; background: #fff; font-size: 11px; color: #888; }
@media (max-width: 480px) {
  .ad-chat-panel { right: 12px; bottom: 88px; }
  .ad-chat-btn { right: 12px; bottom: 12px; }
}
