:root {
  --slta-brand: #2563eb;
  --slta-brand-ink: #ffffff;
  --slta-brand-dark: #1d4ed8;
  --slta-radius: 14px;
  --slta-z: 2147483000;
}

/* ---------- Launcher (pill) ---------- */
.shopline-talk-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--slta-brand);
  color: var(--slta-brand-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  z-index: var(--slta-z);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shopline-talk-chat-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.shopline-talk-chat-launcher.is-open {
  display: none;
}

/* ---------- Panel ---------- */
.shopline-talk-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 372px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--slta-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--slta-z);
  font-family: inherit;
  color: #1f2328;
}
.shopline-talk-chat-panel.open {
  display: flex;
}

/* ---------- Header ---------- */
.shopline-talk-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--slta-brand);
  color: var(--slta-brand-ink);
  flex: 0 0 auto;
}
.shopline-talk-chat-title {
  font-weight: 800;
  font-size: 16px;
}
.shopline-talk-chat-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.shopline-talk-chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.shopline-talk-chat-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--slta-brand-ink);
  border-radius: 2px;
}
.shopline-talk-chat-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 6px;
  margin-left: 6px;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shopline-talk-chat-close-btn:hover {
  opacity: 0.65;
}

/* ---------- Messages ---------- */
.shopline-talk-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fa;
}
.shopline-talk-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.shopline-talk-msg.user {
  align-self: flex-end;
  background: #e9ecf2;
  color: #1f2328;
  border-bottom-right-radius: 4px;
}
.shopline-talk-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
/* Markdown rendering inside bot messages */
.shopline-talk-msg-text {
  white-space: normal;
  word-wrap: break-word;
}
.shopline-talk-msg-text p,
.shopline-talk-msg-text ul,
.shopline-talk-msg-text ol {
  margin: 4px 0;
  padding-left: 18px;
}
.shopline-talk-msg-text ul,
.shopline-talk-msg-text ol {
  padding-left: 20px;
}
.shopline-talk-msg-text li {
  margin: 2px 0;
}
.shopline-talk-msg-text strong {
  font-weight: 700;
}
.shopline-talk-msg-text em {
  font-style: italic;
}
.shopline-talk-msg-text code {
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.shopline-talk-msg-text a {
  color: var(--slta-brand);
  text-decoration: underline;
}

/* ---------- Product card ---------- */
.shopline-talk-product-card {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.shopline-talk-product-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: #f3f4f6;
}
.shopline-talk-product-card .body {
  padding: 10px 12px 12px;
}
.shopline-talk-product-card .title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 4px;
  color: #1f2328;
}
.shopline-talk-product-card .price {
  font-weight: 800;
  font-size: 15px;
  color: var(--slta-brand-ink);
  margin: 0 0 8px;
}
.shopline-talk-product-card .cta {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: var(--slta-brand);
  color: var(--slta-brand-ink);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin-top: 4px;
}
.shopline-talk-product-card .cta:hover {
  background: var(--slta-brand-dark);
}

/* ---------- Order / Quote card ---------- */
.shopline-talk-order-card,
.shopline-talk-quote-card {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  font-size: 13px;
}
.shopline-talk-order-card .head,
.shopline-talk-quote-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.shopline-talk-order-card .num,
.shopline-talk-quote-card .num {
  font-weight: 800;
}
.shopline-talk-order-card .status,
.shopline-talk-quote-card .status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1ff;
  color: #2c41ff;
}
.shopline-talk-order-card .row,
.shopline-talk-quote-card .row {
  display: flex;
  justify-content: space-between;
  margin: 2px 0;
  color: #444;
}
.shopline-talk-order-card .items,
.shopline-talk-quote-card .items {
  margin: 6px 0;
  padding-left: 16px;
  color: #555;
}
.shopline-talk-order-card .link,
.shopline-talk-quote-card .link {
  display: inline-block;
  margin-top: 8px;
  color: #2c41ff;
  text-decoration: none;
  font-weight: 600;
}

/* ---------- Lookup form ---------- */
.shopline-talk-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.shopline-talk-form input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.shopline-talk-form .actions {
  display: flex;
  gap: 8px;
}
.shopline-talk-form button {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.shopline-talk-form .submit {
  background: var(--slta-brand);
  color: var(--slta-brand-ink);
}
.shopline-talk-form .cancel {
  background: #eef1f4;
  color: #555;
}

/* ---------- Input + footer ---------- */
.shopline-talk-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  background: #fff;
  flex: 0 0 auto;
}
.shopline-talk-chat-input input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
}
.shopline-talk-send {
  border: none;
  background: var(--slta-brand);
  color: var(--slta-brand-ink);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.shopline-talk-send:disabled {
  opacity: 0.5;
}

.shopline-talk-quick {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  background: #fff;
  flex: 0 0 auto;
}
.shopline-talk-quick button {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #444;
}
.shopline-talk-quick button:hover,
.shopline-talk-quick button:focus {
  border-color: var(--slta-brand);
  color: var(--slta-brand);
  background: #eff6ff;
}
.shopline-talk-quick button:active {
  border-color: var(--slta-brand-dark);
  color: var(--slta-brand-dark);
  background: #dbeafe;
}

/* ---------- Typing indicator ---------- */
.shopline-talk-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 11px 14px;
}
.shopline-talk-typing .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa1ad;
  animation: shopline-talk-blink 1.2s infinite ease-in-out;
}
.shopline-talk-typing .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.shopline-talk-typing .dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes shopline-talk-blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

/* ---------- Privacy consent ---------- */
.shopline-talk-consent {
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}
.shopline-talk-consent button {
  align-self: flex-end;
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: var(--slta-brand);
  color: var(--slta-brand-ink);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}

/* ---------- Support popover ---------- */
.shopline-talk-support {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  font-size: 13px;
}
.shopline-talk-support a {
  color: #2c41ff;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Menu ---------- */
.shopline-talk-menu {
  position: absolute;
  top: 52px;
  right: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: var(--slta-z);
  display: none;
  flex-direction: column;
  min-width: 160px;
}
.shopline-talk-menu.open {
  display: flex;
}
.shopline-talk-menu button {
  text-align: left;
  background: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}
.shopline-talk-menu button:hover {
  background: #f3f4f6;
}
