:root {
  --eve-primary: #0b6e5c;
  --eve-primary-dark: #085849;
  --eve-primary-light: #3fd9b8;
  --eve-bg: #f1f5f9;
  --eve-panel-width: 400px;
  --eve-radius: 18px;
  --eve-transition: .35s cubic-bezier(.4,0,.2,1);
  --eve-shadow: 0 8px 40px rgba(11,110,92,.18);
}

.eve-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--eve-transition);
}
.eve-overlay.active,
.eve-overlay.eve-visible { opacity: 1; pointer-events: auto; }

.eve-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--eve-panel-width);
  height: 100dvh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 50px rgba(15,23,42,.16);
  transform: translateX(100%);
  transition: transform var(--eve-transition);
  border-radius: var(--eve-radius) 0 0 var(--eve-radius);
  overflow: hidden;
}
.eve-panel.active,
.eve-panel.eve-open { transform: translateX(0); }

.eve-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--eve-primary-dark), var(--eve-primary));
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.eve-header-info { display: flex; align-items: center; gap: 14px; }
.eve-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.eve-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.eve-header-name { font-size: 19px; font-weight: 700; margin-bottom: 2px; }
.eve-header-sub { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.eve-header-sub::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 5px #4ade80;
}
.eve-close-btn,
.eve-restart-btn {
  background: rgba(255,255,255,.16);
  border: 0;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  margin-left: 6px;
}
.eve-close-btn:hover,
.eve-restart-btn:hover { background: rgba(255,255,255,.3); }

.eve-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--eve-bg);
  scroll-behavior: smooth;
}
.eve-messages::-webkit-scrollbar { width: 4px; }
.eve-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.eve-message,
.eve-msg {
  display: flex;
  flex-direction: column;
  max-width: 87%;
  animation: eveFadeUp .25s ease both;
}
@keyframes eveFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.eve-message.user,
.eve-msg.eve-user { align-self: flex-end; align-items: flex-end; }
.eve-message.bot,
.eve-msg.eve-bot { align-self: flex-start; align-items: flex-start; }
.eve-bubble {
  padding: 12px 16px;
  border-radius: var(--eve-radius);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.eve-message.user .eve-bubble,
.eve-msg.eve-user .eve-bubble {
  background: var(--eve-primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.eve-message.bot .eve-bubble,
.eve-msg.eve-bot .eve-bubble {
  background: #fff;
  color: #1e293b;
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
.eve-time { font-size: 10.5px; color: #94a3b8; margin-top: 4px; padding: 0 4px; }

.eve-typing {
  display: flex;
  align-items: center;
  gap: 5px;
}
.eve-typing i,
.eve-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: block;
  animation: eveDot 1.4s infinite ease-in-out;
}
.eve-typing i:nth-child(2),
.eve-typing span:nth-child(2) { animation-delay: .2s; }
.eve-typing i:nth-child(3),
.eve-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes eveDot {
  0%,60%,100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-7px); opacity: 1; }
}

.eve-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
  animation: eveFadeUp .3s ease both;
}
.eve-option-btn {
  background: #fff;
  border: 2px solid var(--eve-primary);
  color: var(--eve-primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .18s, color .18s, transform .15s;
  font-family: inherit;
}
.eve-option-btn:hover:not(:disabled) {
  background: var(--eve-primary);
  color: #fff;
  transform: translateX(3px);
}

.eve-summary {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--eve-primary);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
}
.eve-summary__title { font-weight: 700; color: var(--eve-primary); margin-bottom: 10px; }
.eve-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}
.eve-summary__row:last-child { border-bottom: 0; }
.eve-summary__row span { color: #64748b; }
.eve-summary__row strong { color: #0f172a; text-align: right; }

.eve-input-area {
  flex-shrink: 0;
  padding: 14px 16px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eve-input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: #1e293b;
  background: var(--eve-bg);
}
.eve-input:focus { border-color: var(--eve-primary-light); background: #fff; }
.eve-input:disabled { opacity: .6; cursor: not-allowed; }
.eve-send-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--eve-primary), var(--eve-primary-light));
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(11,110,92,.35);
}
.eve-send-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.eve-send-btn svg { width: 20px; height: 20px; fill: #fff; }

.eve-toggle-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9997;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.eve-toggle-btn.hidden { display: none; }
.eve-toggle-icon {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--eve-primary-dark), var(--eve-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--eve-shadow);
  transition: transform .22s, box-shadow .22s;
}
.eve-toggle-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.eve-toggle-btn:hover .eve-toggle-icon { transform: scale(1.08); }
.eve-toggle-label {
  background: var(--eve-primary-dark);
  color: #fff;
  padding: 3px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(11,110,92,.3);
}
.eve-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2.5px solid #fff;
  border-radius: 50%;
  z-index: 10;
  animation: evePulse 2s infinite;
}
.eve-badge:not(.active) { opacity: 0; }
@keyframes evePulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@media (max-width: 440px) {
  .eve-panel { width: 100%; border-radius: 0; }
  .eve-toggle-btn { bottom: 20px; right: 20px; }
}
