:root {
  --avelo-purple: #7c3aed;
  --avelo-purple-dark: #5b21b6;
  --avelo-ink: #1e1b4b;
  --avelo-border: #e9e5f5;
}

.avelo-guest-chat .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.avelo-core-app {
  width: min(100%, 960px);
  height: min(820px, calc(100vh - 120px));
  min-height: 680px;
  margin: 0 auto;
  overflow: hidden;
  background: #fffbfe;
  border: 1px solid var(--avelo-border);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(30, 27, 75, 0.12);
}

.avelo-core-app__header {
  height: 84px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--avelo-purple-dark), var(--avelo-purple) 60%, #a855f7);
}

.avelo-core-app__header > span:last-child {
  display: flex;
  flex-direction: column;
}

.avelo-core-app__header strong {
  font-size: 18px;
}

.avelo-core-app__header small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.8);
}

.avelo-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482000;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.avelo-launcher__button {
  min-height: 58px;
  padding: 8px 18px 8px 8px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--avelo-purple), #9333ea 55%, #ec4899);
  box-shadow: 0 16px 40px rgba(91, 33, 182, 0.35);
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.avelo-launcher__button:hover,
.avelo-launcher__button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(91, 33, 182, 0.42);
}

.avelo-launcher__icon,
.avelo-launcher__brand {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 850;
}

.avelo-launcher__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
}

.avelo-launcher__panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(430px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(30, 27, 75, 0.26);
  transform-origin: bottom right;
  animation: avelo-panel-in 180ms ease-out;
}

.avelo-launcher__panel[hidden],
.avelo-launcher__backdrop[hidden] {
  display: none !important;
}

.avelo-launcher__header {
  height: 72px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--avelo-purple-dark), var(--avelo-purple) 60%, #a855f7);
}

.avelo-launcher__brand {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  font-size: 20px;
}

.avelo-launcher__heading {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.avelo-launcher__heading strong {
  font-size: 15px;
  line-height: 1.25;
}

.avelo-launcher__heading small {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avelo-launcher__expand,
.avelo-launcher__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
}

.avelo-guest-chat {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fbf9ff 0%, #fff 45%);
  color: var(--avelo-ink);
}

.avelo-guest-chat--panel {
  height: calc(100% - 72px);
}

.avelo-guest-chat--full {
  height: calc(100% - 84px);
}

.avelo-guest-chat__messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 16px;
  overscroll-behavior: contain;
}

.avelo-guest-chat--full .avelo-guest-chat__messages {
  padding: 32px clamp(18px, 5vw, 56px) 20px;
}

.avelo-guest-chat__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.avelo-guest-chat__message p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 5px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.avelo-guest-chat__message.is-ai p {
  background: #fff;
  border: 1px solid var(--avelo-border);
  box-shadow: 0 8px 24px rgba(30, 27, 75, 0.07);
}

.avelo-guest-chat__message.is-user {
  margin-left: auto;
}

.avelo-guest-chat__message.is-user p {
  color: #fff;
  background: linear-gradient(135deg, var(--avelo-purple), #a855f7);
  border-radius: 18px 18px 5px 18px;
}

.avelo-guest-chat__message.is-pending {
  opacity: 0.68;
}

.avelo-guest-chat__avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--avelo-purple);
  font-size: 13px;
  font-weight: 850;
}

.avelo-guest-chat__prompts {
  margin: 6px 0 18px 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avelo-guest-chat__prompts[hidden] {
  display: none;
}

.avelo-guest-chat__prompts button {
  padding: 8px 11px;
  border: 1px solid rgba(124, 58, 237, 0.24);
  border-radius: 999px;
  color: var(--avelo-purple-dark);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.avelo-guest-chat__prompts button:hover,
.avelo-guest-chat__prompts button:focus-visible {
  color: #fff;
  background: var(--avelo-purple);
}

.avelo-guest-chat__composer {
  margin: 0 14px;
  padding: 7px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--avelo-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(30, 27, 75, 0.09);
}

.avelo-guest-chat--full .avelo-guest-chat__composer,
.avelo-guest-chat--full .avelo-guest-chat__notice {
  width: calc(100% - clamp(36px, 10vw, 112px));
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.avelo-guest-chat__composer textarea {
  min-height: 42px;
  max-height: 120px;
  flex: 1;
  resize: none;
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
  background: transparent;
  color: var(--avelo-ink);
  padding: 10px 8px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.avelo-guest-chat__composer button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--avelo-purple), #ec4899);
  cursor: pointer;
  font-size: 20px;
}

.avelo-guest-chat__composer button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.avelo-guest-chat__notice {
  margin: 7px 16px 12px;
  color: #94a3b8;
  text-align: center;
  font-size: 9.5px;
  line-height: 1.35;
}

.avelo-launcher__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
  z-index: -1;
}

@keyframes avelo-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  html.avelo-app-open,
  html.avelo-app-open body {
    overflow: hidden !important;
  }

  .avelo-core-app {
    width: 100%;
    height: calc(100dvh - 76px);
    min-height: 680px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .avelo-launcher {
    right: 14px;
    bottom: 14px;
  }

  .avelo-launcher__button {
    min-height: 54px;
  }

  .avelo-launcher__panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .avelo-guest-chat--panel {
    height: calc(100dvh - 72px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .avelo-launcher__panel { animation: none; }
  .avelo-launcher__button { transition: none; }
}
