/* Build Studio triage chat — draft widget */
.bs-chat-fab{
  position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));
  z-index:80;width:52px;height:52px;border-radius:50%;border:0;cursor:pointer;
  background:linear-gradient(135deg,#E0A96D,#c8894a);color:#14100a;
  box-shadow:0 8px 24px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;
  padding:0;
}
.bs-chat-fab:hover{filter:brightness(1.06)}
.bs-chat-fab:focus-visible{outline:2px solid #E0A96D;outline-offset:3px}
.bs-chat-fab svg{width:24px;height:24px;display:block}
.bs-chat-fab[hidden],.bs-chat-panel[hidden]{display:none!important}

.bs-chat-panel{
  position:fixed;z-index:90;
  right:max(16px,env(safe-area-inset-right));
  bottom:max(16px,env(safe-area-inset-bottom));
  width:min(380px,calc(100vw - 24px));
  height:min(640px,calc(100vh - 24px - env(safe-area-inset-top,0px)));
  max-height:calc(100dvh - 24px);
  display:flex;flex-direction:column;
  background:#1A0D12;color:#F5E9EC;
  border:1px solid #4A2A36;border-radius:16px;
  box-shadow:0 16px 48px rgba(0,0,0,.45);
  overflow:hidden;font-family:Karla,system-ui,sans-serif;
}
@media (max-width:430px){
  .bs-chat-panel{
    right:8px;left:8px;bottom:8px;width:auto;
    height:min(85dvh,640px);
    border-radius:14px;
  }
}

.bs-chat-head{
  display:flex;align-items:center;gap:10px;
  padding:12px 12px 12px 16px;
  border-bottom:1px solid #3A2029;
  background:#200F16;flex:0 0 auto;
}
.bs-chat-head h2{
  margin:0;font:700 16px/1.3 "Libre Caslon Text",Georgia,serif;color:#F5E9EC;
  flex:1;
}
.bs-chat-head button{
  background:transparent;border:0;color:#C9AEB7;cursor:pointer;
  width:40px;height:40px;border-radius:8px;display:flex;align-items:center;justify-content:center;
}
.bs-chat-head button:hover{background:#26141B;color:#F5E9EC}
.bs-chat-head button svg{width:18px;height:18px}

.bs-chat-log{
  flex:1 1 auto;overflow:auto;-webkit-overflow-scrolling:touch;
  padding:14px 14px 8px;display:flex;flex-direction:column;gap:10px;
}
.bs-chat-msg{
  max-width:88%;padding:10px 12px;border-radius:12px;
  font-size:15px;line-height:1.45;white-space:pre-wrap;word-break:break-word;
}
.bs-chat-msg.is-assistant{align-self:flex-start;background:#26141B;border:1px solid #4A2A36;color:#F5E9EC}
.bs-chat-msg.is-user{align-self:flex-end;background:#9E2B47;border:1px solid #9E2B47;color:#fff}
.bs-chat-msg .bs-chat-speak{
  display:block;margin-top:6px;background:none;border:0;color:#E0A96D;
  font:600 12px/1 Karla,sans-serif;cursor:pointer;padding:0;
}

.bs-chat-form{
  margin:4px 12px 6px;padding:10px 10px 8px;border:1px solid #4A2A36;border-radius:12px;background:#26141B;
  flex:0 0 auto;overflow:auto;max-height:42%;
}
.bs-chat-form[hidden]{display:none!important}
.bs-chat-form p{margin:0 0 6px;font-size:13px;line-height:1.35;color:#C9AEB7}
.bs-chat-form label{display:block;font-size:11px;color:#E0A96D;margin:5px 0 2px}
.bs-chat-form input{
  width:100%;box-sizing:border-box;border:1px solid #4A2A36;border-radius:8px;
  background:#1A0D12;color:#F5E9EC;padding:6px 10px;font:14px/1.3 Karla,sans-serif;
}
.bs-chat-form .bs-chat-form-actions{margin-top:8px;display:flex;gap:8px;position:sticky;bottom:0;background:#26141B;padding-top:6px}
.bs-chat-form button{
  flex:1;border:0;border-radius:8px;padding:8px 12px;cursor:pointer;
  font:600 13px Karla,sans-serif;background:#9E2B47;color:#fff;
}
.bs-chat-form button.bs-chat-skip{background:transparent;color:#C9AEB7;border:1px solid #4A2A36}

.bs-chat-composer{
  flex:0 0 auto;border-top:1px solid #3A2029;padding:10px 10px 6px;
  display:flex;gap:6px;align-items:flex-end;background:#200F16;
}
.bs-chat-composer textarea{
  flex:1;resize:none;min-height:42px;max-height:120px;
  border:1px solid #4A2A36;border-radius:10px;background:#1A0D12;color:#F5E9EC;
  font:15px/1.4 Karla,sans-serif;padding:10px 12px;
}
.bs-chat-composer textarea:focus{outline:1px solid #E0A96D}
.bs-chat-composer button{
  width:42px;height:42px;border:0;border-radius:10px;cursor:pointer;
  background:#9E2B47;color:#fff;display:flex;align-items:center;justify-content:center;flex:0 0 42px;
}
.bs-chat-composer button:disabled{opacity:.45;cursor:default}
.bs-chat-composer button.bs-chat-mic{background:#26141B;color:#E0A96D;border:1px solid #4A2A36}
.bs-chat-composer button.bs-chat-mic.is-on{background:#E0A96D;color:#14100a}
.bs-chat-composer button.bs-chat-mic[hidden]{display:none!important}
.bs-chat-composer svg{width:18px;height:18px}

.bs-chat-disclaimer{
  flex:0 0 auto;margin:0;padding:4px 14px 10px;
  font-size:11px;line-height:1.4;color:#8a6f78;background:#200F16;
}
.bs-chat-status{padding:0 14px 8px;font-size:13px;color:#E0A96D;background:#200F16}
.bs-chat-status[hidden]{display:none!important}

.audit.chat-entry p{
  max-width:36em;margin:8px auto 0;font-size:16px;line-height:1.45;
}
.audit.chat-entry h3{margin-bottom:0}

@media (prefers-reduced-motion:reduce){
  .bs-chat-panel,.bs-chat-fab{transition:none}
}

@media (max-width:430px){
  .bs-chat-panel{height:min(85dvh, calc(100dvh - 16px));}
  body{padding-bottom:88px;}
}
