﻿
:root {
  --kavehchat-grad: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.kavehchat {

  --h-primary: #2563eb;
  --h-primary-hover: #1d4ed8;
  --h-primary-light: #eff6ff;
  --h-primary-ring: rgba(37, 99, 235, 0.18);
  --h-ink: #0f172a;
  --h-ink-secondary: #334155;
  --h-muted: #64748b;
  --h-muted-light: #94a3b8;
  --h-border: #e2e8f0;
  --h-border-subtle: #f1f5f9;
  --h-bg: #ffffff;
  --h-surface: #f8fafc;
  --h-online: #10b981;
  --h-danger: #e11d48;
  --h-amber: #f59e0b;
  --h-radius-lg: 18px;
  --h-radius-md: 14px;
  --h-radius-sm: 10px;
  --h-radius-xs: 6px;
  --h-shadow-fab: 0 10px 25px -3px rgba(37, 99, 235, 0.35), 0 4px 10px -2px rgba(37, 99, 235, 0.2);
  --h-shadow-window: 0 20px 45px -10px rgba(15, 23, 42, 0.18), 0 8px 18px -4px rgba(15, 23, 42, 0.08);
  --h-shadow-card: 0 2px 8px -1px rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  --h-font: Vazirmatn, Shabnam, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  position: fixed;
  bottom: 24px;
  z-index: 999999;
  font-family: var(--h-font);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--h-ink);
  box-sizing: border-box;
}

.kavehchat *,
.kavehchat *::before,
.kavehchat *::after {
  box-sizing: border-box;
}

.kavehchat [hidden] {
  display: none !important;
}

.kavehchat button,
.kavehchat input,
.kavehchat select,
.kavehchat textarea {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.kavehchat.kavehchat-left {
  left: 24px;
}

.kavehchat.kavehchat-right {
  right: 24px;
}

.kavehchat-fab,
.kavehchat-fab.lc-launcher {
  position: relative;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--h-shadow-fab);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease;
  overflow: visible;
}

.kavehchat-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px -4px rgba(37, 99, 235, 0.45), 0 6px 14px -2px rgba(37, 99, 235, 0.25);
}

.kavehchat-fab:active {
  transform: scale(0.95);
}

.kavehchat-fab:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 4px;
}

.kavehchat-fab-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.3);
  animation: kavehchat-pulse-ring 3s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes kavehchat-pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  60% {
    transform: scale(1.22);
    opacity: 0;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

.lc-launcher-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lc-icon-open {
  opacity: 1;
  transform: scale(1);
}

.lc-icon-close {
  opacity: 0;
  transform: scale(0.6) rotate(-45deg);
}

.kavehchat[data-closed="0"] .lc-icon-open {
  opacity: 0;
  transform: scale(0.6) rotate(45deg);
}

.kavehchat[data-closed="0"] .lc-icon-close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.kavehchat.kavehchat-right .lc-icon-open svg {
  transform: scaleX(-1);
}

.kavehchat-fab-dot,
.kavehchat-fab-dot.lc-online-dot {
  position: absolute;
  top: 1px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--h-online);
  border: 2.5px solid #ffffff;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.kavehchat-fab-badge,
.kavehchat-fab-badge.lc-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f43f5e, var(--h-danger));
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.35);
  z-index: 2;
  animation: kavehchat-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes kavehchat-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.kavehchat[data-closed="0"] .kavehchat-fab {
  display: none;
}

.lc-eyecatcher {
  position: absolute;
  bottom: 74px;
  width: 280px;
  max-width: calc(100vw - 48px);
  z-index: 5;
  animation: kavehchat-float-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kavehchat-float-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.kavehchat.kavehchat-left .lc-eyecatcher {
  left: 0;
}

.kavehchat.kavehchat-right .lc-eyecatcher {
  right: 0;
}

.lc-eyecatcher-bubble {
  display: block;
  width: 100%;
  text-align: right;
  background: #ffffff;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-md);
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--h-ink);
  cursor: pointer;
  box-shadow: var(--h-shadow-window);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.lc-eyecatcher-bubble:hover {
  border-color: var(--h-primary);
  transform: translateY(-2px);
}

.kavehchat.kavehchat-left .lc-eyecatcher-bubble {
  border-bottom-left-radius: 4px;
}

.kavehchat.kavehchat-right .lc-eyecatcher-bubble {
  border-bottom-right-radius: 4px;
}

.lc-eyecatcher-agent {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lc-eyecatcher-textwrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.lc-eyecatcher-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--h-ink);
}

