.kl-chat-root,
.kl-chat-root * {
  box-sizing: border-box;
}

.kl-chat-root {
  --kl-gold: #b9975b;
  --kl-gold-dark: #8e6e37;
  --kl-ink: #161616;
  --kl-paper: #ffffff;
  --kl-soft: #f4f1eb;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: inherit, Arial, sans-serif;
}

.kl-chat-launcher {
  border: 0;
  border-radius: 999px;
  background: var(--kl-ink);
  color: #fff;
  min-height: 54px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 12px 35px rgba(0,0,0,.22);
  font-size: 15px;
  font-weight: 600;
}

.kl-chat-launcher:hover {
  transform: translateY(-1px);
}

.kl-chat-launcher-icon {
  color: var(--kl-gold);
  font-size: 19px;
}

.kl-chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 110px));
  background: var(--kl-paper);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(0,0,0,.26);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease;
}

.kl-chat-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.kl-chat-header {
  background: var(--kl-ink);
  color: #fff;
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kl-chat-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
}

.kl-chat-subtitle {
  margin-top: 2px;
  color: #d7c49e;
  font-size: 12px;
}

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

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

.kl-msg {
  display: flex;
  margin: 8px 0;
}

.kl-msg-user {
  justify-content: flex-end;
}

.kl-bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.kl-msg-bot .kl-bubble {
  background: #fff;
  color: #222;
  border: 1px solid rgba(0,0,0,.06);
  border-bottom-left-radius: 5px;
}

.kl-msg-user .kl-bubble {
  background: var(--kl-ink);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.kl-chat-form {
  padding: 12px;
  display: flex;
  gap: 9px;
  align-items: flex-end;
  border-top: 1px solid rgba(0,0,0,.08);
  background: #fff;
}

.kl-chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 43px;
  max-height: 110px;
  padding: 11px 12px;
  border: 1px solid #d6d2ca;
  border-radius: 13px;
  outline: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.kl-chat-form textarea:focus {
  border-color: var(--kl-gold);
  box-shadow: 0 0 0 2px rgba(185,151,91,.13);
}

.kl-chat-form button {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 12px;
  background: var(--kl-gold);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.kl-chat-form button:hover {
  background: var(--kl-gold-dark);
}

.kl-chat-form button:disabled {
  opacity: .55;
  cursor: default;
}

.kl-chat-note {
  padding: 0 13px 10px;
  background: #fff;
  color: #817b72;
  font-size: 10px;
  text-align: center;
}

.kl-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 50px;
}

.kl-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: klTyping 1s infinite ease-in-out;
}

.kl-typing span:nth-child(2) { animation-delay: .15s; }
.kl-typing span:nth-child(3) { animation-delay: .30s; }

@keyframes klTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 600px) {
  .kl-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .kl-chat-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 76px;
    width: auto;
    height: min(650px, calc(100vh - 94px));
    border-radius: 18px;
  }

  .kl-chat-launcher-label {
    display: inline;
    white-space: nowrap;
  }

  .kl-chat-launcher {
    width: auto;
    min-height: 52px;
    padding: 0 18px;
    justify-content: center;
    gap: 9px;
    font-size: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
  }

  .kl-chat-launcher-icon {
    font-size: 18px;
  }
}

.kl-quote-action {
  max-width: 88%;
  padding: 12px 13px;
  border: 1px solid #ead9b8;
  border-radius: 14px;
  background: #fffaf0;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.kl-quote-action-text {
  margin-bottom: 9px;
  color: #2b2925;
  font-size: 13px;
  line-height: 1.4;
}

.kl-quote-action-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--kl-gold);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.kl-quote-action-button:hover { background: var(--kl-gold-dark); }

/* Compact track CTA; leave the calculator quotation action unchanged. */
.kl-chat-root .kl-track-quote-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--kl-ink);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.kl-chat-root .kl-track-quote-button:hover {
  color: #fff;
  text-decoration: none;
}

.kl-chat-root .kl-track-quote-button:focus-visible {
  outline: 2px solid var(--kl-ink);
  outline-offset: 3px;
}
