#aquiles-chat-launcher,
#aquiles-chat-panel {
  --aquiles-launcher: 56px;
  --aquiles-edge: 16px;
  font-family: system-ui, sans-serif;
  box-sizing: border-box;
}

@media (min-width: 1280px) {
  #aquiles-chat-launcher,
  #aquiles-chat-panel {
    --aquiles-launcher: 72px;
    --aquiles-edge: 22px;
  }
}

@media (min-width: 1600px) {
  #aquiles-chat-launcher,
  #aquiles-chat-panel {
    --aquiles-launcher: 88px;
    --aquiles-edge: 28px;
  }
}

@media (min-width: 1920px) {
  #aquiles-chat-launcher,
  #aquiles-chat-panel {
    --aquiles-launcher: 104px;
    --aquiles-edge: 32px;
  }
}

#aquiles-chat-launcher {
  position: fixed;
  right: calc(var(--aquiles-edge) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--aquiles-edge) + env(safe-area-inset-bottom, 0px));
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--aquiles-launcher);
  height: var(--aquiles-launcher);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--aquiles-color, #18181b);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

#aquiles-chat-launcher svg {
  width: 46%;
  height: 46%;
  display: block;
}

#aquiles-chat-panel {
  position: fixed;
  right: calc(var(--aquiles-edge) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--aquiles-edge) + env(safe-area-inset-bottom, 0px) + var(--aquiles-launcher) + 14px);
  z-index: 999999;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - var(--aquiles-launcher) - var(--aquiles-edge) - 48px));
  display: none;
  flex-direction: column;
  background: #fff;
  color: #18181b;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

#aquiles-chat-panel.is-open {
  display: flex;
}

#aquiles-chat-panel header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--aquiles-color, #18181b);
  color: #fff;
  font-weight: 600;
}

#aquiles-chat-panel header span {
  min-width: 0;
  flex: 1;
}

#aquiles-chat-panel header .aquiles-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

#aquiles-chat-panel header .aquiles-sound:hover {
  background: rgba(255, 255, 255, 0.15);
}

#aquiles-chat-log {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #fafafa;
}

#aquiles-chat-log p {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

#aquiles-chat-log .aquiles-user {
  background: var(--aquiles-color, #18181b);
  color: #fff;
  margin-left: 28px;
}

#aquiles-chat-log .aquiles-bot {
  background: #fff;
  border: 1px solid #e4e4e7;
  margin-right: 28px;
}

#aquiles-chat-log .aquiles-link {
  color: #1d4ed8;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

#aquiles-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e4e4e7;
}

#aquiles-chat-form input {
  flex: 1;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  padding: 10px 12px;
}

#aquiles-chat-form button {
  border: 0;
  border-radius: 10px;
  background: var(--aquiles-color, #18181b);
  color: #fff;
  padding: 0 14px;
  font-weight: 600;
  cursor: pointer;
}

#aquiles-chat-log .aquiles-wa,
#aquiles-chat-log .aquiles-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 28px 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

#aquiles-chat-log .aquiles-quote {
  background: #18181b;
}

#aquiles-chat-log .aquiles-slot {
  display: block;
  width: calc(100% - 28px);
  margin: 0 28px 8px 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d4d4d8;
  background: #fff;
  color: #18181b;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

#aquiles-chat-log .aquiles-product {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 28px 8px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #18181b;
  background: #fff;
  color: #18181b;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

#aquiles-chat-log .aquiles-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 28px 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1d4ed8;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
