#lcp-chat-box,
#lcp-launcher {
  position: fixed;
  box-shadow: var(--lcp-shadow);
  z-index: var(--lcp-z);
  display: flex;
}
#lcp-msg-input,
#lcp-pre-chat input {
  padding: 9px 12px;
  direction: rtl;
  transition: border-color 0.2s;
}
:root {
  --lcp-primary: #2563eb;
  --lcp-secondary: #1e40af;
  --lcp-text: #ffffff;
  --lcp-radius: 16px;
  --lcp-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.18);
  --lcp-z: 99999;
}
#lcp-launcher {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--lcp-primary);
  color: var(--lcp-text);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
#lcp-launcher:hover {
  transform: scale(1.1);
}
#lcp-launcher svg {
  width: 26px;
  height: 26px;
}
#lcp-launcher .lcp-unread-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#lcp-pre-chat .lcp-start-btn,
#lcp-send-btn,
.lcp-msg--agent .lcp-msg-bubble {
  background: var(--lcp-primary);
  color: var(--lcp-text);
}
.lcp-header-avatar,
.lcp-header-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.lcp-pos-bottom-right {
  bottom: 24px;
  right: 24px;
}
.lcp-pos-bottom-left {
  bottom: 24px;
  left: 24px;
}
#lcp-chat-box {
  width: 360px;
  max-height: 520px;
  flex-direction: column;
  border-radius: var(--lcp-radius);
  overflow: hidden;
  background: #fff;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  font-family: IRANSans;
  direction: rtl;
}
#lcp-chat-box.lcp-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
#lcp-chat-box.lcp-pos-bottom-right,
.lcp-pos-bottom-right #lcp-chat-box {
  bottom: 94px;
}
#lcp-chat-box.lcp-pos-bottom-left,
.lcp-pos-bottom-left #lcp-chat-box {
  bottom: 94px;
  left: 24px;
}
.lcp-header {
  background: linear-gradient(135deg, var(--lcp-primary), var(--lcp-secondary));
  color: var(--lcp-text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lcp-header-logo {
  object-fit: cover;
}
.lcp-header-avatar {
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.lcp-header-text {
  flex: 1;
}
.lcp-header-title {
  font-weight: 700;
  font-size: 15px;
}
.lcp-header-subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 6px;
}
.lcp-header-close {
  background: 0 0;
  border: none;
  color: var(--lcp-text);
  cursor: pointer;
  opacity: 0.8;
  padding: 4px;
  line-height: 1;
  font-size: 20px;
}
.lcp-header-close:hover {
  opacity: 1;
}
#lcp-pre-chat {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f8fafc;
}
#lcp-pre-chat h4 {
  margin: 0 0 4px;
  color: #1e293b;
  font-size: 14px;
}
#lcp-msg-input,
#lcp-pre-chat input,
#lcp-send-btn {
  font-family: IRANSans;
  font-size: 13px;
}
#lcp-pre-chat input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  box-sizing: border-box;
}
#lcp-msg-input:focus,
#lcp-pre-chat input:focus {
  outline: 0;
  border-color: var(--lcp-primary);
}
#lcp-pre-chat .lcp-start-btn {
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: IRANSans;
  transition: background 0.2s;
}
#lcp-pre-chat .lcp-start-btn:hover,
#lcp-send-btn:hover {
  background: var(--lcp-secondary);
}
#lcp-messages-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  background: #f8fafc;
}
.lcp-msg {
  display: flex;
  word-wrap: break-word;
}
.lcp-msg--agent {
  justify-content: flex-end;
}
.lcp-msg--visitor {
  justify-content: flex-start;
}
.lcp-msg-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
}
.lcp-msg--agent .lcp-msg-bubble {
  border-bottom-left-radius: 4px;
}
.lcp-msg--visitor .lcp-msg-bubble {
  background: #fff;
  color: #1e293b;
  border: 1.5px solid #e2e8f0;
  border-bottom-right-radius: 4px;
}
.lcp-msg-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 3px;
  opacity: 0.75;
}
.lcp-msg-time {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  padding: 0 0 0 2px;
  opacity: 0.6;
  text-align: left;
}
.lcp-msg--visitor .lcp-msg-time {
  text-align: right !important;
  padding: 0 2px 0 0 !important;
}
#lcp-input-bar {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-top: 1.5px solid #e2e8f0;
  background: #fff;
  align-items: flex-end;
}
#lcp-msg-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  resize: none;
  max-height: 90px;
}
#lcp-send-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}
#lcp-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.lcp-closed-bar {
  text-align: center;
  padding: 10px;
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}
#lcp-messages-wrap::-webkit-scrollbar {
  width: 4px;
}
#lcp-messages-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
@media (max-width: 420px) {
  #lcp-chat-box {
    width: calc(100vw - 24px);
    right: 12px !important;
    left: 12px !important;
  }
}
#lcp-attach-btn {
  display: flex;
  align-items: center;
  width: auto;
  height: 40px;
  cursor: pointer;
  color: var(--lcp-primary);
  opacity: 0.75;
  transition: opacity 0.2s;
}
#lcp-attach-btn:hover {
  opacity: 1;
}
#lcp-upload-progress {
  padding: 6px 14px;
  background: #f0f4ff;
  border-top: 1px solid #dbe4ff;
}
.lcp-progress-bar {
  height: 4px;
  background: #dbe4ff;
  border-radius: 99px;
  overflow: hidden;
}
.lcp-progress-fill {
  height: 100%;
  background: var(--lcp-primary);
  border-radius: 99px;
  transition: width 0.2s;
}
.lcp-progress-label {
  font-size: 11px;
  color: #6b7280;
  display: block;
  margin-top: 3px;
}
.lcp-file-img-link {
  display: block;
}
.lcp-file-img {
  max-width: 200px;
  max-height: 180px;
  border-radius: 8px;
  display: block;
  margin-bottom: 4px;
  cursor: zoom-in;
}
.lcp-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  max-width: 220px;
  word-break: break-all;
}
.lcp-file-link:hover {
  background: rgba(0, 0, 0, 0.12);
}
.lcp-file-size {
  font-size: 11px;
  opacity: 0.65;
}
.lcp-file-dl {
  width: 36px;
  font-size: 11px;
  font-weight: bold;
  margin-right: auto;
  opacity: 0.8;
  color: var(--lcp-primary);
}
.lcp-file-meta {
  font-size: 11px;
  opacity: 0.6;
  display: block;
  margin-top: 2px;
}