.lc-eyecatcher-text {
  font-size: 12.5px;
  color: var(--h-muted);
  line-height: 1.5;
}

.lc-eyecatcher-x {
  position: absolute;
  top: -8px;
  inset-inline-end: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--h-border);
  background: #ffffff;
  color: var(--h-muted);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--h-shadow-card);
  transition: background 0.15s ease, color 0.15s ease;
}

.lc-eyecatcher-x:hover {
  background: var(--h-surface);
  color: var(--h-ink);
}

.kavehchat-panel,
.kavehchat-panel.lc-window {
  position: relative;
  width: 396px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 100px);
  background: var(--h-bg);
  border-radius: var(--h-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--h-shadow-window);
  border: 1px solid var(--h-border);
  transition: box-shadow 0.2s ease;
}

.kavehchat[data-closed="0"] .kavehchat-panel {
  animation: kavehchat-window-open 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kavehchat-window-open {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.kavehchat-header,
.lc-titlebar {
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kavehchat-avatar-stack,
.lc-agents {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
}

.lc-agent-avatar,
.kavehchat-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  overflow: visible;
  flex: 0 0 40px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  color: #ffffff;
}

.kavehchat-avatar img,
.lc-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.kavehchat-avatar .kavehchat-presence {
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9ca3af;
  border: 2px solid #ffffff;
  z-index: 2;
}

.kavehchat-avatar .kavehchat-presence.on {
  background: var(--h-online);
}

.kavehchat-avatar-stack.multi .kavehchat-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 13px;
  margin-inline-start: -10px;
}

.kavehchat-avatar-stack.multi .kavehchat-avatar:first-child {
  margin-inline-start: 0;
}

.lc-titlebar-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.lc-titlebar-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.kavehchat-head-status,
.lc-statuspill {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.lc-statuspill-dot,
#kavehchat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#kavehchat-dot.on {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.35);
}

.lc-titlebar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lc-titlebar-btn,
.kavehchat-iconbtn {
  width: 32px;
  height: 32px;
  border-radius: var(--h-radius-xs);
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.lc-titlebar-btn:hover,
.kavehchat-iconbtn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}

.lc-connbar,
.kavehchat-conn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  font-size: 12.5px;
  color: #1e40af;
}

.lc-spinner,
.kavehchat-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #bfdbfe;
  border-top-color: var(--h-primary);
  animation: kavehchat-spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes kavehchat-spin {
  to {
    transform: rotate(360deg);
  }
}

.lc-conn-retry,
.kavehchat-link {
  background: none;
  border: 0;
  color: var(--h-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  margin-inline-start: auto;
}

.lc-prechat,
.kavehchat-startform {
  padding: 18px 16px;
  background: var(--h-surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--h-border);
}

.kavehchat-panel.kavehchat-locked .kavehchat-messages,
.kavehchat-panel.kavehchat-locked .kavehchat-extras,
.kavehchat-panel.kavehchat-locked .kavehchat-inputbar,
.kavehchat-panel.kavehchat-locked .kavehchat-typing {
  display: none !important;
}

.kavehchat-panel.kavehchat-locked .kavehchat-startform {
  display: flex;
  flex: 1;
  border-bottom: 0;
}

.lc-prechat-card,
.kavehchat-startform-card {
  background: #ffffff;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-md);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--h-shadow-card);
  margin: auto 0;
}

.lc-prechat-desc,
.kavehchat-startform-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--h-ink-secondary);
  background: var(--h-primary-light);
  border: 1px solid #dbeafe;
  border-radius: var(--h-radius-sm);
  padding: 11px 13px;
}

.lc-prechat-fields,
.kavehchat-startform-fields {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.kavehchat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kavehchat-field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--h-ink-secondary);
}

