:root{
  --zenbot-primary:#22c55e;
  --zenbot-primary-hover:#16a34a;
  --zenbot-bg:#ffffff;
  --zenbot-soft:#f9fafb;
  --zenbot-border:#e5e7eb;
  --zenbot-text:#111827;
  --zenbot-muted:#6b7280;
}

.zenbot-btn{
  position:fixed;
  right:20px;
  bottom:20px;
  width:58px;
  height:58px;
  border:0;
  border-radius:999px;
  background:var(--zenbot-primary);
  color:#fff;
  font-size:27px;
  line-height:1;
  cursor:pointer;
  z-index:99999;
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.zenbot-btn:hover,
.zenbot-btn:focus-visible{
  background:var(--zenbot-primary-hover);
  transform:translateY(-2px);
  box-shadow:0 14px 32px rgba(0,0,0,.25);
  outline:none;
}

.zenbot-box{
  position:fixed;
  right:20px;
  bottom:20px;
  width:340px;
  height:470px;
  max-width:calc(100vw - 24px);
  max-height:calc(100vh - 24px);
  display:none;
  flex-direction:column;
  overflow:hidden;
  z-index:99999;
  background:var(--zenbot-bg);
  color:var(--zenbot-text);
  border-radius:18px;
  box-shadow:0 16px 46px rgba(0,0,0,.22);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.zenbot-box.is-open{
  display:flex;
}

.zenbot-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 16px;
  background:var(--zenbot-primary);
  color:#fff;
  font-size:15px;
  font-weight:700;
}

.zenbot-close{
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:23px;
  line-height:1;
  cursor:pointer;
}

.zenbot-close:hover,
.zenbot-close:focus-visible{
  background:rgba(255,255,255,.24);
  outline:none;
}

.zenbot-log{
  flex:1;
  padding:14px;
  overflow-y:auto;
  background:var(--zenbot-soft);
  font-size:13px;
  line-height:1.45;
  scrollbar-width:thin;
}

.zenbot-log p{
  margin:0 0 10px;
}

.zenbot-log p.me{
  text-align:right;
}

.zenbot-log p span{
  display:inline-block;
  max-width:86%;
  padding:8px 10px;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
}

.zenbot-log p.me span{
  background:var(--zenbot-primary);
  color:#fff;
  border-radius:13px 13px 3px 13px;
}

.zenbot-log p.bot span{
  background:#e5e7eb;
  color:#111827;
  border-radius:13px 13px 13px 3px;
}

.zenbot-log p.info{
  color:var(--zenbot-muted);
  font-style:italic;
}

.zenbot-foot{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px;
  border-top:1px solid var(--zenbot-border);
  background:#fff;
}

.zenbot-foot input{
  min-width:0;
  flex:1;
  height:38px;
  padding:0 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  color:#111827;
  font-size:13px;
  outline:none;
}

.zenbot-foot input:focus{
  border-color:var(--zenbot-primary);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--zenbot-primary) 18%, transparent);
}

.zenbot-foot button{
  height:38px;
  padding:0 14px;
  border:0;
  border-radius:10px;
  background:var(--zenbot-primary);
  color:#fff;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}

.zenbot-foot button:hover,
.zenbot-foot button:focus-visible{
  background:var(--zenbot-primary-hover);
  outline:none;
}

.zenbot-foot button:disabled,
.zenbot-foot input:disabled{
  opacity:.65;
  cursor:not-allowed;
}

@media (max-width:480px){
  .zenbot-btn{
    right:16px;
    bottom:16px;
  }

  .zenbot-box{
    right:12px;
    bottom:84px;
    width:calc(100vw - 24px);
    height:min(540px, calc(100vh - 108px));
  }
}
