.ghaith {
  --ghaith-z: 12000;
  --ghaith-bg: #ffffff;
  --ghaith-ink: #120A0B;
  --ghaith-muted: #888485;
  --ghaith-primary: #652EDA;
  --ghaith-primary-soft: #F0EAFB;
  --ghaith-border: #E7E6E6;
  --ghaith-shadow: 0 16px 40px rgba(18, 10, 11, 0.16);
  font-family: var(--font-family-base, Inter, sans-serif);
}

.ghaith[hidden] { display: none !important; }

.ghaith__fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--ghaith-z);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  background: #0a0a0a;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--ghaith-shadow);
  cursor: pointer;
}

.ghaith__fab-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #000;
}

.rtl .ghaith__fab,
html[dir="rtl"] .ghaith__fab {
  padding: 8px 8px 8px 16px;
}

.rtl .ghaith__fab,
html[dir="rtl"] .ghaith__fab {
  right: auto;
  left: 20px;
}

.ghaith__panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: calc(var(--ghaith-z) + 1);
  width: min(380px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--ghaith-bg);
  border: 1px solid var(--ghaith-border);
  border-radius: 20px;
  box-shadow: var(--ghaith-shadow);
  overflow: hidden;
}

.rtl .ghaith__panel,
html[dir="rtl"] .ghaith__panel {
  right: auto;
  left: 20px;
}

.ghaith__panel[hidden] { display: none !important; }

.ghaith__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ghaith-primary-soft);
  border-bottom: 1px solid var(--ghaith-border);
}

.ghaith__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ghaith__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #000;
  flex-shrink: 0;
}

.ghaith__title {
  display: block;
  font-size: 14px;
  color: var(--ghaith-ink);
  line-height: 1.2;
}

.ghaith__status {
  display: block;
  font-size: 12px;
  color: var(--ghaith-muted);
}

.ghaith__icon-btn {
  border: 0;
  background: transparent;
  color: var(--ghaith-ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.ghaith__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 12px 14px 14px;
}

.ghaith__body[hidden] { display: none !important; }

.ghaith__messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
  max-height: 360px;
  min-height: 220px;
}

.ghaith__msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ghaith__msg--bot {
  align-self: flex-start;
  background: var(--ghaith-primary-soft);
  color: var(--ghaith-ink);
}

.ghaith__msg--user {
  align-self: flex-end;
  background: var(--ghaith-primary);
  color: #fff;
}

.ghaith__msg--meta {
  align-self: center;
  background: transparent;
  color: var(--ghaith-muted);
  font-size: 12px;
  padding: 0;
}

.ghaith__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ghaith__chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--ghaith-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ghaith__chip--block {
  width: 100%;
  margin-top: 8px;
}

.ghaith__composer {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ghaith-border);
  border-radius: 14px;
  padding: 6px 8px 6px 12px;
  background: #fff;
}

.ghaith__composer input[type="text"] {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 14px;
  min-width: 0;
  background: transparent;
  color: var(--ghaith-ink);
}

.ghaith__send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--ghaith-primary-soft);
  color: var(--ghaith-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ghaith__send:disabled {
  opacity: 0.5;
  cursor: wait;
}

.ghaith__privacy {
  margin: 8px 2px 0;
  font-size: 11px;
  color: var(--ghaith-muted);
  line-height: 1.35;
}

.ghaith__hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.ghaith__callback-title {
  margin: 4px 0 4px;
  font-size: 16px;
}

.ghaith__callback-sub {
  margin: 0 0 12px;
  color: var(--ghaith-muted);
  font-size: 13px;
}

.ghaith__callback label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ghaith-muted);
}

.ghaith__callback input,
.ghaith__callback textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--ghaith-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ghaith-ink);
  background: #fff;
}

.ghaith__link {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--ghaith-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

@media (max-width: 480px) {
  .ghaith__panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 76px;
  }
  .rtl .ghaith__panel,
  html[dir="rtl"] .ghaith__panel {
    left: 12px;
    right: 12px;
  }
  .ghaith__fab {
    right: 12px;
    bottom: 12px;
  }
  .rtl .ghaith__fab,
  html[dir="rtl"] .ghaith__fab {
    left: 12px;
    right: auto;
  }
}