.kavehchat-field-label .kavehchat-req {
  color: var(--h-danger);
  margin-inline-start: 2px;
}

.kavehchat-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.kavehchat-field-icon {
  position: absolute;
  inset-inline-start: 12px;
  display: flex;
  color: var(--h-muted);
  pointer-events: none;
}

.kavehchat-field-wrap input,
.kavehchat-topic {
  width: 100%;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  background: #ffffff;
  color: var(--h-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kavehchat-field-wrap input {
  padding-inline-start: 36px;
}

.kavehchat-field-wrap input:focus,
.kavehchat-topic:focus {
  outline: none;
  border-color: var(--h-primary);
  box-shadow: 0 0 0 3px var(--h-primary-ring);
}

.kavehchat-field-wrap input.kavehchat-invalid {
  border-color: var(--h-danger);
  background: #fff1f2;
}

.kavehchat-field-err {
  font-size: 11.5px;
  color: var(--h-danger);
  font-weight: 600;
}

.kavehchat-field-err:empty {
  display: none;
}

.lc-prechat-error,
.kavehchat-startform-error {
  margin: 0;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 12.5px;
  border-radius: var(--h-radius-sm);
  padding: 9px 12px;
  line-height: 1.5;
}

.lc-prechat-submit,
.kavehchat-btn-primary {
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff;
  border: 0;
  border-radius: var(--h-radius-sm);
  padding: 11px 16px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.lc-prechat-submit:hover,
.kavehchat-btn-primary:hover {
  background: var(--h-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.lc-prechat-submit:active,
.kavehchat-btn-primary:active {
  transform: scale(0.98);
}

.lc-prechat-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.lc-prechat-privacy,
.kavehchat-startform-privacy {
  font-size: 11.5px;
  color: var(--h-muted);
  line-height: 1.5;
  text-align: center;
}

.lc-transcript,
.kavehchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--h-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.lc-transcript::-webkit-scrollbar,
.kavehchat-messages::-webkit-scrollbar {
  width: 5px;
}

.lc-transcript::-webkit-scrollbar-track,
.kavehchat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.lc-transcript::-webkit-scrollbar-thumb,
.kavehchat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.kavehchat-msg {
  max-width: 82%;
  padding: 10px 14px 8px;
  font-size: 13.8px;
  line-height: 1.7;
  position: relative;
  word-break: break-word;
  animation: kavehchat-bubble-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

@keyframes kavehchat-bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kavehchat-msg.user {
  align-self: flex-start;
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff;
  border-radius: var(--h-radius-md);
  border-bottom-right-radius: 4px;
}

.kavehchat-msg.user small {
  color: rgba(255, 255, 255, 0.82);
}

.kavehchat-msg.agent {
  align-self: flex-end;
  background: #ffffff;
  color: var(--h-ink);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-md);
  border-bottom-left-radius: 4px;
}

.kavehchat-msg.system {
  align-self: center;
  background: #ffffff;
  color: var(--h-muted);
  font-size: 12px;
  border: 1px solid var(--h-border);
  border-radius: 999px;
  padding: 4px 14px;
  text-align: center;
  max-width: 90%;
  box-shadow: none;
}

.kavehchat-msg-error {
  align-self: center;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-size: 12.5px;
  border-radius: var(--h-radius-sm);
  padding: 6px 12px;
  max-width: 92%;
  text-align: center;
}

.kavehchat-sender {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--h-primary);
  margin-bottom: 2px;
  line-height: 1.4;
}

.kavehchat-msg.user .kavehchat-sender {
  color: rgba(255, 255, 255, 0.9);
}

.kavehchat-msg small {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--h-muted-light);
  margin-top: 4px;
  white-space: nowrap;
}

.kavehchat-msg-welcome {
  border-inline-start: 3px solid var(--h-primary);
}

.kavehchat-welcome-hi {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--h-ink);
  background: var(--h-primary-light);
  border: 1px solid #dbeafe;
  border-radius: var(--h-radius-xs);
  padding: 6px 10px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.kavehchat-welcome-hi b {
  color: var(--h-primary);
}

.kavehchat-bubble-text {
  line-height: 1.7;
}

.kavehchat-msg img {
  max-width: 100%;
  height: auto;
  border-radius: var(--h-radius-sm);
  margin-top: 4px;
  display: block;
}

.kavehchat-tick {
  font-size: 11px;
  font-weight: 700;
}

.kavehchat-tick.read {
  color: #93c5fd;
}

.kavehchat-msgrow {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.kavehchat-msgrow.agent {
  justify-content: flex-end;
}

.kavehchat-msgrow.agent .kavehchat-msg {
  max-width: calc(85% - 36px);
}

.kavehchat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h-muted);
  border: 1px solid var(--h-border);
}

.kavehchat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kavehchat-msg-avatar svg {
  width: 16px;
  height: 16px;
}

.kavehchat-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
}

.kavehchat-day::before,
.kavehchat-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--h-border);
}

