/* FERNER text chat — own UI, Ferner glass/lilac look.
   Launcher sits bottom-right ABOVE the phone/voice widget. */
.ferner-chat-trigger{
  position:fixed;
  right:18px;
  bottom:calc(env(safe-area-inset-bottom,0px) + 92px);
  z-index:60;
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding:11px 17px 12px;
  border:1px solid rgba(216,173,255,.34);
  border-radius:999px;
  background:linear-gradient(145deg, rgba(28,22,42,.86), rgba(10,9,16,.84));
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
  color:rgba(246,242,252,.92);
  font:600 11px/1 var(--font-interface, sans-serif);
  letter-spacing:.18em;
  text-transform:uppercase;
  cursor:pointer;
  box-shadow:0 10px 34px rgba(0,0,0,.46), 0 0 22px rgba(150,92,255,.16);
  transition:transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.ferner-chat-trigger:hover{
  transform:translateY(-1px);
  border-color:rgba(216,173,255,.6);
  box-shadow:0 14px 40px rgba(0,0,0,.5), 0 0 30px rgba(150,92,255,.28);
}
.ferner-chat-trigger .dot{
  width:7px; height:7px; border-radius:50%;
  background:#c89bff;
  box-shadow:0 0 10px 2px rgba(184,124,255,.7);
}

/* Panel */
.ferner-chat-panel{
  position:fixed;
  right:18px;
  bottom:calc(env(safe-area-inset-bottom,0px) + 92px);
  z-index:61;
  width:min(370px, calc(100vw - 32px));
  height:min(540px, calc(100vh - 140px));
  display:flex;
  flex-direction:column;
  border:1px solid rgba(216,173,255,.18);
  border-radius:22px;
  overflow:hidden;
  background:linear-gradient(160deg, rgba(18,15,26,.97), rgba(6,6,11,.97));
  box-shadow:0 28px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05), 0 0 40px rgba(150,92,255,.1);
  opacity:0;
  transform:translateY(14px) scale(.98);
  transform-origin:bottom right;
  pointer-events:none;
  transition:opacity .26s ease, transform .26s cubic-bezier(.16,1,.3,1);
}
.ferner-chat-panel.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
.ferner-chat-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:18px 18px 14px;
  border-bottom:1px solid rgba(255,255,255,.07);
  background:linear-gradient(180deg, rgba(150,92,255,.08), transparent);
}
.ferner-chat-head h3{
  margin:0;
  font:500 19px/1 var(--font-display, Georgia, serif);
  letter-spacing:-.01em;
  color:rgba(248,244,255,.96);
}
.ferner-chat-head p{
  margin:5px 0 0;
  font:400 11px/1.4 var(--font-interface, sans-serif);
  color:rgba(228,220,245,.5);
}
.ferner-chat-close{
  flex:0 0 auto;
  width:28px; height:28px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.7);
  font-size:18px; line-height:1;
  cursor:pointer;
}
.ferner-chat-thread{
  flex:1 1 auto;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  -webkit-overflow-scrolling:touch;
}
.ferner-msg{
  max-width:84%;
  padding:10px 13px;
  border-radius:14px;
  font:400 13px/1.45 var(--font-interface, sans-serif);
  white-space:pre-wrap;
  word-wrap:break-word;
}
.ferner-msg.bot{
  align-self:flex-start;
  background:rgba(150,92,255,.12);
  border:1px solid rgba(184,124,255,.2);
  color:rgba(244,240,252,.94);
}
.ferner-msg.user{
  align-self:flex-end;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.1);
  color:rgba(246,246,250,.94);
}
.ferner-msg.meta{
  align-self:center;
  background:transparent;
  color:rgba(228,220,245,.42);
  font-size:11px;
  text-align:center;
  padding:2px 8px;
}
.ferner-msg.typing{ color:rgba(228,220,245,.6); font-style:italic; }
.ferner-chat-foot{
  flex:0 0 auto;
  padding:12px;
  border-top:1px solid rgba(255,255,255,.07);
  background:rgba(0,0,0,.2);
}
.ferner-chat-inputrow{
  display:flex;
  gap:8px;
  align-items:flex-end;
}
.ferner-chat-input{
  flex:1 1 auto;
  resize:none;
  max-height:120px;
  min-height:42px;
  padding:11px 12px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:13px;
  background:rgba(255,255,255,.04);
  color:rgba(246,246,250,.96);
  font:400 13px/1.4 var(--font-interface, sans-serif);
  outline:none;
}
.ferner-chat-input:focus{ border-color:rgba(184,124,255,.5); }
.ferner-chat-send{
  flex:0 0 auto;
  width:44px; height:44px;
  border-radius:13px;
  border:1px solid rgba(216,173,255,.4);
  background:linear-gradient(145deg, rgba(150,92,255,.4), rgba(120,70,232,.3));
  color:#fff;
  font-size:18px;
  cursor:pointer;
  transition:filter .2s ease, transform .12s ease;
}
.ferner-chat-send:hover{ filter:brightness(1.18); }
.ferner-chat-send:active{ transform:scale(.94); }
.ferner-chat-send:disabled{ opacity:.4; cursor:default; }

/* honeypot — hidden from humans, bait for bots */
.ferner-chat-hp{ position:absolute; left:-9999px; width:1px; height:1px; opacity:0; }

@media (max-width:640px){
  .ferner-chat-panel{
    right:0; left:0; bottom:0;
    width:100%;
    height:78vh;
    border-radius:22px 22px 0 0;
    transform-origin:bottom center;
  }
  .ferner-chat-trigger{ bottom:calc(env(safe-area-inset-bottom,0px) + 84px); right:14px; }
}
