#adv-chat-box {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 99999;
}

.adv-chat-widget {
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dcdcde;
  border-radius: 14px;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.08);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.adv-chat-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #ffffff;
  background: #1d3557;
}

.adv-chat-widget__title {
  font-size: 15px;
  font-weight: 700;
}

.adv-chat-widget__status {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.8;
}

.adv-chat-widget__toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.adv-chat-widget__toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.adv-chat-widget__body {
  background: #f6f7f9;
}

.adv-chat-widget__log {
  height: 340px;
  padding: 16px;
  overflow-y: auto;
}

.adv-chat-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.adv-chat-message__meta {
  margin-bottom: 4px;
  color: #646970;
  font-size: 11px;
  font-weight: 600;
}

.adv-chat-message__bubble {
  max-width: 86%;
  padding: 10px 12px;
  color: #1d2327;
  font-size: 14px;
  line-height: 1.5;
  background: #ffffff;
  border: 1px solid #e2e4e7;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.adv-chat-message--user {
  align-items: flex-end;
}

.adv-chat-message--user .adv-chat-message__meta {
  text-align: right;
}

.adv-chat-message--user .adv-chat-message__bubble {
  color: #ffffff;
  background: #2271b1;
  border-color: #2271b1;
  border-bottom-right-radius: 4px;
}

.adv-chat-message--assistant .adv-chat-message__bubble {
  border-bottom-left-radius: 4px;
}

.adv-chat-message--staff .adv-chat-message__bubble {
  background: #edf7ed;
  border-color: #b8ddb8;
  border-bottom-left-radius: 4px;
}

.adv-chat-message--system .adv-chat-message__bubble {
  max-width: 100%;
  color: #50575e;
  font-size: 12px;
  background: #f0f0f1;
  border-style: dashed;
}

.adv-chat-message__bubble a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.adv-chat-widget__composer {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #dcdcde;
}

.adv-chat-widget__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
  border: 1px solid #8c8f94;
  border-radius: 8px;
}

.adv-chat-widget__input:focus {
  border-color: #2271b1;
  outline: 2px solid rgba(34, 113, 177, 0.2);
}

.adv-chat-widget__send {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  background: #2271b1;
  border: 0;
  border-radius: 8px;
}

.adv-chat-widget__send:hover {
  background: #135e96;
}

.adv-chat-widget__send:disabled {
  cursor: wait;
  opacity: 0.65;
}

.adv-chat-widget--collapsed {
  max-width: 200px;
}

.adv-chat-widget__new {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  color: #2271b1;
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid #2271b1;
  border-radius: 8px;
}

.adv-chat-widget__new:hover {
  color: #ffffff;
  background: #2271b1;
}

.adv-chat-conversation-resolved {
  margin: 12px 0;
  padding: 10px 12px;
  color: #50575e;
  font-size: 12px;
  text-align: center;
  background: #f0f0f1;
  border: 1px dashed #8c8f94;
  border-radius: 8px;
}

@media (max-width: 600px) {
  #adv-chat-box {
    left: 12px;
    bottom: 12px;
    left: 12px;
  }

  .adv-chat-widget {
    width: 100%;
  }

  .adv-chat-widget__log {
    height: 50vh;
  }
}
