/* AI QB chat bubble — first-party scripted assistant. No external AI, no third-party chat service, zero cost. */
:root {
  --qbq-teal: #0b6b62;
  --qbq-orange: #e45b2a;
  --qbq-orange-dark: #b83f18;
  --qbq-ink: #122129;
  --qbq-muted: #52636b;
  --qbq-surface: #ffffff;
  --qbq-surface-2: #f7faf8;
  --qbq-line: #c9d8d3;
  --qbq-bar: #0a1411;
}
@media (prefers-color-scheme: dark) {
  :root {
    --qbq-teal: #54c6b8;
    --qbq-orange: #ff8b60;
    --qbq-orange-dark: #ffac8d;
    --qbq-ink: #edf6f3;
    --qbq-muted: #b8cac4;
    --qbq-surface: #142326;
    --qbq-surface-2: #0d171a;
    --qbq-line: #31504b;
    --qbq-bar: #0a1411;
  }
}
.qbq-launcher {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--qbq-bar);
  color: #fff;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: .98rem;
  border: 2px solid var(--qbq-orange);
  cursor: pointer;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
  -webkit-tap-highlight-color: transparent;
}
.qbq-launcher:hover { border-color: var(--qbq-orange-dark); }
.qbq-launcher img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: var(--qbq-surface-2);
  display: block;
}
/* If the page already has a Text Me button bottom-right, dock above it. */
.qbq-launcher.qbq-docked { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.qbq-panel {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 10002;
  width: min(360px, calc(100vw - 32px));
  max-height: min(66vh, 540px);
  display: flex;
  flex-direction: column;
  background: var(--qbq-surface);
  color: var(--qbq-ink);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
  overflow: hidden;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  border: 1px solid var(--qbq-line);
}
.qbq-panel.qbq-docked { bottom: calc(152px + env(safe-area-inset-bottom, 0px)); }
.qbq-panel[hidden] { display: none; }
.qbq-head {
  background: var(--qbq-bar);
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid var(--qbq-orange);
  flex-shrink: 0;
}
.qbq-head img {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; background: rgba(255,255,255,.08);
  border: 2px solid var(--qbq-orange);
  flex-shrink: 0;
}
.qbq-head .qbq-title { line-height: 1.25; flex: 1; min-width: 0; }
.qbq-head .qbq-title strong {
  display: block; font-size: 1rem;
  font-family: "Oswald", "DM Sans", sans-serif;
  letter-spacing: .03em; text-transform: uppercase;
}
.qbq-head .qbq-title span { font-size: .74rem; opacity: .7; }
.qbq-close {
  background: transparent; border: 0; color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  padding: 4px 8px; flex-shrink: 0;
}
.qbq-chat {
  flex: 1; overflow-y: auto; padding: 14px 14px 4px;
  display: flex; flex-direction: column; min-height: 140px;
}
.qbq-msg { max-width: 88%; margin: 0 0 10px; padding: 10px 13px; font-size: .92rem; line-height: 1.5; }
.qbq-msg p { margin: 0 0 8px; }
.qbq-msg p:last-child { margin-bottom: 0; }
.qbq-msg ul { margin: 8px 0 0; padding-left: 18px; font-size: .88rem; }
.qbq-msg li { margin-bottom: 5px; }
.qbq-msg a { color: var(--qbq-teal); font-weight: 700; }
.qbq-qb {
  align-self: flex-start; background: var(--qbq-surface-2);
  border: 1px solid var(--qbq-line); color: var(--qbq-ink);
  border-radius: 14px 14px 14px 4px;
}
.qbq-user {
  align-self: flex-end; background: var(--qbq-teal); color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.qbq-user a { color: #fff; }
.qbq-typing { opacity: .65; font-style: italic; }
.qbq-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.qbq-quick button {
  padding: 8px 13px; border-radius: 999px;
  border: 2px solid var(--qbq-line); background: var(--qbq-surface-2);
  color: var(--qbq-ink); font-weight: 600; font-size: .85rem;
  cursor: pointer; font-family: inherit;
}
.qbq-quick button:hover { border-color: var(--qbq-orange); }
.qbq-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--qbq-line);
  background: var(--qbq-surface-2); flex-shrink: 0;
}
.qbq-input {
  flex: 1; min-width: 0; padding: 10px 14px;
  border-radius: 999px; border: 2px solid var(--qbq-line);
  font-size: .9rem; background: var(--qbq-surface); color: var(--qbq-ink);
  font-family: inherit;
}
.qbq-input:focus { outline: none; border-color: var(--qbq-teal); }
.qbq-send {
  padding: 10px 18px; border-radius: 999px; border: 0;
  background: var(--qbq-orange); color: #fff;
  font-weight: 700; font-size: .9rem; cursor: pointer;
  white-space: nowrap; font-family: inherit;
}
.qbq-send:hover { background: var(--qbq-orange-dark); }
.qbq-disclosure {
  padding: 8px 14px 10px; font-size: .72rem; line-height: 1.45;
  color: var(--qbq-muted); background: var(--qbq-surface-2);
  border-top: 1px solid var(--qbq-line); flex-shrink: 0;
}
@media (max-width: 480px) {
  .qbq-launcher { right: 12px; padding: 7px 14px 7px 7px; font-size: .9rem; }
  .qbq-launcher img { width: 34px; height: 34px; }
  .qbq-panel { right: 12px; }
}
