:root {
  --jt-chat-ink: #202536;
  --jt-chat-muted: #697086;
  --jt-chat-border: #e4e7ef;
  --jt-chat-surface: #ffffff;
  --jt-chat-soft: #f5f7fa;
  --jt-chat-accent: #635bff;
  --jt-chat-accent-dark: #5147e8;
  --jt-chat-shadow: 0 24px 70px rgba(32, 37, 54, 0.18);
}

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

.jt-chatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  color: var(--jt-chat-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.jt-chat-launcher {
  min-height: 60px;
  padding: 10px 16px 10px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(99, 91, 255, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: var(--jt-chat-ink);
  box-shadow: 0 14px 34px rgba(32, 37, 54, 0.16);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.jt-chat-launcher:hover,
.jt-chat-launcher:focus-visible {
  border-color: rgba(99, 91, 255, 0.42);
  box-shadow: 0 18px 40px rgba(32, 37, 54, 0.22);
  outline: none;
}

.jt-chat-launcher-icon {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  border-radius: 14px;
}

.jt-chat-launcher-text {
  white-space: nowrap;
  font-size: 14px;
}

.jt-chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(400px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 110px));
  display: none;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--jt-chat-border);
  border-radius: 24px;
  background: var(--jt-chat-surface);
  box-shadow: var(--jt-chat-shadow);
}

.jt-chatbot.is-open .jt-chat-panel {
  display: grid;
}

.jt-chat-header {
  padding: 18px 18px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--jt-chat-border);
  background: linear-gradient(135deg, #fafaff, #f3fffd);
}

.jt-chat-header-icon {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
  border-radius: 18px;
}

.jt-chat-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.jt-chat-subtitle {
  margin: 4px 0 0;
  color: var(--jt-chat-muted);
  font-size: 12px;
  line-height: 1.4;
}

.jt-chat-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--jt-chat-border);
  border-radius: 50%;
  background: #fff;
  color: var(--jt-chat-ink);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.jt-chat-log {
  padding: 16px;
  overflow-y: auto;
  background: #ffffff;
}

.jt-chat-message {
  max-width: 88%;
  margin: 0 0 11px;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
}

.jt-chat-message.is-assistant {
  margin-right: auto;
  border: 1px solid var(--jt-chat-border);
  border-bottom-left-radius: 5px;
  background: var(--jt-chat-soft);
}

.jt-chat-message.is-user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: var(--jt-chat-accent);
  color: #ffffff;
}

.jt-chat-message p {
  margin: 0;
}

.jt-chat-message p + p {
  margin-top: 8px;
}

.jt-chat-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.jt-chat-link {
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(99, 91, 255, 0.22);
  border-radius: 999px;
  background: #ffffff;
  color: var(--jt-chat-accent-dark);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.jt-chat-suggestions {
  margin-top: 13px;
  display: grid;
  gap: 8px;
}

.jt-chat-suggestion {
  padding: 10px 12px;
  border: 1px solid var(--jt-chat-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--jt-chat-ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.jt-chat-suggestion:hover,
.jt-chat-suggestion:focus-visible {
  border-color: rgba(99, 91, 255, 0.45);
  background: #fafaff;
  outline: none;
}

.jt-chat-footer {
  padding: 12px;
  border-top: 1px solid var(--jt-chat-border);
  background: #ffffff;
}

.jt-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.jt-chat-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--jt-chat-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--jt-chat-ink);
  font: inherit;
  font-size: 13px;
}

.jt-chat-input:focus {
  border-color: var(--jt-chat-accent);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.10);
  outline: none;
}

.jt-chat-send {
  min-width: 72px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--jt-chat-accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.jt-chat-send:hover,
.jt-chat-send:focus-visible {
  background: var(--jt-chat-accent-dark);
  outline: none;
}

.jt-chat-disclaimer {
  margin: 8px 2px 0;
  color: var(--jt-chat-muted);
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 560px) {
  .jt-chatbot {
    right: 12px;
    bottom: 12px;
  }

  .jt-chat-panel {
    right: 0;
    bottom: 70px;
    width: calc(100vw - 24px);
    height: min(70vh, 640px);
  }

  .jt-chat-launcher {
    min-height: 54px;
    padding-right: 14px;
  }

  .jt-chat-launcher-icon {
    width: 38px;
    height: 38px;
  }

  .jt-chat-launcher-text {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jt-chatbot *,
  .jt-chatbot *::before,
  .jt-chatbot *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
