.ai-chat-widget {
  --ai-chat-ink: #17151d;
  --ai-chat-muted: #6f6977;
  --ai-chat-border: #e7e1ea;
  --ai-chat-soft: #faf7fb;
  --ai-chat-brand: #fb2095;
  --ai-chat-brand-dark: #cf0f74;
  --ai-chat-panel: #fff;
  --ai-chat-shadow: 0 20px 52px rgba(23, 21, 29, 0.2);
  color: var(--ai-chat-ink);
  direction: rtl;
  font-family: "Arimo", Arial, sans-serif;
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 100002;
}

.ai-chat-widget[hidden] {
  display: none;
}

.ai-chat-launcher {
  align-items: center;
  background: var(--ai-chat-ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(23, 21, 29, 0.24);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex-direction: row;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px 0 18px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ai-chat-launcher:hover {
  background: #25212e;
  box-shadow: 0 16px 38px rgba(23, 21, 29, 0.3);
  transform: translateY(-1px);
}

.ai-chat-launcher-icon {
  align-items: center;
  background: var(--ai-chat-brand);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.ai-chat-launcher svg,
.ai-chat-close svg,
.ai-chat-form button svg {
  display: block;
  fill: currentColor;
  height: 20px;
  width: 20px;
}

.ai-chat-form button svg {
  transform: scaleX(-1);
}

.ai-chat-panel {
  background: var(--ai-chat-panel);
  border: 1px solid var(--ai-chat-border);
  border-radius: 10px;
  bottom: 148px;
  box-shadow: var(--ai-chat-shadow);
  display: flex;
  flex-direction: column;
  max-height: min(660px, calc(100vh - 110px));
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 24px;
  text-align: right;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  width: min(410px, calc(100vw - 32px));
}

.ai-chat-widget.ai-chat-open .ai-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ai-chat-header {
  background: var(--ai-chat-ink);
  color: #fff;
  padding: 15px 16px 15px 58px;
}

.ai-chat-header p,
.ai-chat-header h2 {
  margin: 0;
}

.ai-chat-header p {
  color: #ffb9df;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.ai-chat-header h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.ai-chat-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: grid;
  height: 34px;
  left: 12px;
  line-height: 0;
  padding: 0;
  place-items: center;
  position: absolute;
  top: 12px;
  width: 34px;
  z-index: 1;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
  background: var(--ai-chat-soft);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  overflow-y: auto;
  padding: 14px;
}

.ai-chat-message {
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.58;
  max-width: 88%;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  text-align: start;
  white-space: pre-wrap;
}

.ai-chat-message-user {
  align-self: flex-start;
  background: var(--ai-chat-brand);
  border-end-start-radius: 4px;
  color: #fff;
}

.ai-chat-message-assistant {
  align-self: flex-end;
  background: #fff;
  border: 1px solid var(--ai-chat-border);
  border-end-end-radius: 4px;
  color: var(--ai-chat-ink);
}

.ai-chat-event-list {
  align-self: stretch;
  display: grid;
  gap: 8px;
  margin: 0 0 2px;
}

.ai-chat-event-card {
  background: #fff;
  border: 1px solid var(--ai-chat-border);
  border-radius: 8px;
  color: var(--ai-chat-ink);
  direction: ltr;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: 1fr 64px;
  min-height: 82px;
  overflow: hidden;
  padding: 8px;
  text-align: right;
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.ai-chat-event-card:hover {
  border-color: var(--ai-chat-brand);
  box-shadow: 0 8px 20px rgba(23, 21, 29, 0.08);
}

.ai-chat-event-card img {
  background: #ece8f0;
  border-radius: 6px;
  grid-column: 2;
  grid-row: 1 / span 4;
  height: 64px;
  object-fit: cover;
  width: 64px;
}

.ai-chat-event-card h3 {
  color: var(--ai-chat-ink);
  direction: rtl;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.ai-chat-event-meta,
.ai-chat-event-reason {
  color: var(--ai-chat-muted);
  direction: rtl;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.ai-chat-event-reason {
  color: #8d1a5a;
  font-weight: 700;
}

.ai-chat-suggestions {
  background: #fff;
  border-top: 1px solid var(--ai-chat-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  padding: 10px 12px 0;
}

.ai-chat-suggestions button {
  background: #f7f2f6;
  border: 1px solid #eadfea;
  border-radius: 999px;
  color: var(--ai-chat-ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  padding: 7px 10px;
  text-align: center;
}

.ai-chat-suggestions button:hover {
  border-color: rgba(251, 32, 149, 0.42);
  color: var(--ai-chat-brand-dark);
}

.ai-chat-form {
  align-items: center;
  background: #fff;
  direction: ltr;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 42px;
  padding: 12px;
}

.ai-chat-form textarea {
  border: 1px solid #d9d4de;
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--ai-chat-ink);
  font: inherit;
  font-size: 14px;
  grid-column: 2;
  grid-row: 1;
  height: 42px;
  line-height: 1.45;
  max-height: 120px;
  min-height: 42px;
  overflow-y: auto;
  padding: 10px 12px;
  resize: none;
  text-align: right;
}

.ai-chat-form textarea::placeholder {
  color: #8a8490;
}

.ai-chat-form textarea:focus {
  border-color: var(--ai-chat-brand);
  outline: 2px solid rgba(251, 32, 149, 0.14);
}

.ai-chat-form button {
  align-items: center;
  background: var(--ai-chat-brand);
  border: 0;
  border-radius: 8px;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: grid;
  grid-column: 1;
  grid-row: 1;
  height: 42px;
  line-height: 0;
  padding: 0;
  place-items: center;
  position: relative;
  width: 42px;
}

.ai-chat-form button svg {
  height: 19px;
  left: 50%;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scaleX(-1);
  transform-origin: center;
  width: 19px;
}

.ai-chat-form button:hover {
  background: var(--ai-chat-brand-dark);
}

.ai-chat-form button:disabled {
  background: #c8c2ca;
  cursor: not-allowed;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 640px) {
  .ai-chat-widget {
    bottom: 76px;
    right: 12px;
  }

  .ai-chat-panel {
    bottom: 138px;
    max-height: calc(100vh - 92px);
    right: 12px;
    width: calc(100vw - 24px);
  }

  .ai-chat-launcher {
    min-height: 46px;
    padding-inline: 13px 15px;
  }

  .ai-chat-messages {
    min-height: 250px;
    padding: 12px;
  }
}
