/* Conlee site assistant. Everything is scoped under #conlee-bot; colors come from the site variables only. */
#conlee-bot{visibility:visible; font-family:"Geist",system-ui,-apple-system,"Segoe UI",sans-serif; color:var(--text); letter-spacing:-.01em; line-height:1.45}
#conlee-bot *,#conlee-bot *::before,#conlee-bot *::after{box-sizing:border-box}
#conlee-bot button{font:inherit}
#conlee-bot :is(button,a,textarea):focus-visible{outline:2px solid var(--ink); outline-offset:2px}

/* launcher */
#conlee-bot .cb-launcher{
  position:fixed; z-index:60;
  right:calc(16px + env(safe-area-inset-right)); bottom:calc(16px + env(safe-area-inset-bottom));
  transform:translateY(calc(-1 * var(--cb-lift, 0px)));
  display:inline-flex; align-items:center; gap:8px; height:52px; min-width:52px; padding:0 12px;
  border-radius:999px; border:1px solid var(--ink); background:var(--ink); color:var(--bg);
  font-size:14px; font-weight:500; cursor:pointer;
  box-shadow:0 2px 6px var(--glow), 0 12px 32px -8px var(--glow);
  transition:opacity .18s, translate .18s;
}
#conlee-bot .cb-launcher:hover{opacity:.88; translate:0 -1px}
#conlee-bot .cb-launcher:focus-visible{outline-offset:3px}
#conlee-bot .cb-launcher-mark{display:grid; place-items:center; width:26px; height:26px; flex:none}
#conlee-bot .cb-launcher-mark svg{display:block}
#conlee-bot .cb-launcher-label{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}
#conlee-bot.cb-open .cb-launcher{display:none}
#conlee-bot.cb-tuck .cb-launcher{opacity:0; translate:0 28px; pointer-events:none}
@media (min-width:761px){
  #conlee-bot .cb-launcher{right:calc(24px + env(safe-area-inset-right)); bottom:calc(24px + env(safe-area-inset-bottom)); padding:0 18px 0 13px}
  #conlee-bot .cb-launcher-label{position:static; width:auto; height:auto; overflow:visible; clip:auto}
}

/* panel */
#conlee-bot .cb-panel{
  position:fixed; z-index:61;
  right:calc(24px + env(safe-area-inset-right)); bottom:calc(24px + env(safe-area-inset-bottom));
  width:380px; height:min(560px, calc(100dvh - 48px));
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--bg); border:1px solid var(--line2); border-radius:18px;
  box-shadow:0 2px 8px var(--glow), 0 24px 64px -16px var(--glow);
  transform-origin:bottom right; animation:cbIn .2s cubic-bezier(.2,.8,.2,1);
}
#conlee-bot .cb-panel[hidden]{display:none}
#conlee-bot .cb-panel:focus{outline:none}
@keyframes cbIn{from{opacity:0; transform:translateY(10px) scale(.98)} to{opacity:1; transform:none}}

#conlee-bot .cb-head{display:flex; align-items:center; gap:10px; padding:12px 10px 12px 14px; border-bottom:1px solid var(--line); flex:none}
#conlee-bot .cb-avatar{display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:50%; border:1px solid var(--line2); color:var(--ink)}
#conlee-bot .cb-avatar svg{width:20px; height:20px; display:block}
#conlee-bot .cb-titles{min-width:0; flex:1}
#conlee-bot .cb-title{color:var(--ink); font-size:14.5px; font-weight:600; letter-spacing:-.02em; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
#conlee-bot .cb-sub{font-family:"Geist Mono",ui-monospace,"SF Mono",Menlo,monospace; letter-spacing:0; font-size:11.5px; color:var(--muted); line-height:1.3; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
#conlee-bot .cb-icon{display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:50%; border:1px solid transparent; background:transparent; color:var(--muted); cursor:pointer; transition:color .18s, border-color .18s}
#conlee-bot .cb-icon:hover{color:var(--ink); border-color:var(--line2)}
#conlee-bot .cb-icon svg{display:block}

