/* support_widget.css -- the floating Qumanity Support chat (2026-12-02, homepage redesign Step 1).
   Loaded only by templates/partials/_support_widget.html. Every value is local (--qs-* tokens),
   because the public pages that include it load different stylesheets (style.css alone, or with
   home.css/cosmic.css/about.css...) and this must look identical on all of them. Positioned
   fixed above everything else, including cosmic.css's particle canvas (z-index 0) and the sticky
   nav. */
.qs-root {
  --qs-bg: #14173a;
  --qs-bg-2: #1d2150;
  --qs-ink: #f3efe2;
  --qs-mute: #a9adcc;
  --qs-line: rgba(212, 175, 55, 0.38);
  --qs-saffron: #ff9933;
  --qs-gold: #d4af37;
  --qs-gap: 20px;
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--qs-ink);
}
.qs-root *, .qs-root *::before, .qs-root *::after { box-sizing: border-box; }

.qs-fab {
  position: fixed;
  right: calc(var(--qs-gap) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--qs-gap) + env(safe-area-inset-bottom, 0px));
  z-index: 950;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(135deg, var(--qs-saffron), var(--qs-gold));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.qs-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45); }
.qs-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.qs-fab svg { width: 26px; height: 26px; fill: none; stroke: #1a1300; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qs-fab .qs-fab-x { display: none; }
.qs-fab[aria-expanded="true"] .qs-fab-icon { display: none; }
.qs-fab[aria-expanded="true"] .qs-fab-x { display: block; }

.qs-panel {
  position: fixed;
  right: calc(var(--qs-gap) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--qs-gap) + 68px + env(safe-area-inset-bottom, 0px));
  z-index: 951;
  width: min(380px, calc(100vw - 2 * var(--qs-gap)));
  height: min(540px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--qs-bg);
  border: 1px solid var(--qs-line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(5, 8, 20, 0.55);
  overflow: hidden;
}
.qs-panel[hidden] { display: none; }

.qs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: var(--qs-bg-2); }
.qs-title { margin: 0; font: 700 1.1rem/1.2 Fraunces, Georgia, serif; color: var(--qs-gold); letter-spacing: 0; }
.qs-close { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: var(--qs-ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.qs-close:hover, .qs-close:focus-visible { border-color: var(--qs-gold); color: var(--qs-gold); }

.qs-chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.qs-msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 0.92rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.qs-msg.is-bot { align-self: flex-start; background: var(--qs-bg-2); border-radius: 4px 14px 14px 14px; }
.qs-msg.is-user { align-self: flex-end; background: rgba(255, 153, 51, 0.18); border-radius: 14px 4px 14px 14px; }
.qs-msg.is-error { border: 1px solid rgba(255, 128, 128, 0.5); }
.qs-msg.is-ref { border: 1px solid var(--qs-line); }
.qs-msg.is-ref b { color: var(--qs-gold); font-size: 1.05rem; letter-spacing: 0.02em; }
.qs-choices { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; }
.qs-choice { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--qs-line); background: transparent; color: var(--qs-ink); font: inherit; font-size: 0.88rem; cursor: pointer; }
.qs-choice:hover, .qs-choice:focus-visible { border-color: var(--qs-saffron); color: #fff; background: rgba(255, 153, 51, 0.12); }

.qs-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.qs-input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.18); background: #0e1029; color: var(--qs-ink); font: inherit; font-size: 16px; }
.qs-input:focus { outline: none; border-color: var(--qs-gold); }
.qs-input:disabled { opacity: 0.55; }
.qs-send { padding: 0 16px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--qs-saffron), var(--qs-gold)); color: #1a1300; font: inherit; font-weight: 700; cursor: pointer; }
.qs-send:disabled { opacity: 0.5; cursor: default; }
.qs-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.qs-spacer { display: none; }

@media (max-width: 600px) {
  .qs-root { --qs-gap: 14px; }
  .qs-fab { width: 52px; height: 52px; }
  /* Bottom sheet: full width, 85% of the screen tall, flush with the bottom edge. */
  .qs-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 85vh; height: 85dvh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .qs-root.is-open .qs-fab { display: none; }
  /* Room at the end of the page so the button never sits on top of the last button or link
     (e.g. the Register wizard's Next). */
  .qs-spacer { display: block; height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .qs-fab { transition: none; }
  .qs-fab:hover { transform: none; }
}
