:root{
  --eg-primary: #10B981;
  --eg-primary-2: #0EA5E9;
  --eg-ink: #0b1b14;
  --eg-card: rgba(255,255,255,.94);
  --eg-border: rgba(0,0,0,.08);
  --eg-shadow: 0 14px 35px rgba(0,0,0,.10);
}

.mi-chatgpt-widget{
  max-width: 560px;
  border: 1px solid var(--eg-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--eg-shadow);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  background: var(--eg-card);
  position: relative;
}

.mi-chatgpt-header{
  position: relative;
  padding: 14px 16px 10px 16px;
  background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(14,165,233,.12));
}
.mi-chatgpt-title{font-weight: 900; font-size: 16px; line-height: 1.2; color: var(--eg-ink); display:flex; gap:10px; align-items:baseline; flex-wrap:wrap;}
.mi-chatgpt-state{font-weight:800; font-size:12px; opacity:.78;}
.mi-chatgpt-subtitle{font-size: 12px; opacity: .78; margin-top: 6px; color: #10231a;}

.mi-chatgpt-actions{display:flex; gap:10px; margin-top:10px; flex-wrap: wrap;}
.mi-chatgpt-action{
  display:inline-flex; align-items:center; gap:8px;
  text-decoration:none; font-weight:800; font-size: 12px;
  padding: 8px 10px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.70);
  color: #0b1b14;
}
.mi-chatgpt-action:hover{filter: brightness(0.98);}

.mi-chatgpt-body{
  height: 340px;
  overflow-y: auto;
  padding: 14px 14px 6px 14px;
  background: rgba(255,255,255,.86);
}

.mi-chatgpt-footer{display:flex; gap:10px; padding: 12px; border-top: 1px solid rgba(0,0,0,.06); background: rgba(255,255,255,.95);}
.mi-chatgpt-input{
  flex:1; border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px; padding: 10px 12px;
  font-size: 14px; outline: none;
}
.mi-chatgpt-input:focus{border-color: rgba(14,165,233,.65); box-shadow: 0 0 0 4px rgba(14,165,233,.12);}
.mi-chatgpt-send{
  border: 0; border-radius: 14px; padding: 10px 14px;
  font-weight: 900; cursor: pointer;
  background: linear-gradient(135deg, rgba(16,185,129,.98), rgba(14,165,233,.85));
  color: #062016;
}
.mi-chatgpt-send:disabled{opacity: .55; cursor: not-allowed;}

.mi-chatgpt-msg{display:flex; margin-bottom: 10px;}
.mi-chatgpt-bubble{
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.35;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,.06);
  background: #fff;
  color: #0b1b14;
  white-space: pre-wrap;
}
.mi-chatgpt-user{justify-content: flex-end;}
.mi-chatgpt-user .mi-chatgpt-bubble{background: rgba(14,165,233,.10);}
.mi-chatgpt-bot{justify-content: flex-start;}
.mi-chatgpt-typing{opacity:.8; font-style: italic;}

/* typing dots */
.dots{display:inline-flex; gap:4px; margin-right:6px; vertical-align:middle;}
.dots i{width:6px; height:6px; border-radius:999px; background: rgba(11,27,20,.35); display:inline-block; animation: dot 1s infinite;}
.dots i:nth-child(2){animation-delay:.15s;}
.dots i:nth-child(3){animation-delay:.3s;}
@keyframes dot{0%,100%{transform: translateY(0); opacity:.35;}50%{transform: translateY(-2px); opacity:.9;}}

/* Floating */
.mi-chatgpt-fab-wrap{position: fixed; right: 18px; bottom: 18px; z-index: 999999;}
.mi-chatgpt-fab{
  display:flex; align-items:center; gap:10px;
  border: 0; border-radius: 999px;
  padding: 12px 14px; cursor: pointer; font-weight: 900;
  color: #062016;
  background: linear-gradient(135deg, rgba(16,185,129,.98), rgba(14,165,233,.85));
  box-shadow: var(--eg-shadow);
  position: relative;
}

.mi-chatgpt-fab-text{font-size: 14px; letter-spacing: .2px;}

