.kevora-chat {
  --kevora-chat-ink: #1a2b32;
  --kevora-chat-bone: #f6f4ee;
  --kevora-chat-teal: #2f7d7b;
  --kevora-chat-teal-deep: #1f5a58;
  --kevora-chat-line: #d9d5cb;
  --kevora-chat-muted: #6b7177;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147480000;
  color: var(--kevora-chat-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.kevora-chat *,
.kevora-chat *::before,
.kevora-chat *::after {
  box-sizing: border-box;
}

.kevora-chat [hidden] {
  display: none !important;
}

.kevora-chat button,
.kevora-chat input,
.kevora-chat textarea {
  font: inherit;
}

.kevora-chat button {
  cursor: pointer;
}

.kevora-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--kevora-chat-teal);
  box-shadow: 0 8px 28px rgba(0, 15, 12, 0.28);
  font-size: 14px;
  font-weight: 700;
}

.kevora-chat__launcher:hover {
  background: var(--kevora-chat-teal-deep);
  transform: translateY(-1px);
}

.kevora-chat__panel {
  display: flex;
  position: absolute;
  right: 0;
  bottom: 0;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 48px));
  height: min(640px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 18px;
  background: var(--kevora-chat-bone);
  box-shadow: 0 18px 55px rgba(0, 15, 12, 0.3);
}

.kevora-chat__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  color: var(--kevora-chat-bone);
  background: var(--kevora-chat-ink);
}

.kevora-chat__header strong,
.kevora-chat__header span {
  display: block;
}

.kevora-chat__header strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.kevora-chat__header span {
  margin-top: 2px;
  color: #a9b6ba;
  font-size: 11.5px;
}

.kevora-chat__close,
.kevora-chat__form-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 25px;
  line-height: 1;
}

.kevora-chat__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.kevora-chat__messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.kevora-chat__message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.kevora-chat__message--user {
  align-self: flex-end;
  align-items: flex-end;
}

.kevora-chat__message--bot {
  align-self: flex-start;
  align-items: flex-start;
}

.kevora-chat__bubble {
  padding: 10px 13px;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 13px;
  background: #fff;
  font-size: 13.5px;
  white-space: pre-line;
}

.kevora-chat__message--user .kevora-chat__bubble {
  border-color: var(--kevora-chat-teal);
  color: #fff;
  background: var(--kevora-chat-teal);
}

.kevora-chat__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
}

.kevora-chat__actions button {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 10px;
  color: var(--kevora-chat-ink);
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
}

.kevora-chat__actions button:hover {
  border-color: var(--kevora-chat-teal);
  color: var(--kevora-chat-teal-deep);
}

.kevora-chat__typing {
  display: flex;
  align-self: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 13px;
  background: #fff;
}

.kevora-chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kevora-chat-muted);
  animation: kevora-chat-blink 1.15s infinite ease-in-out;
}

.kevora-chat__typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.kevora-chat__typing span:nth-child(3) {
  animation-delay: 0.32s;
}

.kevora-chat__capture {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  border-top: 1px solid var(--kevora-chat-line);
  background: #fff;
}

.kevora-chat__form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kevora-chat__form-heading strong {
  font-size: 14px;
}

.kevora-chat__form-close {
  color: var(--kevora-chat-muted);
}

.kevora-chat__field {
  display: block;
  margin-bottom: 10px;
}

.kevora-chat__field > span,
.kevora-chat__choice legend {
  display: block;
  margin-bottom: 4px;
  color: var(--kevora-chat-muted);
  font-size: 11.5px;
}

.kevora-chat__field input,
.kevora-chat__field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 8px;
  color: var(--kevora-chat-ink);
  background: #fff;
  font-size: 13px;
  outline: none;
}

.kevora-chat__field textarea {
  min-height: 74px;
  resize: vertical;
}

.kevora-chat__field input:focus,
.kevora-chat__field textarea:focus {
  border-color: var(--kevora-chat-teal);
  box-shadow: 0 0 0 3px rgba(47, 125, 123, 0.12);
}

.kevora-chat__choice {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}

.kevora-chat__choice legend {
  width: 100%;
}

.kevora-chat__choice label {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

.kevora-chat__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 12px;
  color: var(--kevora-chat-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.kevora-chat__consent input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.kevora-chat__consent a {
  color: var(--kevora-chat-teal-deep);
  font-weight: 700;
}

.kevora-chat__honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.kevora-chat__form-status {
  min-height: 18px;
  margin-bottom: 7px;
  color: #9b2c2c;
  font-size: 11.5px;
}

.kevora-chat__submit {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--kevora-chat-teal);
  font-size: 13px;
  font-weight: 700;
}

.kevora-chat__submit:hover {
  background: var(--kevora-chat-teal-deep);
}

.kevora-chat__submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.kevora-chat__composer {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid var(--kevora-chat-line);
  background: #fff;
}

.kevora-chat__composer input {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--kevora-chat-line);
  border-radius: 9px;
  color: var(--kevora-chat-ink);
  background: #fff;
  font-size: 13px;
  outline: none;
}

.kevora-chat__composer input:focus {
  border-color: var(--kevora-chat-teal);
  box-shadow: 0 0 0 3px rgba(47, 125, 123, 0.12);
}

.kevora-chat__composer button {
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--kevora-chat-teal);
  font-size: 12.5px;
  font-weight: 700;
}

.kevora-chat__attribution {
  flex: 0 0 auto;
  padding: 5px 10px 7px;
  color: #a5aaae;
  background: #fff;
  font-size: 9.5px;
  text-align: center;
}

.kevora-chat__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.kevora-chat button:focus-visible,
.kevora-chat input:focus-visible,
.kevora-chat textarea:focus-visible,
.kevora-chat a:focus-visible {
  outline: 3px solid #b9f227;
  outline-offset: 2px;
}

@keyframes kevora-chat-blink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 640px) {
  .kevora-chat {
    right: 10px;
    bottom: 10px;
  }

  .kevora-chat__panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    border-radius: 15px;
  }

  .kevora-chat__launcher {
    min-height: 46px;
    padding: 11px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kevora-chat *,
  .kevora-chat *::before,
  .kevora-chat *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
