/* ==========================================================================
   Chat assistant — floating button + small scripted chat window
   ========================================================================== */
.cb-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 260;
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px; cursor: pointer; font-family: inherit;
  background: var(--black); color: var(--white);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(4,4,4,0.22);
  transform: translateY(16px); opacity: 0; pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease, background 0.2s;
}
.cb-fab.is-on { transform: none; opacity: 1; pointer-events: auto; }
.cb-fab:hover { background: var(--maroon); }
.cb-fab svg { width: 20px; height: 20px; fill: currentColor; }
.cb-fab .dot { position: absolute; top: 10px; left: 30px; width: 9px; height: 9px; border-radius: 50%; background: var(--maroon); box-shadow: 0 0 0 2px var(--black); }
.cb-fab:hover .dot { background: var(--white); box-shadow: 0 0 0 2px var(--maroon); }

.cb {
  position: fixed; right: 22px; bottom: 22px; z-index: 270;
  width: 370px; height: min(600px, calc(100vh - 44px)); height: min(600px, calc(100svh - 44px));
  display: flex; flex-direction: column; background: var(--white);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(4,4,4,0.24), 0 2px 10px rgba(4,4,4,0.08);
  transform-origin: 100% 100%; transform: translateY(12px) scale(0.96); opacity: 0; visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.25s ease, visibility 0s linear 0.4s;
}
.cb.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }

.cb-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--black); color: var(--white); }
.cb-logo { width: 38px; height: 38px; border-radius: 50%; background: var(--white); display: grid; place-items: center; overflow: hidden; flex: none; }
.cb-logo img { width: 30px; height: auto; }
.cb-head b { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.cb-head small { display: block; font-size: 11.5px; color: rgba(255,255,255,0.62); margin-top: 2px; }
.cb-x { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; color: var(--white); cursor: pointer; }
.cb-x:hover { border-color: var(--white); }
.cb-x svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 1.7; fill: none; }

.cb-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; background: var(--white); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.cb-msg { max-width: 86%; padding: 10px 13px; font-size: 14px; line-height: 1.5; border-radius: 14px; white-space: pre-line; animation: cb-in 0.35s cubic-bezier(0.23, 1, 0.32, 1); }
.cb-msg.bot { align-self: flex-start; background: var(--grey-050); color: var(--ink, #141213); border-bottom-left-radius: 4px; }
.cb-msg.me { align-self: flex-end; background: var(--maroon); color: var(--white); border-bottom-right-radius: 4px; }
.cb-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cb-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--grey-050); border-radius: 14px; border-bottom-left-radius: 4px; }
.cb-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--grey-400); animation: cb-dot 1s infinite ease-in-out; }
.cb-typing i:nth-child(2) { animation-delay: 0.15s; } .cb-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cb-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes cb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cb-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 4px; animation: cb-in 0.35s cubic-bezier(0.23, 1, 0.32, 1); }
.cb-chip { font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 999px; cursor: pointer; background: var(--white); color: var(--ink, #141213); border: 1px solid rgba(4,4,4,0.18); transition: border-color 0.2s, color 0.2s, background 0.2s; text-align: left; }
.cb-chip:hover { border-color: var(--maroon); color: var(--maroon); }
.cb-chip.solid { background: var(--maroon); border-color: var(--maroon); color: var(--white); }
.cb-chip.solid:hover { background: var(--maroon-bright, #8a1330); color: var(--white); }
.cb-chip svg { width: 14px; height: 14px; fill: currentColor; vertical-align: -2px; margin-right: 6px; }

.cb-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid rgba(4,4,4,0.08); background: var(--white); }
.cb-form input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid rgba(4,4,4,0.14); border-radius: 999px; background: var(--grey-050); color: var(--ink, #141213); }
.cb-form input:focus { outline: none; border-color: var(--maroon); background: var(--white); }
.cb-form input:disabled { opacity: 0.55; }
.cb-send { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--maroon); color: var(--white); cursor: pointer; display: grid; place-items: center; }
.cb-send:disabled { background: var(--grey-400); cursor: default; }
.cb-send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.cb-foot { padding: 0 12px 10px; font-size: 11px; color: var(--grey-400); text-align: center; }
.cb-foot a { color: inherit; }

@media (max-width: 680px) {
  .cb-fab { right: 14px; bottom: 14px; width: 54px; padding: 0; justify-content: center; }
  .cb-fab span { display: none; }
  .cb-fab .dot { top: 11px; left: 31px; }
  .cb { right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .cb, .cb-fab, .cb-msg, .cb-chips { transition: none; animation: none; } }

.cb-pp { display: block; margin-top: 6px; font-size: 11px; line-height: 1.45; opacity: 0.7; }
.cb-pp a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.qt-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
