#llm-order-chat-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  font-family: Arial, sans-serif;
}

#llm-order-chat-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

#llm-order-chat-button.llm-active {
  background: #374151;
}

#llm-order-chat-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 540px;
  max-width: calc(100vw - 32px);
  height: 690px;
  max-height: calc(100vh - 104px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.30);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.llm-hidden {
  display: none !important;
}

.llm-chat-header {
  background: #111827;
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.llm-chat-header strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.llm-chat-header span {
  display: block;
  margin-top: 4px;
  color: #d1d5db;
  font-size: 12px;
}

#llm-chat-close {
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.llm-chat-auth {
  padding: 18px;
}

.llm-chat-intro {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  border-radius: 12px;
  padding: 12px;
  line-height: 1.45;
  font-size: 14px;
  margin-bottom: 14px;
}

.llm-chat-auth label {
  display: block;
  margin: 12px 0 6px;
  color: #111827;
  font-weight: 700;
  font-size: 13px;
}

.llm-chat-auth input,
.llm-chat-form textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  padding: 12px 13px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.llm-chat-form textarea {
  min-height: 44px;
  max-height: 96px;
  resize: none;
  line-height: 1.35;
}

.llm-chat-auth input:focus,
.llm-chat-form textarea:focus {
  border-color: #111827;
}

#llm-chat-start {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 11px;
  padding: 12px 13px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

#llm-chat-start:disabled,
.llm-chat-form button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.llm-chat-error {
  margin-top: 10px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.35;
}

#llm-chat-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.llm-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
}

.llm-msg-row {
  display: flex;
  flex-direction: column;
  margin: 0 0 14px;
}

.llm-msg-row-user {
  align-items: flex-end;
}

.llm-msg-row-assistant {
  align-items: flex-start;
}

.llm-msg-label {
  margin: 0 8px 4px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.llm-msg {
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 15px;
  line-height: 1.52;
  font-size: 14px;
  word-break: break-word;
}

.llm-msg-user {
  max-width: 78%;
  background: #111827;
  color: #fff;
  border-bottom-right-radius: 5px;
  white-space: pre-wrap;
}

.llm-msg-assistant {
  width: auto;
  max-width: 98%;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 5px;
}

.llm-msg-assistant p {
  margin: 0 0 10px;
}

.llm-msg-assistant p:last-child {
  margin-bottom: 0;
}

.llm-msg-assistant ul {
  margin: 8px 0 10px 0;
  padding: 0;
  list-style: none;
}

.llm-msg-assistant li {
  position: relative;
  margin: 8px 0;
  padding: 10px 12px 10px 34px;
  background: #f9fafb;
  border: 1px solid #eef0f3;
  border-radius: 12px;
}

.llm-msg-assistant li::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 10px;
  color: #111827;
  font-weight: 700;
}

.llm-msg-assistant strong {
  font-weight: 800;
}

.llm-msg-assistant code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 13px;
}

.llm-chat-form {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.llm-chat-form textarea {
  flex: 1;
}

.llm-chat-form button {
  border: 0;
  border-radius: 11px;
  background: #111827;
  color: #fff;
  padding: 0 16px;
  height: 44px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.llm-chat-status {
  min-height: 20px;
  padding: 0 14px 12px;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
}

@media (max-width: 640px) {
  #llm-order-chat-widget {
    right: 12px;
    bottom: 12px;
  }

  #llm-order-chat-panel {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 74px;
    width: auto;
    height: min(680px, calc(100vh - 94px));
    max-height: calc(100vh - 94px);
  }

  #llm-order-chat-button {
    max-width: calc(100vw - 24px);
  }

  .llm-msg-user {
    max-width: 86%;
  }

  .llm-msg-assistant {
    max-width: 100%;
  }
}


/* Extra readability for long product lists */
.llm-msg-assistant li {
  line-height: 1.45;
}

.llm-msg-assistant li + li {
  margin-top: 7px;
}

.llm-chat-choice {
  padding: 18px;
}

.llm-choice-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  padding: 15px 16px;
  margin: 12px 0;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(17, 24, 39, 0.06);
}

.llm-choice-card:hover {
  border-color: #111827;
}

.llm-choice-card strong {
  display: block;
  color: #111827;
  font-size: 15px;
  margin-bottom: 5px;
}

.llm-choice-card span {
  display: block;
  color: #6b7280;
  line-height: 1.4;
  font-size: 13px;
}

.llm-back-button {
  border: 0;
  background: transparent;
  color: #374151;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.llm-chat-modebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.llm-chat-modebar .llm-back-button {
  margin-bottom: 0;
}

#llm-chat-mode-label {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}