.kavehchat-day span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--h-muted);
  background: #ffffff;
  border: 1px solid var(--h-border);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

.lc-agent-typing,
.kavehchat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid var(--h-border-subtle);
  font-size: 12px;
  color: var(--h-muted);
}

.lc-typing-dots,
.kavehchat-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.lc-typing-dots span,
.kavehchat-typing-dots span,
.kavehchat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--h-primary);
  opacity: 0.45;
  animation: kavehchat-typing-bounce 1.3s infinite ease-in-out;
}

.lc-typing-dots span:nth-child(2),
.kavehchat-typing span:nth-child(2) {
  animation-delay: 0.18s;
}

.lc-typing-dots span:nth-child(3),
.kavehchat-typing span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes kavehchat-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.kavehchat-typing em {
  font-style: normal;
}

.lc-composer,
.kavehchat-inputbar {
  display: flex;
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: #ffffff;
  border-top: 1px solid var(--h-border);
  align-items: center;
  flex-shrink: 0;
}

.lc-composer-wrap,
.kavehchat-inputwrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lc-composer textarea,
.kavehchat-inputbar textarea {
  width: 100%;
  border: 1px solid var(--h-border);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 13.8px;
  background: var(--h-surface);
  color: var(--h-ink);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.6;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.lc-composer textarea:focus,
.kavehchat-inputbar textarea:focus {
  outline: none;
  border-color: var(--h-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--h-primary-ring);
}

.kavehchat-count {
  font-size: 10.5px;
  color: var(--h-muted-light);
  text-align: left;
}

.lc-send,
.kavehchat-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.lc-send:hover,
.kavehchat-send:hover {
  background: var(--h-primary-hover);
  transform: scale(1.05);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.35);
}

.lc-send:active,
.kavehchat-send:active {
  transform: scale(0.94);
}

.lc-send:disabled,
.kavehchat-send:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.kavehchat-send svg {
  transform: scaleX(-1);
}

.lc-attach,
.kavehchat-filebtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  color: var(--h-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.lc-attach:hover,
.kavehchat-filebtn:hover {
  border-color: var(--h-primary);
  color: var(--h-primary);
  background: var(--h-primary-light);
}

.kavehchat-filebtn[hidden] {
  display: none !important;
}

.lc-rate,
.kavehchat-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--h-border);
  font-size: 13px;
  color: var(--h-ink-secondary);
  background: #ffffff;
}

.kavehchat-stars {
  display: flex;
  flex-direction: row-reverse;
  gap: 3px;
}