/* messages */
#conlee-bot .cb-log{flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:16px 14px 12px; display:flex; flex-direction:column; gap:8px; scrollbar-width:thin; scrollbar-color:var(--line2) transparent}
#conlee-bot .cb-msg{max-width:86%; padding:9px 13px; border-radius:16px; font-size:14.5px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere}
#conlee-bot .cb-user{align-self:flex-end; background:var(--ink); color:var(--bg); border-bottom-right-radius:6px}
#conlee-bot .cb-assistant{align-self:flex-start; background:var(--bg2); color:var(--text); border:1px solid var(--line); border-bottom-left-radius:6px}
#conlee-bot .cb-msg a,#conlee-bot .cb-note a{color:inherit; text-decoration:underline; text-underline-offset:2px; text-decoration-thickness:1px}
#conlee-bot .cb-note{align-self:center; max-width:92%; text-align:center; font-family:"Geist Mono",ui-monospace,"SF Mono",Menlo,monospace; letter-spacing:0; font-size:12px; color:var(--muted); padding:2px 8px}
#conlee-bot .cb-note-err{border:1px solid var(--line2); border-radius:12px; padding:6px 12px}

#conlee-bot .cb-chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:2px}
#conlee-bot .cb-chip{border:1px solid var(--line2); background:transparent; color:var(--ink); border-radius:999px; padding:7px 13px; font-size:13.5px; line-height:1.3; cursor:pointer; transition:border-color .18s, background .18s}
#conlee-bot .cb-chip:hover{border-color:var(--ink); background:var(--bg2)}

#conlee-bot .cb-typing{display:inline-flex; gap:4px; align-items:center; padding:13px 14px}
#conlee-bot .cb-typing i{width:6px; height:6px; border-radius:50%; background:var(--muted); animation:cbDot 1.2s ease-in-out infinite}
#conlee-bot .cb-typing i:nth-child(2){animation-delay:.15s}
#conlee-bot .cb-typing i:nth-child(3){animation-delay:.3s}
@keyframes cbDot{0%,60%,100%{opacity:.3; transform:none} 30%{opacity:1; transform:translateY(-2px)}}

/* composer */
#conlee-bot .cb-form{flex:none; margin:0; padding:10px 12px 12px; border-top:1px solid var(--line); background:var(--bg)}
#conlee-bot .cb-field{display:flex; align-items:flex-end; gap:6px; border:1px solid var(--line2); border-radius:22px; padding:5px 5px 5px 14px; background:var(--bg2); transition:border-color .18s}
#conlee-bot .cb-field:focus-within{border-color:var(--ink)}
#conlee-bot .cb-input{flex:1; min-width:0; resize:none; border:0; outline:none; background:transparent; color:var(--ink); font:inherit; font-size:14.5px; line-height:1.45; padding:6px 0; max-height:132px; overflow-y:auto}
#conlee-bot .cb-input::placeholder{color:var(--muted)}
#conlee-bot .cb-input:focus-visible{outline:none}
#conlee-bot .cb-send{display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:50%; border:0; background:var(--ink); color:var(--bg); cursor:pointer; transition:opacity .18s}
#conlee-bot .cb-send:disabled{opacity:.3; cursor:default}
#conlee-bot .cb-send svg{display:block}

/* phones: full-screen sheet that follows the visual viewport (on-screen keyboard) */
@media (max-width:640px){
  #conlee-bot .cb-panel{
    left:0; right:0; bottom:auto; top:var(--cb-vt, 0px);
    width:100%; height:var(--cb-vh, 100dvh);
    border:0; border-radius:0; box-shadow:none; transform-origin:bottom center;
  }
  #conlee-bot .cb-head{padding-top:calc(10px + env(safe-area-inset-top)); padding-left:calc(14px + env(safe-area-inset-left)); padding-right:calc(10px + env(safe-area-inset-right))}
  #conlee-bot .cb-form{padding-bottom:calc(12px + env(safe-area-inset-bottom)); padding-left:calc(12px + env(safe-area-inset-left)); padding-right:calc(12px + env(safe-area-inset-right))}
  #conlee-bot .cb-panel.cb-kb .cb-form{padding-bottom:10px}
  #conlee-bot .cb-input{font-size:16px} /* below 16px iOS zooms the page on focus */
  #conlee-bot .cb-msg{max-width:88%}
}

@media (prefers-reduced-motion:reduce){
  #conlee-bot .cb-panel{animation:none}
  #conlee-bot .cb-typing i{animation:none; opacity:.6}
}
@media print{#conlee-bot{display:none}}
