/* =========================================================================
   The assistant panel.

   Sits on the dark ground like everything else. The disclosure line is part
   of the component rather than a footnote, because the whole argument for
   putting an AI on a trust-selling page is that it says what it is.
   ========================================================================= */

.db-assistant{background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); overflow:hidden; max-width:760px;
  box-shadow:var(--shadow);}

.db-assistant__head{display:flex; align-items:center; gap:9px; flex-wrap:wrap;
  padding:14px 20px; border-bottom:1px solid var(--line); background:var(--band-alt);}
.db-assistant__head b{font-size:15px; font-weight:600;}
.db-assistant__note{font-size:13px; color:var(--text-faint);}
.db-assistant__dot{width:8px; height:8px; border-radius:50%; background:var(--blue);
  box-shadow:0 0 0 0 rgba(63,185,255,.6); animation:pulse 2.6s infinite; flex:0 0 auto;}

.db-assistant__log{padding:20px; display:flex; flex-direction:column; gap:14px;
  max-height:min(56vh, 460px); overflow-y:auto; scroll-behavior:smooth;}

.db-msg{max-width:88%; font-size:16px; line-height:1.6;}
.db-msg p{margin:0 0 9px; max-width:none;}
.db-msg p:last-child{margin-bottom:0;}
.db-msg--bot{align-self:flex-start; color:var(--text);}
.db-msg--me{align-self:flex-end; background:var(--blue-soft); color:var(--text);
  padding:11px 15px; border-radius:var(--r-sm) var(--r-sm) 2px var(--r-sm);}

/* Three dots while it thinks. Motion here is worth it: a chat that goes silent
   for two seconds reads as broken. */
.db-msg--wait{display:flex; gap:5px; align-items:center; padding:6px 0;}
.db-msg--wait span{width:7px; height:7px; border-radius:50%; background:var(--text-faint);
  animation:dbdot 1.25s ease-in-out infinite;}
.db-msg--wait span:nth-child(2){animation-delay:.16s}
.db-msg--wait span:nth-child(3){animation-delay:.32s}
@keyframes dbdot{0%,60%,100%{opacity:.25; transform:translateY(0)}
  30%{opacity:1; transform:translateY(-4px)}}

.db-assistant__form{display:flex; gap:10px; align-items:flex-end;
  padding:14px 20px; border-top:1px solid var(--line); background:var(--band-alt);}
.db-assistant__form textarea{flex:1; resize:none; font:inherit; font-size:16px;
  line-height:1.5; padding:11px 14px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:var(--ground); color:var(--text);
  max-height:132px; overflow-y:auto;}
.db-assistant__form textarea:focus{outline:2px solid var(--blue); outline-offset:1px;}
.db-assistant.is-busy{opacity:.86;}

/* The capture form, inside the conversation rather than after it. */
.db-capture{display:grid; gap:11px; padding:18px; border-radius:var(--r-sm);
  background:var(--band-alt); border:1px solid var(--line);}
.db-capture__intro{margin:0; font-size:15px; color:var(--text-soft);}
.db-capture label{display:grid; gap:5px; font-size:13.5px; color:var(--text-soft);}
.db-capture input[type=text], .db-capture input[type=email], .db-capture input:not([type]){
  font:inherit; font-size:16px; padding:10px 13px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:var(--ground); color:var(--text);}
.db-capture input:focus{outline:2px solid var(--blue); outline-offset:1px;}
.db-capture__consent{grid-template-columns:auto 1fr; align-items:start; gap:10px;
  font-size:13.5px; line-height:1.5;}
.db-capture__consent input{margin-top:3px; width:17px; height:17px; accent-color:var(--blue);}
.db-capture__consent a{color:var(--blue); text-decoration:underline;}
.db-capture__err{margin:0; font-size:14px; color:var(--crit);}
.db-capture button{justify-self:start;}

.db-sr{position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;}

@media (max-width:620px){
  .db-assistant__log{padding:16px; max-height:none;}
  .db-assistant__form{padding:12px 16px;}
  .db-msg{max-width:94%; font-size:15.5px;}
}

@media (prefers-reduced-motion:reduce){
  .db-msg--wait span{animation:none; opacity:.55;}
  .db-assistant__dot{animation:none;}
  .db-assistant__log{scroll-behavior:auto;}
}
