.sofya-chatbot{
  --sofya-gold:#E2B86A;
  --sofya-blue:#0073e6;
  --sofya-bg:#222222;
  --sofya-header:#161616;
  --sofya-text:#F3F0E8;
  --sofya-muted:#9aa0a8;
  --sofya-user-text:#fff;
  width:100%;
  height:auto;
  min-height:280px;
  max-height:min(640px,78vh);
  margin:auto;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  color:var(--sofya-text);
  color-scheme:dark;
  border:0!important;
  border-radius:10px;
  background:#222222;
  box-shadow:none;
  font-family:"Instrument Sans",sans-serif;
  letter-spacing:-0.01em;
}
.sofya-chatbot.is-floating{
  position:fixed;
  right:22px;
  bottom:96px;
  z-index:99999;
  width:min(420px,calc(100vw - 32px));
  height:auto;
  min-height:260px;
  max-height:min(640px,calc(100vh - 130px));
  margin:0;
}
.sofya-chatbot.is-floating[hidden]{display:none!important}
.sofya-chatbot *,.sofya-chatbot *::before,.sofya-chatbot *::after{box-sizing:border-box}
.sofya-chatbot svg{display:block;max-width:none}
.sofya-chatbot button,.sofya-chatbot textarea,.sofya-launcher{appearance:none;-webkit-appearance:none;font-family:"Instrument Sans",sans-serif}
.sofya-header{
  min-height:78px;
  padding:14px 18px;
  display:flex;
  align-items:center;
  gap:14px;
  border-bottom:0;
  background:#161616;
}
.sofya-avatar{
  width:48px;
  height:48px;
  flex:0 0 48px;
  color:#E2B86A;
  border-radius:50%;
  overflow:hidden;
  border:1px solid #E2B86A!important;
  background:#222222;
  box-shadow:0 0 12px rgba(226,184,106,.7), 0 0 4px rgba(226,184,106,.4);
}
.sofya-avatar img{
  width:100%;
  height:100%;
  max-width:none;
  display:block;
  object-fit:cover;
  object-position:50% 8%;
}
.sofya-avatar-sm{width:36px;height:36px;flex-basis:36px}
.sofya-identity{min-width:0;flex:1;overflow:hidden}
.sofya-header strong{
  display:block;
  color:#fff;
  font-size:21px;
  font-weight:600;
  letter-spacing:-0.03em;
  line-height:1.15;
}
.sofya-header strong em{
  color:#E2B86A;
  font-style:normal;
  font-weight:700;
}
.sofya-header small{
  display:flex;
  align-items:center;
  gap:7px;
  margin-top:5px;
  color:var(--sofya-muted);
  font-size:13px;
}
.sofya-header small i{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#2ee56a;
  box-shadow:0 0 0 4px rgba(46,229,106,.12);
}
.sofya-header-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.sofya-newchat{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:42px;
  padding:0 14px 0 12px;
  border:1px solid #E2B86A!important;
  border-radius:999px;
  background:#E2B86A;
  color:#1A2438;
  cursor:pointer;
  box-shadow:none;
  font-size:13px;
  font-weight:600;
  line-height:1;
  white-space:nowrap;
}
.sofya-newchat svg{width:20px;height:20px;flex:0 0 20px;fill:currentColor}
.sofya-newchat:hover{background:#F0C97A;color:#1A2438}
.sofya-close{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid #0073e6!important;
  border-radius:50%;
  background:#161616;
  color:#0073e6;
  cursor:pointer;
  padding:0;
  box-shadow:none;
}
.sofya-close svg{width:16px;height:16px}
.sofya-close:hover{background:rgba(0,115,230,.12)}
.sofya-messages{
  flex:1 1 auto;
  min-height:88px;
  overflow-x:hidden;
  overflow-y:auto;
  padding:16px 20px 10px;
  background:#222222;
  scroll-behavior:smooth;
  scrollbar-width:thin;
  scrollbar-color:rgba(226,184,106,.7) transparent;
}
.sofya-messages::-webkit-scrollbar{width:4px}
.sofya-messages::-webkit-scrollbar-track{background:transparent}
.sofya-messages::-webkit-scrollbar-thumb{background:#E2B86A;border-radius:4px}
.sofya-message{display:flex;margin-bottom:18px;gap:10px}
.sofya-message.bot{align-items:flex-start;justify-content:flex-start}
.sofya-message.user{justify-content:flex-end}
.sofya-col{display:flex;flex-direction:column;max-width:min(78%,640px)}
.sofya-message.user .sofya-col{align-items:flex-end}
.sofya-bubble{
  padding:13px 17px;
  border-radius:20px;
  font-size:15px;
  line-height:1.62;
  overflow-wrap:anywhere;
  font-weight:400;
}
.sofya-message.bot .sofya-bubble{
  background:#2c2c2c;
  border:1px solid #4a4a4a!important;
  color:var(--sofya-text);
}
.sofya-message.user .sofya-bubble{
  background:#0073e6;
  color:#fff;
  font-weight:600;
  border:1px solid #0073e6!important;
}
.sofya-message.error .sofya-bubble{
  background:#3a1c1c;
  color:#ffd4d4;
  border:1px solid #0073e6!important;
}
.sofya-time,.sofya-meta{
  margin-top:6px;
  color:var(--sofya-muted);
  font-size:11px;
  line-height:1;
}
.sofya-meta{display:flex;align-items:center;gap:6px}
.sofya-ticks{display:inline-flex;color:#0073e6}
.sofya-ticks svg{width:14px;height:14px}
.sofya-bubble pre{
  margin:10px 0 2px;
  padding:12px;
  overflow:auto;
  border-radius:12px;
  background:#161616;
  color:#f4f4f4;
  font-size:12px;
  border:1px solid #0073e6!important;
}
.sofya-bubble code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}
.sofya-bubble :not(pre)>code{padding:2px 5px;border-radius:5px;background:rgba(0,115,230,.16);color:#7ec4ff}
.sofya-message.user .sofya-bubble :not(pre)>code{background:rgba(255,255,255,.16);color:#fff}
.sofya-bubble b,.sofya-bubble strong{color:#fff;font-weight:700}
.sofya-bubble i,.sofya-bubble em{font-style:italic}
.sofya-bubble p{margin:0 0 .7em}
.sofya-bubble p:last-child{margin-bottom:0}
.sofya-bubble ul,.sofya-bubble ol{margin:.55em 0 .2em;padding-left:1.2em}
.sofya-bubble li{margin:.2em 0}
.sofya-bubble a{
  color:#1A2438;
  font-weight:600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  margin:8px 6px 2px 0;
  padding:8px 14px;
  border-radius:999px;
  background:#E2B86A;
  border:1px solid #E2B86A!important;
  line-height:1.25;
  transition:background .18s,color .18s,transform .18s;
}
.sofya-bubble a:hover{
  background:#F0C97A;
  color:#1A2438;
  transform:translateY(-1px);
}
.sofya-typing{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 24px 14px;
  background:#222222;
}
.sofya-typing[hidden]{display:none!important}
.sofya-typing-dots{display:flex;align-items:center;gap:5px;min-height:36px}
.sofya-typing b{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#E2B86A;
  animation:sofya-bounce 1.2s infinite ease-in-out;
}
.sofya-typing b:nth-child(2){animation-delay:.15s}
.sofya-typing b:nth-child(3){animation-delay:.3s}
@keyframes sofya-bounce{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}
.sofya-form{
  flex:0 0 auto!important;
  padding:6px 20px 18px!important;
  margin:0!important;
  background:#222222!important;
  height:auto!important;
  min-height:0!important;
}
html body .sofya-chatbot .sofya-input{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  height:auto!important;
  min-height:56px!important;
  max-height:160px!important;
  padding:6px 6px 6px 20px!important;
  margin:0!important;
  border:1px solid #555!important;
  border-radius:999px!important;
  background:#222222!important;
  box-shadow:none!important;
  width:auto!important;
}
html body .sofya-chatbot .sofya-input:focus-within{box-shadow:none!important}
html body .sofya-chatbot textarea.sofya-textarea{
  all:unset!important;
  display:block!important;
  flex:1 1 auto!important;
  align-self:center!important;
  width:auto!important;
  min-width:0!important;
  height:var(--sofya-ta-h,22px)!important;
  min-height:22px!important;
  max-height:140px!important;
  resize:none!important;
  overflow-y:auto!important;
  box-sizing:border-box!important;
  border:0!important;
  outline:none!important;
  box-shadow:none!important;
  background:transparent!important;
  background-color:transparent!important;
  padding:0!important;
  margin:0!important;
  color:#F3F0E8!important;
  caret-color:#F3F0E8!important;
  -webkit-text-fill-color:#F3F0E8!important;
  font-family:"Instrument Sans",sans-serif!important;
  font-size:14.5px!important;
  font-weight:400!important;
  line-height:1.45!important;
  opacity:1!important;
  color-scheme:dark!important;
}
html body .sofya-chatbot textarea.sofya-textarea::placeholder{
  color:#8B93A7!important;
  -webkit-text-fill-color:#8B93A7!important;
  opacity:1!important;
}
html body .sofya-chatbot textarea.sofya-textarea:placeholder-shown{
  -webkit-text-fill-color:#8B93A7!important;
  color:#8B93A7!important;
}
html body .sofya-chatbot button.sofya-send{
  all:unset!important;
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 44px!important;
  align-self:center!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:#E2B86A!important;
  background-color:#E2B86A!important;
  background-image:linear-gradient(180deg,#F0C97A,#E2B86A)!important;
  color:#1A2438!important;
  cursor:pointer!important;
  box-shadow:0 8px 20px rgba(226,184,106,.38)!important;
  line-height:0!important;
  overflow:hidden!important;
}
html body .sofya-chatbot button.sofya-send svg{
  display:block!important;
  width:20px!important;
  height:20px!important;
  max-width:20px!important;
  fill:#1A2438!important;
  stroke:none!important;
}
html body .sofya-chatbot button.sofya-send:hover:not(:disabled){transform:translateY(-1px)!important}
html body .sofya-chatbot button.sofya-send:disabled{opacity:.5!important;cursor:not-allowed!important;transform:none!important}
.sofya-launcher{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:99999;
  width:64px;
  height:64px;
  padding:0;
  border:1px solid #0073e6!important;
  border-radius:50%;
  background:#222222;
  box-shadow:0 0 15px rgba(0,115,230,.45);
  cursor:pointer;
  display:grid;
  place-items:center;
  color:#0073e6;
}
.sofya-launcher .sofya-avatar,
.sofya-launcher .sofya-avatar img{width:52px;height:52px;flex:none;border:0}
.sofya-launcher:hover{transform:translateY(-2px)}
@media(max-width:640px){
  .sofya-chatbot{width:100%;min-height:220px;max-height:min(58vh,420px);border-radius:10px}
  .sofya-chatbot.is-floating{right:12px;bottom:88px;width:calc(100vw - 24px);min-height:210px;max-height:min(52vh,400px)}
  .sofya-launcher{right:12px;bottom:16px}
  .sofya-header{padding:14px}
  .sofya-header strong{font-size:18px}
  .sofya-messages{padding:14px 12px 8px;min-height:72px}
  .sofya-col{max-width:86%}
  .sofya-bubble{font-size:13.5px}
  html body .sofya-chatbot .sofya-form{padding:8px 12px 14px!important}
  .sofya-newchat span{display:none}
  .sofya-newchat{width:42px;padding:0;justify-content:center}
}
