#aiChatWidget{
  position:fixed;
  right:18px;
  bottom:78px;
  z-index:1001;
}

/* Bubble launcher */
.aiChat-bubble{
  width:56px;
  height:56px;
  border-radius:999px;
  border:none;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  background:#111;
  font-weight:700;
    background-image: url("robot.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 30px;
    font-size: 0;
    color: #111;
    line-height: 0;
}

/* Panel */
.aiChat-panel{
  position:fixed;
  right:18px;
  bottom:90px;

  width:min(380px, calc(100vw - 36px));
  height:min(600px, calc(100vh - 120px));

  background:#0f0f10;
  color:#fff;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.45);

  /* open/close animation */
  display:none;                 /* closed */
  opacity:0;
  transform:translateY(14px) scale(.98);
  filter:blur(2px);
  pointer-events:none;

  /* layout */
  flex-direction:column;

  transition:
    opacity .22s ease,
    transform .22s ease,
    filter .22s ease;
  will-change:opacity,transform,filter;
}

@supports (height: 100dvh) {
  .aiChat-panel{
    height:min(600px, calc(100dvh - 120px));
  }
}

/* open state */
.aiChat-panel.open{
  display:flex;
  opacity:1;
  transform:translateY(0) scale(1);
  filter:blur(0);
  pointer-events:auto;
}

/* Header (same as button) */
.aiChat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px;
  background:#e4ad51;
  color:#0b0b0b;
  border-bottom:1px solid rgba(0,0,0,.12);
}

.aiChat-title{
  font-size:15px;
  font-weight:800;
  letter-spacing:.2px;
}

.aiChat-close{
  background:transparent;
  border:none;
  color:#0b0b0b;
  font-size:22px;
  cursor:pointer;
  opacity:.85;
  line-height:1;
  transition:transform .15s ease, opacity .15s ease;
}
.aiChat-close:hover{ opacity:1; transform:scale(1.06); }

/* Messages */
.aiChat-messages{
  flex:1;
  padding:14px;
  overflow:auto;
  scroll-behavior:smooth;
}

.aiChat-row{
  margin:10px 0;
  display:flex;

  /* message enter */
  animation:aiChatMsgIn .18s ease both;
}
@keyframes aiChatMsgIn{
  from{ opacity:0; transform:translateY(6px); }
  to{ opacity:1; transform:translateY(0); }
}

.aiChat-row.user{ justify-content:flex-end; }

.aiChat-bubbleMsg{
  max-width:85%;
  padding:10px 12px;
  border-radius:14px;
  line-height:1.4;
  font-size:14px;
  white-space:pre-wrap;
}

.aiChat-row.user .aiChat-bubbleMsg{
  background:#2a2a2f;
}

.aiChat-row.bot .aiChat-bubbleMsg{
  background:#1a1a1d;
  border:1px solid rgba(255,255,255,.08);
}

/* Links */
.aiChat-links{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.aiChat-linkBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#fff;
  color:#000;
  border:none;
  cursor:pointer;
  padding:8px 10px;
  border-radius:10px;
  font-size:13px;
  font-weight:800;
  transition:transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.aiChat-linkBtn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(0,0,0,.25);
}

/* Footer */
.aiChat-footer{
  padding:10px;
  border-top:1px solid rgba(255,255,255,.08);
  background:#151518;
  display:flex;
  gap:8px;
}

.aiChat-input{
  flex:1;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:#0f0f10;
  color:#fff;
  padding:10px;
  font-size:14px;
  outline:none;
}

/* SEND BUTTON */
.aiChat-send{
  border-radius:0;
  border:none;
  cursor:pointer;
  font-weight:900;
  padding:10px 14px;
  background:#e4ad51;
  color:#0b0b0b;
  transition:transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.aiChat-send:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(0,0,0,.25);
}
.aiChat-send:active{ transform:translateY(0); box-shadow:none; }
.aiChat-send:disabled{
  opacity:.6;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

/* FULLSCREEN MOBILE */
@media (max-width:600px){


  .aiChat-panel{
    right:0;
    bottom:0;
    width:100vw;
    height:100vh;
    border-radius:0;

    /* nicer fullscreen entrance */
    transform:translateY(18px);
  }

  @supports (height: 100dvh){
    .aiChat-panel{ height:100dvh; }
  }

  /* iOS safe-area padding so footer isn't cut */
  .aiChat-footer{
    padding-bottom:calc(10px + env(safe-area-inset-bottom));
  }

}


.aiChat-header{ position:relative; }
.aiChat-close{ position:relative; z-index:5; pointer-events:auto; }
.aiChat-panel{ pointer-events:none; }
.aiChat-panel.open{ pointer-events:auto; }


.aiChat-typing{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  border-radius:14px;
  background:#1a1a1d;
  border:1px solid rgba(255,255,255,.08);
}
.aiChat-dots{
  display:inline-flex;
  gap:4px;
}
.aiChat-dot{
  width:6px; height:6px; border-radius:99px;
  background:rgba(255,255,255,.85);
  animation: aiDot 1.1s infinite ease-in-out;
}
.aiChat-dot:nth-child(2){ animation-delay:.15s; }
.aiChat-dot:nth-child(3){ animation-delay:.3s; }

@keyframes aiDot{
  0%, 80%, 100%{ transform:translateY(0); opacity:.35; }
  40%{ transform:translateY(-4px); opacity:1; }
}