/* Herbert Chatbot Widget */
#herbert-widget * {
  box-sizing: border-box;
}

#herbert-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--herbert-color, #1a56db);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  z-index: 999998;
  font-size: 26px;
  border: none;
  transition: transform .15s ease;
}
#herbert-bubble:hover { transform: scale(1.06); }

#herbert-window {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
#herbert-window.open { display: flex; }

#herbert-header {
  background: var(--herbert-color, #1a56db);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#herbert-header .title { font-weight: 600; font-size: 15px; }
#herbert-header .subtitle { font-size: 12px; opacity: .85; margin-top: 2px; }
#herbert-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

#herbert-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fa;
}

.herbert-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.herbert-msg.user {
  align-self: flex-end;
  background: var(--herbert-color, #1a56db);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.herbert-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #222;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.herbert-msg.typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #999;
  font-style: italic;
}

#herbert-inputbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
#herbert-input {
  flex: 1;
  border: 1px solid #d7dae0;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 90px;
  font-family: inherit;
}
#herbert-input:focus { border-color: var(--herbert-color, #1a56db); }

#herbert-send {
  background: var(--herbert-color, #1a56db);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
}
#herbert-send:disabled { opacity: .5; cursor: not-allowed; }

#herbert-footer {
  text-align: center;
  font-size: 11px;
  color: #9aa0a8;
  padding: 4px 0 8px;
  background: #fff;
}
