.lc-ai-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
  color: #17212b;
}

.lc-ai-chat-widget * {
  box-sizing: border-box;
}

.lc-ai-chat-launcher {
  width: 64px;
  height: 44px;
  border: 1px solid #19536b;
  border-radius: 6px;
  background: #19536b;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(21, 39, 51, 0.22);
}

.lc-ai-chat-window {
  position: absolute;
  right: 0;
  bottom: 56px;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 96px));
  min-height: 0;
  max-height: calc(100vh - 96px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ccd5dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(21, 39, 51, 0.22);
}

.lc-ai-chat-window[hidden] {
  display: none;
}

.lc-ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe3e8;
  background: #f7fafb;
}

.lc-ai-chat-header strong,
.lc-ai-chat-header span {
  display: block;
}

.lc-ai-chat-header strong {
  font-size: 15px;
  line-height: 1.25;
}

.lc-ai-chat-header span {
  margin-top: 2px;
  color: #5d6b76;
  font-size: 12px;
  line-height: 1.25;
}

.lc-ai-chat-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid #c8d2da;
  border-radius: 6px;
  background: #ffffff;
  color: #263844;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.lc-ai-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: #ffffff;
}

.lc-ai-chat-message {
  width: fit-content;
  max-width: 86%;
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lc-ai-chat-message-assistant {
  border: 1px solid #d7e0e6;
  background: #f4f7f8;
  color: #17212b;
}

.lc-ai-chat-message-visitor {
  margin-left: auto;
  border: 1px solid #19536b;
  background: #19536b;
  color: #ffffff;
}

.lc-ai-chat-status {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #ead7a0;
  border-radius: 6px;
  background: #fff8df;
  color: #584315;
  font-size: 12px;
  line-height: 1.35;
}

.lc-ai-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dbe3e8;
  background: #f7fafb;
}

.lc-ai-chat-input,
.lc-ai-chat-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid #c5d0d8;
  border-radius: 6px;
  background: #ffffff;
  color: #17212b;
  font-size: 14px;
  line-height: 1.3;
}

.lc-ai-chat-input {
  height: 38px;
  padding: 0 10px;
}

.lc-ai-chat-input:disabled {
  background: #eef2f4;
}

.lc-ai-chat-send,
.lc-ai-chat-lead-submit {
  min-height: 38px;
  border: 1px solid #19536b;
  border-radius: 6px;
  background: #19536b;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.lc-ai-chat-send:disabled,
.lc-ai-chat-lead-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.lc-ai-chat-lead-form {
  display: grid;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid #ccd5dc;
  border-radius: 8px;
  background: #f8fafb;
}

.lc-ai-chat-lead-title {
  color: #263844;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.lc-ai-chat-field {
  display: grid;
  gap: 4px;
}

.lc-ai-chat-field span {
  color: #445461;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.lc-ai-chat-field input {
  height: 36px;
  padding: 0 9px;
}

.lc-ai-chat-lead-actions {
  display: flex;
  justify-content: flex-end;
}

.lc-ai-chat-lead-submit {
  width: 128px;
}

@media (max-width: 480px) {
  .lc-ai-chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .lc-ai-chat-window {
    right: -4px;
    bottom: 54px;
    width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 84px));
    max-height: calc(100vh - 84px);
  }

  .lc-ai-chat-compose {
    grid-template-columns: minmax(0, 1fr) 68px;
    padding: 10px;
  }

  .lc-ai-chat-message {
    max-width: 92%;
  }
}
