.app26-chat-root {
  position: fixed;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  direction: rtl;
  box-sizing: border-box;
}

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

.app26-chat-root button {
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  line-height: 0;
  border: 0;
  box-shadow: none;
}

.app26-chat-root input {
  border-radius: 20px !important;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  box-shadow: none;
}

.app26-chat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.app26-chat-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.app26-chat-root[data-position="left"] {
  align-items: flex-start;
}

.app26-chat-panel {
  width: min(360px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 110px));
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  display: none;
  flex-direction: column;
  position: relative;
}

.app26-chat-root.is-open .app26-chat-panel {
  display: flex;
}

.app26-chat-hero {
  background: linear-gradient(180deg, var(--app26-header-from, #D7ECFF) 0%, var(--app26-header-to, #F4F8FF) 100%);
  padding: 12px 14px 14px;
}

.app26-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app26-chat-agent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app26-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.app26-chat-online {
  position: absolute;
  left: 1px;
  bottom: 1px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
}

.app26-chat-agent-name {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.app26-chat-agent-role {
  font-size: 12px;
  color: #6b7280;
}

.app26-chat-promos {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  align-content: center;
  gap: 6px;
  margin-top: 10px;
}

.app26-chat-promo {
  max-width: calc(50% - 4px);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.app26-chat-promo-white {
  background: #fff;
  color: #111827;
}

.app26-chat-promo-blue {
  background: var(--app26-color, #2F6BFF);
  color: #fff;
}

.app26-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 6px;
  background: #fff;
}

.app26-chat-date {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9ca3af;
  font-size: 12px;
  margin: 6px 0 14px;
}

.app26-chat-date::before,
.app26-chat-date::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #eceff3;
}

.app26-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.app26-chat-msg.is-agent {
  justify-content: flex-start;
}

.app26-chat-msg.is-visitor {
  justify-content: flex-end;
}

.app26-chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.app26-chat-msg-col {
  max-width: 78%;
  min-width: 0;
}

.app26-chat-bubble {
  background: #f3f4f6;
  color: #111827;
  border-radius: 16px;
  padding: 8px 10px 6px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app26-chat-bubble-text {
  display: block;
}

.app26-chat-bubble-time {
  display: block;
  align-self: flex-end;
  font-size: 10px;
  line-height: 1;
  opacity: 0.72;
}

.app26-chat-msg.is-visitor .app26-chat-bubble {
  background: var(--app26-color, #2F6BFF);
  color: #fff;
  border-bottom-left-radius: 6px;
}

.app26-chat-msg.is-visitor .app26-chat-bubble-time {
  color: rgba(255, 255, 255, 0.82);
}

.app26-chat-msg.is-agent .app26-chat-bubble {
  border-bottom-right-radius: 6px;
}

.app26-chat-product-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app26-chat-product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  max-width: 220px;
}

.app26-chat-product-card:hover {
  border-color: var(--app26-color, #2F6BFF);
}

.app26-chat-product-image {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  background: #f3f4f6;
}

.app26-chat-product-image-fallback {
  height: 112px;
}

.app26-chat-product-copy {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app26-chat-product-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: #111827;
  text-align: right;
}

.app26-chat-product-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--app26-color, #2F6BFF);
  text-align: right;
}

.app26-chat-msg.is-visitor .app26-chat-product-card {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.app26-chat-msg.is-visitor .app26-chat-product-name {
  color: #fff;
}

.app26-chat-msg.is-visitor .app26-chat-product-price {
  color: #fff;
}

.app26-chat-typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

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

.app26-chat-typing-bubble {
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 16px;
  border-bottom-right-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.app26-chat-typing-dots {
  display: inline-block;
  animation: app26-chat-typing 1.1s infinite;
}

@keyframes app26-chat-typing {
  0%, 20% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}

.app26-chat-phone {
  display: none;
}

.app26-chat-gate {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #fff;
  padding: 22px 18px 18px;
  flex-direction: column;
  gap: 10px;
}

.app26-chat-root.is-gated .app26-chat-gate {
  display: flex;
}

.app26-chat-root.is-gated .app26-chat-composer {
  visibility: hidden;
}

.app26-chat-gate-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827 !important;
  text-align: right;
}

.app26-chat-gate-hint {
  font-size: 13px;
  line-height: 1.7;
  color: #4b5563 !important;
  text-align: right;
  margin-bottom: 8px;
}

.app26-chat-gate-siri {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 12px;
}

.app26-chat-gate-siri-img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.app26-chat-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.app26-chat-field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #111827 !important;
}

.app26-chat-root .app26-chat-gate input {
  width: 100%;
  border: 1px solid #d1d5db !important;
  background: #fff !important;
  border-radius: 14px !important;
  padding: 11px 12px !important;
  font: inherit;
  font-size: 14px;
  outline: none;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  opacity: 1 !important;
}

.app26-chat-root .app26-chat-gate input::placeholder,
.app26-chat-root .app26-chat-gate input::-webkit-input-placeholder {
  color: #9ca3af !important;
  -webkit-text-fill-color: #9ca3af !important;
  opacity: 1 !important;
}

.app26-chat-root .app26-chat-gate input:focus {
  border-color: var(--app26-color, #2F6BFF) !important;
  background: #fff !important;
}

.app26-chat-gate-error {
  min-height: 18px;
  font-size: 12px;
  color: #dc2626;
  text-align: right;
}

.app26-chat-root .app26-chat-gate-submit {
  margin-top: auto;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--app26-color, #2F6BFF);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.4;
}

.app26-chat-gate-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.app26-chat-root .app26-chat-send-round {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--app26-color, #2F6BFF);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app26-chat-root .app26-chat-send-round:hover {
  filter: brightness(0.95);
}

.app26-chat-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

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

.app26-chat-composer input {
  flex: 1;
  border-radius: 20px !important;
  min-width: 0;
  border: 0;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.app26-chat-root .app26-chat-launcher.has-unread::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}

.app26-chat-root .app26-chat-launcher,
.app26-chat-root .app26-chat-minimize {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  background: var(--app26-bubble, #fff);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  color: var(--app26-bubble-icon, var(--app26-color, #2F6BFF));
  display: flex;
  align-items: center;
  justify-content: center;
}

.app26-chat-root .app26-chat-launcher {
  position: relative;
}

.app26-chat-launcher .app26-chat-icon,
.app26-chat-minimize .app26-chat-icon {
  width: 24px;
  height: 24px;
}

.app26-chat-root.is-open .app26-chat-launcher {
  display: none;
}

.app26-chat-root .app26-chat-minimize {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

.app26-chat-root.is-open .app26-chat-minimize {
  display: flex;
}

.app26-chat-root.is-preview {
  position: relative;
  inset: auto;
  z-index: 1;
}

.app26-chat-root.is-preview.is-open .app26-chat-panel {
  display: flex;
  height: 520px;
}

.app26-chat-root.is-preview:not(.is-open) .app26-chat-panel,
.app26-chat-root.is-preview:not(.is-open) .app26-chat-minimize {
  display: none;
}

.app26-chat-root.is-preview:not(.is-open) .app26-chat-launcher {
  display: flex;
}

.app26-chat-root.is-preview.is-open .app26-chat-launcher {
  display: none;
}

.app26-chat-root.is-preview .app26-chat-minimize {
  display: none;
}