/* presence dot (online) */
.mi-chatgpt-presence{
  width:10px; height:10px; border-radius:999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
  margin-left: 2px;
}
.mi-chatgpt-busy .mi-chatgpt-presence{background:#f59e0b; animation: blink 1s ease-in-out infinite;}
@keyframes blink{0%,100%{opacity:1;}50%{opacity:.35;}}

/* Avatar holográfico */
.mi-chatgpt-avatar{
  width: 34px; height: 34px; border-radius: 999px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
  position: relative; overflow: hidden;
  animation: miPulse 2.2s ease-in-out infinite;
}
.mi-chatgpt-avatar::before{
  content:""; position:absolute; inset:0;
  background-size: 75% 75%;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2064%2064%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3ClinearGradient%20id=%22g%22%20x1=%220%22%20y1=%220%22%20x2=%221%22%20y2=%221%22%3E%0A%20%20%20%20%20%20%3Cstop%20offset=%220%22%20stop-color=%22#0EA5E9%22/%3E%0A%20%20%20%20%20%20%3Cstop%20offset=%221%22%20stop-color=%22#10B981%22/%3E%0A%20%20%20%20%3C/linearGradient%3E%0A%20%20%3C/defs%3E%0A%20%20%3Ccircle%20cx=%2232%22%20cy=%2232%22%20r=%2230%22%20fill=%22url(#g)%22%20opacity=%22.22%22/%3E%0A%20%20%3Ccircle%20cx=%2232%22%20cy=%2228%22%20r=%2214%22%20fill=%22#0b1b14%22%20opacity=%22.10%22/%3E%0A%20%20%3Cpath%20d=%22M20%2044c1.5-7%207-12%2012-12s10.5%205%2012%2012%22%20fill=%22#0b1b14%22%20opacity=%22.10%22/%3E%0A%20%20%3Crect%20x=%2218%22%20y=%2222%22%20width=%2228%22%20height=%2212%22%20rx=%226%22%20fill=%22#0b1b14%22%20opacity=%22.55%22/%3E%0A%20%20%3Crect%20x=%2221%22%20y=%2224%22%20width=%2222%22%20height=%228%22%20rx=%224%22%20fill=%22#ffffff%22%20opacity=%22.20%22/%3E%0A%20%20%3Cpath%20d=%22M24%2026c3-2%207-2%2010%200%22%20stroke=%22#ffffff%22%20stroke-width=%222%22%20opacity=%22.25%22%20fill=%22none%22%20stroke-linecap=%22round%22/%3E%0A%3C/svg%3E");
}
/* halo/holograma */
.mi-chatgpt-avatar::after{
  content:""; position:absolute; inset:-8px;
  border-radius: 999px;
  background: conic-gradient(from 120deg, rgba(14,165,233,.0), rgba(14,165,233,.45), rgba(16,185,129,.35), rgba(14,165,233,.0));
  filter: blur(6px);
  opacity: .65;
  animation: halo 3.5s linear infinite;
}
@keyframes halo{to{transform: rotate(360deg);}}
@keyframes miPulse{0%,100%{transform: scale(1);}50%{transform: scale(1.04);}}

.mi-chatgpt-fab-wrap .mi-chatgpt-widget{width: 380px; max-width: calc(100vw - 36px); margin-bottom: 12px;}

.mi-chatgpt-close{
  position:absolute; right: 10px; top: 10px;
  width: 34px; height: 34px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.75);
  cursor: pointer; font-size: 20px; line-height: 1;
}

.mi-chatgpt-hidden{display:none !important;}
.mi-chatgpt-show{display:block !important;}

@media (max-width: 420px){ .mi-chatgpt-body{height: 290px;} }

/* Role picker overlay */
.mi-chatgpt-role{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.mi-chatgpt-role-card{
  width: 100%;
  max-width: 360px;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: var(--eg-shadow);
  padding: 16px;
}
.mi-chatgpt-role-title{font-weight: 950; font-size: 16px; color: var(--eg-ink);}
.mi-chatgpt-role-sub{margin-top: 6px; font-size: 12px; opacity: .75; color: #10231a;}
.mi-chatgpt-role-grid{display:grid; grid-template-columns: 1fr; gap:10px; margin-top: 14px;}
.mi-chatgpt-role-btn{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(14,165,233,.08));
  cursor:pointer;
  font-weight: 900;
}
.mi-chatgpt-role-btn:hover{filter: brightness(0.98);}
.mi-chatgpt-role-foot{margin-top: 10px; text-align:center; opacity:.75;}

.mi-chatgpt-lock .mi-chatgpt-input,
.mi-chatgpt-lock .mi-chatgpt-send{opacity:.55; pointer-events:none;}
.mi-chip{display:inline-block; font-size: 12px; font-weight: 900; opacity:.78;}
