.lpinz-chatbot,
.lpinz-chatbot * {
  box-sizing: border-box;
}

.lpinz-chatbot {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  color: #0f4f8a;
  --lpinz-navy: #0f4f8a;
  --lpinz-blue: #1f5f9e;
  --lpinz-gold: #ffc20e;
  --lpinz-ink: #12365d;
  --lpinz-soft: #eef5fc;
  --lpinz-line: #cfdded;
  --lpinz-white: #ffffff;
}

.lpinz-chatbot-embedded {
  width: 100%;
}

.lpinz-chatbot-embedded .lpinz-chatbot-panel {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(180deg, #fcfeff 0%, #f5f9fd 100%);
  border: 1px solid var(--lpinz-line);
  border-top: 5px solid var(--lpinz-gold);
  border-radius: 26px;
  box-shadow: 0 18px 44px rgba(15, 79, 138, 0.09);
  overflow: hidden;
}

.lpinz-chatbot-header-embedded {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  background: transparent;
  border-bottom: 1px solid var(--lpinz-line);
}

.lpinz-chatbot-heading {
  min-width: 0;
}

.lpinz-chatbot-title {
  color: var(--lpinz-navy);
  font-size: 1.9rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lpinz-chatbot-subtitle {
  margin-top: 6px;
  font-size: 1rem;
  color: #5379a2;
}

.lpinz-chatbot-scope {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d7e3ef;
  background: #fffefa;
  color: var(--lpinz-ink);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.lpinz-chatbot-scope-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lpinz-gold);
  box-shadow: 0 0 0 5px rgba(255, 194, 14, 0.18);
  flex: 0 0 10px;
}

.lpinz-chatbot-body-embedded {
  padding: 24px 26px;
  min-height: 420px;
}

.lpinz-chatbot-embedded .lpinz-chatbot-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 220px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.lpinz-chatbot-message {
  width: fit-content;
  max-width: min(92%, 920px);
  padding: 18px 20px;
  border-radius: 22px;
  line-height: 1.7;
  font-size: 1rem;
}

.lpinz-chatbot-message p {
  margin: 0;
  white-space: pre-wrap;
}

.lpinz-chatbot-embedded .lpinz-chatbot-message-assistant {
  align-self: flex-start;
  background: var(--lpinz-white);
  border: 1px solid var(--lpinz-line);
  color: var(--lpinz-ink);
  box-shadow: 0 8px 24px rgba(15, 79, 138, 0.05);
}

.lpinz-chatbot-embedded .lpinz-chatbot-message-user {
  align-self: flex-end;
  background: #eaf3fd;
  border: 1px solid #c7d8eb;
  color: var(--lpinz-navy);
}

.lpinz-chatbot-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.lpinz-chatbot-chip {
  appearance: none;
  border: 1px solid #c8d8ea;
  background: var(--lpinz-white);
  color: var(--lpinz-navy);
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 79, 138, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lpinz-chatbot-chip:hover {
  transform: translateY(-1px);
  border-color: var(--lpinz-gold);
  box-shadow: 0 10px 22px rgba(15, 79, 138, 0.09);
  background: #fffdfa;
}

.lpinz-chatbot-sources {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dbe7f2;
  font-size: 0.95rem;
}

.lpinz-chatbot-sources strong {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--lpinz-navy);
}

.lpinz-chatbot-sources ol {
  margin: 0;
  padding-left: 22px;
}

.lpinz-chatbot-sources li + li {
  margin-top: 6px;
}

.lpinz-chatbot-source-number {
  color: #5f7ea6;
  font-weight: 700;
}

.lpinz-chatbot-sources a {
  color: var(--lpinz-navy);
  text-decoration: underline;
  text-decoration-color: rgba(15, 79, 138, 0.35);
}

.lpinz-chatbot-privacy {
  margin-top: 20px;
  font-size: 0.82rem;
  color: #6f87a7;
}

.lpinz-chatbot-form-embedded {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px 26px 26px;
  border-top: 1px solid var(--lpinz-line);
  background: rgba(255, 255, 255, 0.68);
}

.lpinz-chatbot-form-embedded textarea {
  width: 100%;
  min-height: 66px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid #bbcee3;
  border-radius: 18px;
  padding: 18px 20px;
  font: inherit;
  font-size: 1rem;
  color: var(--lpinz-ink);
  background: var(--lpinz-white);
  outline: none;
}

.lpinz-chatbot-form-embedded textarea:focus {
  border-color: var(--lpinz-gold);
  box-shadow: 0 0 0 4px rgba(255, 194, 14, 0.18);
}

.lpinz-chatbot-form-embedded textarea::placeholder {
  color: #8aa0bb;
}

.lpinz-chatbot-form-embedded button,
.lpinz-chatbot-floating .lpinz-chatbot-form button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--lpinz-blue) 0%, var(--lpinz-navy) 100%);
  color: #ffffff !important;
  min-width: 100px;
  min-height: 56px;
  padding: 0 24px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 79, 138, 0.28);
  overflow: visible;
}