.kavehchat-stars button {
  background: none;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: #cbd5e1;
  line-height: 1;
  padding: 0 1px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.kavehchat-stars button:hover,
.kavehchat-stars button:hover ~ button {
  color: var(--h-amber);
  transform: scale(1.15);
}

.lc-resources,
.kavehchat-extras {
  display: none;
}

.kavehchat-head-faqbtn {
  position: relative;
}

.kavehchat-head-faqbtn svg {
  transition: transform 0.18s ease;
}

.kavehchat-head-faqbtn:hover svg {
  transform: scale(1.1);
}

.kavehchat-faq-header-badge {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  background: #f59e0b;
  color: #1e1e1e;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  border: 1.5px solid #ffffff;
}

.kavehchat.kavehchat-dark .kavehchat-faq-header-badge {
  border-color: #1e293b;
}

.kavehchat-welcome-faq-wrap {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kavehchat-welcome-faq-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 88, 233, 0.08);
  border: 1px solid rgba(56, 88, 233, 0.22);
  color: var(--h-primary);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.kavehchat-welcome-faq-chip:hover {
  background: var(--h-primary);
  color: #ffffff;
  border-color: var(--h-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(56, 88, 233, 0.3);
}

.kavehchat.kavehchat-dark .kavehchat-welcome-faq-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
}

.kavehchat.kavehchat-dark .kavehchat-welcome-faq-chip:hover {
  background: var(--h-primary);
  border-color: var(--h-primary);
  color: #ffffff;
}

.kavehchat-faq-btn-icon {
  display: flex;
  color: var(--h-primary);
  flex-shrink: 0;
}

.kavehchat-faq-btn-count {
  margin-inline-start: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--h-primary);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc-resources-view,
.kavehchat-faqview {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  border-radius: inherit;
  overflow: hidden;
  animation: kavehchat-slide-left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kavehchat-slide-left {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.lc-resources-head,
.kavehchat-faqview-head {
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lc-resources-back,
.kavehchat-faqback {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #ffffff;
  border-radius: var(--h-radius-xs);
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lc-resources-back:hover,
.kavehchat-faqback:hover {
  background: rgba(255, 255, 255, 0.3);
}

.kavehchat-faqback svg {
  transform: scaleX(-1);
}

.kavehchat-faqview-title {
  flex: 1;
  text-align: center;
  font-size: 14.5px;
  font-weight: 800;
}

.kavehchat-faqview-searchwrap {
  padding: 12px 14px 6px;
  background: #ffffff;
  flex-shrink: 0;
}

.kavehchat-faqview-search {
  width: 100%;
  border: 1px solid var(--h-border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  background: var(--h-surface);
  color: var(--h-ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.kavehchat-faqview-search:focus {
  outline: none;
  border-color: var(--h-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--h-primary-ring);
}

.kavehchat-faqview-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--h-surface);
}

.kavehchat-faqview-item {
  background: #ffffff;
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: var(--h-shadow-card);
}

.kavehchat-faqview-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--h-ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kavehchat-faqview-item summary::-webkit-details-marker {
  display: none;
}

.kavehchat-faqview-item summary + div {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--h-border);
  color: var(--h-ink-secondary);
  font-size: 13px;
}

.kavehchat.kavehchat-dark {
  --h-ink: #f8fafc;
  --h-ink-secondary: #cbd5e1;
  --h-muted: #94a3b8;
  --h-muted-light: #64748b;
  --h-border: #334155;
  --h-border-subtle: #1e293b;
  --h-bg: #0f172a;
  --h-surface: #1e293b;
  --h-primary-light: rgba(37, 99, 235, 0.2);
}

.kavehchat.kavehchat-dark .kavehchat-panel {
  background: #0f172a;
  border-color: #334155;
}

.kavehchat.kavehchat-dark .kavehchat-messages,
.kavehchat.kavehchat-dark .kavehchat-faqview-list,
.kavehchat.kavehchat-dark .kavehchat-startform {
  background: #1e293b;
}

.kavehchat.kavehchat-dark .kavehchat-msg.agent,
.kavehchat.kavehchat-dark .kavehchat-startform-card,
.kavehchat.kavehchat-dark .kavehchat-faqview-item {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.kavehchat.kavehchat-dark .kavehchat-extras,
.kavehchat.kavehchat-dark .kavehchat-inputbar,
.kavehchat.kavehchat-dark .kavehchat-typing,
.kavehchat.kavehchat-dark .kavehchat-rating,
.kavehchat.kavehchat-dark .kavehchat-faqview {
  background: #0f172a;
  border-color: #334155;
}

.kavehchat.kavehchat-dark .kavehchat-inputbar textarea,
.kavehchat.kavehchat-dark .kavehchat-field-wrap input,
.kavehchat.kavehchat-dark .kavehchat-faqview-search {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.kavehchat.kavehchat-dark .lc-eyecatcher-bubble {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.kavehchat.kavehchat-dark .kavehchat-day span {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

.kavehchat.kavehchat-dark .kavehchat-faq-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

@media (max-width: 640px) {
  .kavehchat[data-closed="1"] {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .kavehchat[data-closed="1"].kavehchat-left {
    left: 16px;
    right: auto;
  }

  .kavehchat[data-closed="1"].kavehchat-right {
    right: 16px;
    left: auto;
  }

  .kavehchat[data-closed="1"] .kavehchat-fab {
    width: 58px;
    height: 58px;
  }

  .kavehchat[data-closed="0"] {
    position: fixed;
    inset: 0;
    z-index: 999999;
  }

  .kavehchat[data-closed="0"] .kavehchat-panel {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .kavehchat-header,
  .lc-titlebar {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .kavehchat-msg {
    max-width: 86%;
  }

  .kavehchat-msgrow.agent .kavehchat-msg {
    max-width: calc(86% - 34px);
  }

  .kavehchat-inputbar textarea {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kavehchat-fab-ring,
  .kavehchat-spinner,
  .kavehchat-typing span {
    animation: none;
  }

  .kavehchat-panel,
  .kavehchat-msg,
  .lc-eyecatcher {
    animation: none;
  }
}

.kavehchat-filebtn.kavehchat-btn-loading {
  cursor: wait;
  opacity: 0.75;
  pointer-events: none;
}

#kavehchat-panel.kavehchat-drop-active {
  outline: 2px dashed var(--h-primary);
  outline-offset: -5px;
}

#kavehchat-panel.kavehchat-drop-active::after {
  content: "فایل یا تصویر را برای ارسال رها کنید";
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.12);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--h-primary);
  z-index: 999;
  pointer-events: none;
  border-radius: inherit;
}

.kavehchat-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-md);
  text-decoration: none;
  color: var(--h-ink);
  margin-top: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kavehchat-msg.user .kavehchat-file-card {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.kavehchat-file-card:hover {
  border-color: var(--h-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.kavehchat-msg.user .kavehchat-file-card:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: #ffffff;
}

.kavehchat-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--h-primary-light);
  color: var(--h-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kavehchat-msg.user .kavehchat-file-icon {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.kavehchat-file-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.kavehchat-file-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: right;
  line-height: 1.4;
}

.kavehchat-file-action {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}

.kavehchat-file-dl {
  opacity: 0.65;
  display: flex;
  align-items: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.kavehchat-file-card:hover .kavehchat-file-dl {
  opacity: 1;
  transform: translateY(1px);
}

.kavehchat-img-link {
  display: block;
  text-decoration: none;
}

.kavehchat-msg-img {
  max-width: 250px;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--h-radius-md);
  margin-top: 5px;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kavehchat-msg-img:hover {
  transform: scale(1.02);
}

/* ── کارت پیشنهاد محصول دستیار هوشمند ── */
.kavehchat-prod {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
}
.kavehchat-prod-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.kavehchat-prod-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--h-primary);
  background: var(--h-primary-light);
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.6;
}
.kavehchat-prod-rel {
  font-size: 10.5px;
  color: var(--h-muted);
  font-weight: 600;
}
.kavehchat-prod-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-sm);
  padding: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kavehchat-prod-card:hover {
  border-color: var(--h-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.kavehchat-prod-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0 !important;
}
.kavehchat-prod-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.kavehchat-prod-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--h-ink);
  line-height: 1.6;
}
.kavehchat-prod-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--h-primary);
}
.kavehchat-prod-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--kavehchat-grad, var(--h-primary));
  background-color: var(--h-primary);
  color: #ffffff !important;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.kavehchat-prod-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.kavehchat-tlink {
  color: var(--h-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}
.kavehchat-msg.user .kavehchat-tlink {
  color: #ffffff;
}

.kavehchat.kavehchat-dark .kavehchat-prod-badge {
  border-color: #334155;
}
.kavehchat.kavehchat-dark .kavehchat-prod-card {
  background: #1e293b;
}

