:root{
  --eve-purple:#7c3aed;
  --eve-purple-2:#6d28d9;
  --eve-bg:#0b0b0f;
  --eve-ink:#f4f4f5;
  --eve-line:rgba(255,255,255,0.08);
  --eve-shadow:0 18px 50px rgba(0,0,0,0.35);
  --eve-shadow-fab:0 10px 25px rgba(0,0,0,0.25);
}

/* Floating Button */
#eveFab{
  position:fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width:56px;
  height:56px;
  border-radius:999px;
  border:0;
  cursor:pointer;
  box-shadow: var(--eve-shadow-fab);
  font-weight:800;
  z-index:99999;
  background: var(--eve-purple);
  color:#fff;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
#eveFab:hover{ filter: brightness(1.06); }
#eveFab:active{ transform: translateY(1px) scale(0.99); }
#eveFab:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.35), var(--eve-shadow-fab);
}

/* Panel */
#evePanel{
  position:fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 68px);
  width:360px;
  max-width: calc(100vw - 36px);
  height:520px;
  max-height: calc(100vh - 140px);
  border-radius:16px;
  background: var(--eve-bg);
  color: var(--eve-ink);
  box-shadow: var(--eve-shadow);
  border:1px solid var(--eve-line);
  display:none;
  flex-direction:column;
  overflow:hidden;
  z-index:99999;

  transform: translateY(8px);
  opacity: 0;
}

#evePanel[data-open="true"]{
  transform: translateY(0);
  opacity: 1;
  transition: opacity .14s ease, transform .14s ease;
}

#evePanelHeader{
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--eve-line);
  background: rgba(255,255,255,0.02);
}
#evePanelHeader .title{
  display:flex;
  gap:8px;
  align-items:center;
  font-weight:800;
}
#eveClose{
  background:transparent;
  color:#fff;
  border:0;
  cursor:pointer;
  font-size:18px;
  padding: 6px 8px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
#eveClose:hover{ background: rgba(255,255,255,0.06); }
#eveClose:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.35);
}

#eveMessages{
  padding:12px;
  flex:1;
  overflow:auto;
  font-size:14px;
  line-height:1.35;
  scroll-behavior: smooth;
}
#eveMessages::-webkit-scrollbar{ width:10px; }
#eveMessages::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.10);
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}

.eveMsg{
  padding:10px 10px;
  border-radius:12px;
  margin-bottom:10px;
  white-space:pre-wrap;
  border:1px solid var(--eve-line);
  word-break: break-word;
}
.eveMsg.user{ background: rgba(255,255,255,0.06); }
.eveMsg.eve{
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.25);
}

#eveComposer{
  padding:12px;
  border-top:1px solid var(--eve-line);
  display:flex;
  gap:8px;
  background: rgba(255,255,255,0.02);
}
#eveInput{
  flex:1;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: var(--eve-ink);
  padding:10px 12px;
  outline:none;
}
#eveInput:focus{
  border-color: rgba(124,58,237,0.45);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.22);
}
#eveSend{
  border:0;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:800;
  background: var(--eve-purple);
  color:#fff;
  -webkit-tap-highlight-color: transparent;
  transition: filter .12s ease, transform .12s ease, background .12s ease;
}
#eveSend:hover{ filter: brightness(1.06); background: var(--eve-purple-2); }
#eveSend:active{ transform: translateY(1px) scale(0.99); }
#eveSend:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.35);
}

/* Mobile */
@media (max-width: 420px){
  #evePanel{
    width: calc(100vw - 24px);
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 66px);
    height: 70vh;
    max-height: calc(100vh - 140px);
  }
  #eveFab{
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
