:root {
  --chatbot-ink: #172a3a;
  --chatbot-muted: #667684;
  --chatbot-navy: #0d3b66;
  --chatbot-navy-dark: #082d4f;
  --chatbot-teal: #1aa6a6;
  --chatbot-teal-light: #dff5f2;
  --chatbot-surface: #ffffff;
  --chatbot-soft: #f3f8f9;
  --chatbot-line: #dce7ea;
  --chatbot-shadow: 0 20px 55px rgba(13, 59, 102, 0.2);
}

#chatbot-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: var(--chatbot-navy);
  color: #fff;
  font: 700 0.88rem/1.1 "Trebuchet MS", sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(13, 59, 102, 0.28);
  cursor: pointer;
  z-index: 9998;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

#chatbot-launcher:hover,
#chatbot-launcher:focus-visible,
.chatbot-team-button:hover,
.chatbot-team-button:focus-visible {
  background: var(--chatbot-navy-dark);
}

#chatbot-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(13, 59, 102, 0.34);
}

.chatbot-launcher-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--chatbot-teal);
  color: #fff;
  font-size: 0.92rem;
}

#chatbot-container {
  position: fixed;
  right: 24px;
  bottom: 88px;
  width: min(390px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 112px));
  overflow: hidden;
  background: var(--chatbot-surface);
  border: 1px solid rgba(220, 231, 234, 0.95);
  border-radius: 18px;
  color: var(--chatbot-ink);
  font-family: "Trebuchet MS", sans-serif;
  box-shadow: var(--chatbot-shadow);
  display: none;
  flex-direction: column;
  z-index: 9999;
}

#chatbot-container.is-open {
  display: flex;
  animation: chatbot-pop-in 180ms ease-out both;
}

@keyframes chatbot-pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#chatbot-header {
  position: relative;
  background: linear-gradient(135deg, var(--chatbot-navy), #14547e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px;
  font-size: 0.98rem;
  font-weight: 700;
}

#chatbot-header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.chatbot-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #79e2c0;
  box-shadow: 0 0 0 4px rgba(121, 226, 192, 0.15);
}

#chatbot-close {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 3px 5px;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.86;
}

#chatbot-close:hover,
#chatbot-close:focus-visible { opacity: 1; }

#chatbot-welcome {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(135deg, var(--chatbot-soft), #eaf4f5);
}

.chatbot-avatar {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--chatbot-teal);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 5px 12px rgba(26, 166, 166, 0.24);
}

.chatbot-eyebrow,
.chatbot-greeting,
.chatbot-continue {
  margin: 0;
}

.chatbot-eyebrow {
  color: var(--chatbot-navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chatbot-greeting {
  margin-top: 4px;
  color: var(--chatbot-ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.chatbot-team-button {
  display: inline-block;
  margin-top: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--chatbot-navy);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.chatbot-continue {
  padding: 13px 18px 2px;
  color: var(--chatbot-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

#chatbot-messages {
  min-height: 120px;
  overflow-y: auto;
  padding: 8px 18px 14px;
  scrollbar-color: #b8d3d5 transparent;
}

.chatbot-message {
  max-width: 86%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 0.84rem;
  line-height: 1.5;
  animation: chatbot-message-in 180ms ease-out both;
}

@keyframes chatbot-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-message.user {
  margin-left: auto;
  background: var(--chatbot-navy);
  color: #fff;
  border-bottom-right-radius: 4px;
  text-align: right;
}

.chatbot-message.bot {
  background: #edf4f4;
  color: var(--chatbot-ink);
  border-bottom-left-radius: 4px;
  text-align: left;
}

#chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px 14px;
  border-top: 1px solid var(--chatbot-line);
  background: #fbfdfd;
}

#chatbot-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cfdee1;
  border-radius: 10px;
  outline: none;
  padding: 11px 12px;
  background: #fff;
  color: var(--chatbot-ink);
  font-size: 0.9rem;
}

#chatbot-input:focus {
  border-color: var(--chatbot-teal);
  box-shadow: 0 0 0 3px rgba(26, 166, 166, 0.14);
}

#chatbot-send {
  background: var(--chatbot-teal);
  color: #fff;
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background-color 160ms ease, transform 160ms ease;
}

#chatbot-send:hover,
#chatbot-send:focus-visible {
  background: #138b8b;
  transform: translateX(2px);
}

#chatbot-send:focus-visible {
  outline: 3px solid rgba(26, 166, 166, 0.25);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  #chatbot-container {
    width: min(360px, calc(100vw - 30px));
    right: 15px;
  }
}

@media (max-width: 480px) {
  #chatbot-launcher {
    right: 16px;
    bottom: 16px;
  }

  #chatbot-container {
    width: calc(100vw - 32px);
    max-height: min(650px, calc(100vh - 104px));
    right: 16px;
    bottom: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #chatbot-container.is-open,
  .chatbot-message { animation: none; }

  #chatbot-launcher,
  #chatbot-send { transition: none; }
}

