:root {
  --agpt-primary: #1db6a3;
  --agpt-accent: #0d8f7e;
  --agpt-dark: #0d3a32;
  --agpt-bg: #f4f7f6;
  --bubble-size: 128px;
}

.agpt-widget-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: calc(var(--bubble-size) + 8px);
  height: calc(var(--bubble-size) + 8px);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--agpt-primary), var(--agpt-accent));
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 9999;
  background-image: url('/widget/agapito.png');
  background-size: cover;
  background-position: center;
}

.agpt-widget-bubble:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
  :root {
    --bubble-size: 96px;
  }
  .agpt-widget-bubble {
    bottom: 16px;
    right: 16px;
  }
  .agpt-widget-window {
    bottom: 100px;
    max-height: 75vh;
  }
}

.agpt-widget-window {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: min(420px, 90vw);
  height: 560px;
  max-height: 80vh;
  background: white;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9998;
}

.agpt-widget-window.agpt-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.agpt-widget-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--agpt-primary), var(--agpt-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.agpt-widget-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fbfa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agpt-widget-message {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.agpt-bot {
  background: white;
  border: 1px solid rgba(13, 63, 50, 0.08);
  color: var(--agpt-dark);
  align-self: flex-start;
}

.agpt-user {
  background: var(--agpt-primary);
  color: white;
  align-self: flex-end;
}

.agpt-widget-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e6efec;
  background: white;
}

.agpt-widget-input input {
  flex: 1;
  border: 1px solid #d7e6e2;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.agpt-widget-input button {
  border: none;
  background: var(--agpt-primary);
  color: white;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.agpt-widget-status {
  font-size: 12px;
  color: #5c6f6a;
  padding: 0 16px 10px;
}
