.doyles-chat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Bubble ── */

.doyles-chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #1a3a5c;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: transform .15s ease, background .15s ease;
}

.doyles-chat-bubble:hover {
  transform: scale(1.08);
  background: #234b73;
}

.doyles-chat-bubble-active {
  background: #6b7280;
}

/* ── Panel ── */

.doyles-chat-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doyles-chat-hidden {
  display: none !important;
}

/* ── Header ── */

.doyles-chat-header {
  background: #1a3a5c;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.doyles-chat-title {
  font-weight: 600;
  font-size: 14px;
}

.doyles-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: .8;
}

.doyles-chat-close:hover {
  opacity: 1;
}

/* ── Messages ── */

.doyles-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doyles-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.doyles-chat-msg a {
  color: #1a3a5c;
  text-decoration: underline;
}

.doyles-chat-msg ul {
  margin: 6px 0;
  padding-left: 18px;
}

.doyles-chat-msg li {
  margin-bottom: 2px;
}

.doyles-chat-msg-user {
  background: #1a3a5c;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.doyles-chat-msg-user a {
  color: #b3d4fc;
}

.doyles-chat-msg-assistant {
  background: #f0f2f5;
  color: #1a1a1a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* ── Form ── */

.doyles-chat-form {
  display: flex;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}

.doyles-chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.doyles-chat-input:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 2px rgba(26,58,92,.15);
}

.doyles-chat-send {
  background: #1a3a5c;
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.doyles-chat-send:hover {
  background: #234b73;
}

/* ── Typing indicator ── */

.doyles-chat-typing {
  display: inline-flex;
  gap: 4px;
  padding: 2px 0;
}

.doyles-chat-typing span {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  animation: doyles-chat-bounce .6s infinite alternate;
}

.doyles-chat-typing span:nth-child(2) { animation-delay: .15s; }
.doyles-chat-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes doyles-chat-bounce {
  from { opacity: .4; transform: translateY(0); }
  to   { opacity: 1;  transform: translateY(-4px); }
}

/* ── Mobile ── */

@media (max-width: 480px) {
  .doyles-chat-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 90px);
    bottom: 68px;
    right: -16px;
    border-radius: 12px 12px 0 0;
  }

  .doyles-chat-container {
    right: 16px;
    bottom: 16px;
  }
}
