:root {
  --webleoai-accent: #D4A017;        /* --leo-gold */
  --webleoai-accent-light: #F5C518;  /* --leo-gold-light */
  --webleoai-accent-dark: #A87A0E;   /* --leo-gold-dark */
  --webleoai-black: #1D1E20;         /* --leo-black */
  --webleoai-bg: #FCFBF8;            /* --leo-offwhite */
  --webleoai-text: #1D1E20;
  --webleoai-muted: #7C7C7C;         /* --leo-gray-500 */
  --webleoai-border: #E8E4D8;        /* --leo-gray-200 */
  --webleoai-bubble-user: #F3F1EA;   /* --leo-gray-100 */
  --webleoai-bubble-bot: #ffffff;
  --webleoai-radius: 14px;
  --webleoai-font: 'Poppins', 'Inter', 'Segoe UI', sans-serif;
}

#webleoai-root { position: fixed; right: 22px; bottom: 22px; z-index: 99999; font-family: var(--webleoai-font); }

#webleoai-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--webleoai-accent-light), var(--webleoai-accent));
  box-shadow: 0 12px 26px rgba(212,160,23,.38);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
#webleoai-toggle:hover { transform: translateY(-2px); }
#webleoai-toggle img { border-radius: 50%; background: var(--webleoai-black); padding: 3px; }

#webleoai-tooltip {
  position: absolute; right: 68px; bottom: 14px; white-space: nowrap;
  background: var(--webleoai-black); color: var(--webleoai-accent-light);
  font-family: var(--webleoai-font); font-weight: 600; font-size: 13px;
  padding: 9px 14px; border-radius: 999px; box-shadow: 0 8px 20px rgba(0,0,0,.25);
  animation: webleoai-pulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
#webleoai-tooltip::after {
  content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px; background: var(--webleoai-black);
}
#webleoai-tooltip.webleoai-tooltip-hidden { display: none; }

@keyframes webleoai-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (max-width: 480px) {
  #webleoai-tooltip { right: 64px; font-size: 12px; padding: 7px 11px; }
}

#webleoai-panel {
  position: fixed; right: 22px; bottom: 88px; width: 340px;
  max-height: min(480px, calc(100dvh - 110px));
  background: var(--webleoai-bg); border: 1px solid var(--webleoai-border);
  border-radius: var(--webleoai-radius); box-shadow: 0 20px 50px rgba(29,30,32,.16);
  display: flex; flex-direction: column; overflow: hidden;
}
#webleoai-panel.webleoai-hidden { display: none; }

#webleoai-panel-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--webleoai-black); color: var(--webleoai-accent-light); font-weight: 700; font-size: 14px;
  font-family: var(--webleoai-font); cursor: pointer;
}
#webleoai-panel-header:hover { background: #2a2b2e; }
#webleoai-panel-header img { border-radius: 50%; }
#webleoai-panel-header span { flex: 1; }
#webleoai-minimize {
  background: transparent; border: none; color: #fff; font-size: 20px;
  line-height: 1; cursor: pointer; padding: 8px; margin: -8px -6px -8px 0;
  min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center;
}

#webleoai-messages {
  flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  font-size: 13.5px; color: var(--webleoai-text); min-height: 180px;
}
.webleoai-msg { padding: 8px 11px; border-radius: 10px; max-width: 85%; line-height: 1.4; white-space: pre-wrap; }
.webleoai-msg.user { align-self: flex-end; background: var(--webleoai-bubble-user); }
.webleoai-msg.bot  { align-self: flex-start; background: var(--webleoai-bubble-bot); border: 1px solid var(--webleoai-border); }
.webleoai-msg.system { align-self: center; color: var(--webleoai-muted); font-size: 12px; text-align: center; }

#webleoai-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--webleoai-border); background: #fff; }
#webleoai-input {
  flex: 1; resize: none; border: 1px solid var(--webleoai-border); border-radius: 10px;
  padding: 8px 10px; font-size: 13px; max-height: 90px; font-family: var(--webleoai-font);
}
#webleoai-form button {
  width: 36px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--webleoai-accent-light), var(--webleoai-accent));
  color: var(--webleoai-black); cursor: pointer; font-size: 16px; font-weight: 700;
}
#webleoai-form button:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
  #webleoai-panel { width: calc(100vw - 32px); right: 16px; left: 16px; }
}

