#chatbot-toggle,
#chatbot-container,
#chatbot-container * { box-sizing: border-box; }

#chatbot-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 60px;
  height: 60px;
  padding: 0 19px;
  color: #061d33;
  background: linear-gradient(135deg, #ffc74f, #f3a712);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 35px rgba(3, 24, 38, .28);
  cursor: pointer;
  font: 800 14px/1 Inter, system-ui, sans-serif;
  transition: transform .2s ease, box-shadow .2s ease;
}

#chatbot-toggle:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(3, 24, 38, .34); }
#chatbot-toggle:focus-visible,
#chatbot-container button:focus-visible,
#chatbot-input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#chatbot-toggle svg { width: 25px; height: 25px; fill: currentColor; flex: 0 0 auto; }

#chatbot-container {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9998;
  display: none;
  flex-direction: column;
  width: 390px;
  max-width: calc(100vw - 48px);
  height: 570px;
  max-height: calc(100vh - 126px);
  overflow: hidden;
  color: #10283e;
  background: #fff;
  border: 1px solid rgba(3, 24, 38, .1);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(3, 24, 38, .3);
  font-family: Inter, system-ui, sans-serif;
}

#chatbot-container.active { display: flex; animation: chatbot-in .22s ease-out; }

@keyframes chatbot-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  color: #fff;
  background: #061d33;
  border-bottom: 3px solid #f4b735;
}

#chatbot-header .bot-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  border-radius: 50%;
  font-size: 21px;
}

#chatbot-header .bot-info { min-width: 0; }
#chatbot-header .bot-info h2 { margin: 0; color: #fff; font-size: 15px; letter-spacing: .08em; }
#chatbot-header .bot-info p { margin: 3px 0 0; color: rgba(255,255,255,.76); font-size: 12px; }
#chatbot-close {
  margin-left: auto;
  padding: 2px 8px 5px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}
#chatbot-close:hover { background: rgba(255,255,255,.12); }

#chatbot-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  padding: 17px;
  background: #f3f6f4;
}

.chat-message {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.48;
  animation: chatbot-message-in .18s ease-out;
}
@keyframes chatbot-message-in { from { opacity: 0; transform: translateY(5px); } }
.chat-message.bot { align-self: flex-start; color: #183047; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(3,24,38,.07); }
.chat-message.user { align-self: flex-end; color: #061d33; background: #ffc74f; border-bottom-right-radius: 4px; font-weight: 600; }
.chat-message.typing { display: flex; gap: 4px; padding: 14px 16px; }
.chat-message.typing .dot { width: 7px; height: 7px; background: #83909b; border-radius: 50%; animation: chatbot-dot 1.2s infinite ease-in-out; }
.chat-message.typing .dot:nth-child(2) { animation-delay: .15s; }
.chat-message.typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes chatbot-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

#chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  background: #f3f6f4;
  border-top: 1px solid #e1e7e4;
}
.quick-reply {
  padding: 7px 12px;
  color: #805400;
  background: #fff;
  border: 1px solid #e0a21f;
  border-radius: 999px;
  cursor: pointer;
  font: 700 12px/1 Inter, system-ui, sans-serif;
}
.quick-reply:hover { color: #061d33; background: #ffc74f; }

#chatbot-input-area { display: flex; gap: 8px; margin: 0; padding: 12px 14px; background: #fff; border-top: 1px solid #e1e7e4; }
#chatbot-input {
  min-width: 0;
  flex: 1;
  padding: 11px 15px;
  color: #10283e;
  background: #fff;
  border: 1px solid #cad4d0;
  border-radius: 999px;
  font: 14px/1.2 Inter, system-ui, sans-serif;
}
#chatbot-input:focus { border-color: #d9980b; outline-color: #f4b735; }
#chatbot-send {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #061d33;
  background: #ffc74f;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
#chatbot-send:hover { background: #f4b735; }
#chatbot-send svg { width: 19px; height: 19px; fill: currentColor; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  #chatbot-toggle { right: 16px; bottom: 16px; width: 56px; min-width: 56px; height: 56px; padding: 0; justify-content: center; }
  .chatbot-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  #chatbot-container { inset: 12px 12px 82px; width: auto; max-width: none; height: auto; max-height: none; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  #chatbot-container.active, .chat-message, .chat-message.typing .dot { animation: none; }
  #chatbot-toggle { transition: none; }
}