.lpinz-chatbot-form-embedded button span,
.lpinz-chatbot-floating .lpinz-chatbot-form button span {
  display: inline-block;
  color: #ffffff !important;
  visibility: visible;
}

.lpinz-chatbot-form-embedded button:hover,
.lpinz-chatbot-floating .lpinz-chatbot-form button:hover {
  filter: brightness(1.03);
}

.lpinz-chatbot-form-embedded button:disabled,
.lpinz-chatbot-floating .lpinz-chatbot-form button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lpinz-chatbot-floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 48px));
  z-index: 99999;
}

.lpinz-chatbot-floating .lpinz-chatbot-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 100%;
  background: var(--lpinz-white);
  border: 1px solid var(--lpinz-line);
  border-top: 4px solid var(--lpinz-gold);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 79, 138, 0.14);
  overflow: hidden;
}

.lpinz-chatbot-floating.is-open .lpinz-chatbot-panel {
  display: block;
}

.lpinz-chatbot-launcher {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lpinz-blue) 0%, var(--lpinz-navy) 100%);
  color: #fff;
  padding: 14px 18px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(15, 79, 138, 0.35);
  cursor: pointer;
}

.lpinz-chatbot-floating .lpinz-chatbot-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--lpinz-blue), var(--lpinz-navy));
  color: #fff;
}

.lpinz-chatbot-floating .lpinz-chatbot-title {
  font-size: 1rem;
  color: #fff;
}

.lpinz-chatbot-floating .lpinz-chatbot-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,0.9);
}

.lpinz-chatbot-floating .lpinz-chatbot-body {
  padding: 14px;
  background: var(--lpinz-soft);
}

.lpinz-chatbot-floating .lpinz-chatbot-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.lpinz-chatbot-floating .lpinz-chatbot-message {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 14px;
}

.lpinz-chatbot-floating .lpinz-chatbot-message-user {
  align-self: flex-end;
  background: #eaf3fd;
  color: var(--lpinz-navy);
}

.lpinz-chatbot-floating .lpinz-chatbot-message-assistant {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #dbe6f1;
  color: var(--lpinz-ink);
}

.lpinz-chatbot-floating .lpinz-chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #e0e8f2;
  background: #fff;
}

.lpinz-chatbot-floating .lpinz-chatbot-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  max-height: 140px;
  border: 1px solid #c6d8ea;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--lpinz-ink);
}

@media (max-width: 900px) {
  .lpinz-chatbot-header-embedded {
    flex-direction: column;
    align-items: flex-start;
  }

  .lpinz-chatbot-title {
    font-size: 1.55rem;
  }
}

@media (max-width: 640px) {
  .lpinz-chatbot-embedded .lpinz-chatbot-panel {
    border-radius: 20px;
  }

  .lpinz-chatbot-header-embedded,
  .lpinz-chatbot-body-embedded,
  .lpinz-chatbot-form-embedded {
    padding-left: 16px;
    padding-right: 16px;
  }

  .lpinz-chatbot-body-embedded {
    min-height: 340px;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .lpinz-chatbot-chip-row {
    gap: 10px;
  }

  .lpinz-chatbot-chip {
    width: 100%;
  }

  .lpinz-chatbot-form-embedded {
    grid-template-columns: 1fr;
  }

  .lpinz-chatbot-form-embedded button {
    width: 100%;
  }

  .lpinz-chatbot-message {
    max-width: 100%;
    padding: 16px;
  }

  .lpinz-chatbot-floating {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}
