/* Webyhost SUPPORT CHAT bubble + panel (public/support.js, docs/support-chat.md).
   Loaded by our own pages only — the dashboard and the landing page — so it
   inherits each page's font (Poppins in the dashboard, Inter on the landing) and
   carries its own colours, scoped to .whs-root so it can touch nothing else.
   LIGHT ONLY. The house rules, same as both pages: ink type on white, ORANGE is
   what you press, no gradient. Purple marks the AI site assistant elsewhere in
   the product, so it is deliberately not used here: this is a conversation with
   Webyhost, not with a customer's assistant. */
.whs-root {
  --whs-ink: #111111;
  --whs-muted: #626260;
  --whs-border: #e6e2dc;
  --whs-ground: #faf9f7;
  --whs-action: #ff6100;
  --whs-action-deep: #d94e00;
  --whs-danger: #c41c1c;
  --whs-ok: #0b7a3f;
  --whs-whatsapp: #0b7a3f;
  font-size: 14px;
  line-height: 1.5;
  color: var(--whs-ink);
}
.whs-root *, .whs-root *::before, .whs-root *::after { box-sizing: border-box; }

.whs-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: var(--whs-ink); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.22);
  transition: transform .15s ease, background .15s ease;
}
.whs-bubble:hover { transform: translateY(-1px); background: #2a2a2a; }
.whs-bubble:focus-visible { outline: 3px solid var(--whs-action); outline-offset: 3px; }
.whs-unread {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--whs-action); color: #fff; border: 2px solid #fff;
  font-size: 12px; font-weight: 700; line-height: 16px; text-align: center;
}

.whs-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  width: 380px; height: min(600px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--whs-border); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.20); overflow: hidden;
  margin: 0; padding: 0; text-align: left;
}
.whs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--whs-border); background: #fff;
}
.whs-title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.whs-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--whs-muted); }
.whs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--whs-ink); flex: none; }
.whs-dot.waiting { background: #e8a33a; }
.whs-dot.agent { background: var(--whs-ok); }
.whs-dot.closed { background: #b9b6b0; }
.whs-head-actions { display: flex; align-items: center; gap: 4px; }
.whs-link, .whs-close {
  border: 0; background: none; color: var(--whs-muted); cursor: pointer; font: inherit; border-radius: 8px;
}
.whs-link { font-size: 13px; padding: 6px 8px; }
.whs-close { width: 32px; height: 32px; font-size: 22px; line-height: 1; }
.whs-link:hover, .whs-close:hover { background: var(--whs-ground); color: var(--whs-ink); }
.whs-link:focus-visible, .whs-close:focus-visible, .whs-quick button:focus-visible, .whs-human:focus-visible {
  outline: 2px solid var(--whs-action); outline-offset: 1px;
}

.whs-body {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: var(--whs-ground);
}
.whs-welcome p { margin: 0 0 12px; font-size: 14px; }
.whs-quick { display: flex; flex-direction: column; gap: 8px; }
.whs-quick button {
  text-align: left; padding: 10px 12px; border: 1px solid var(--whs-border); border-radius: 10px;
  background: #fff; color: var(--whs-ink); font: inherit; font-size: 13.5px; cursor: pointer;
}
.whs-quick button:hover { border-color: var(--whs-ink); }
.whs-quick .whs-quick-human { font-weight: 600; }

.whs-msg {
  max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 14px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.whs-msg a { color: inherit; text-decoration: underline; }
.whs-msg--user { align-self: flex-end; background: var(--whs-ink); color: #fff; border-bottom-right-radius: 4px; }
.whs-msg--user.is-pending { opacity: .6; }
.whs-msg--bot, .whs-msg--agent {
  align-self: flex-start; background: #fff; border: 1px solid var(--whs-border); border-bottom-left-radius: 4px;
}
.whs-msg--agent { border-color: var(--whs-ink); }
.whs-typing { color: var(--whs-muted); letter-spacing: 2px; }
.whs-author { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.whs-system { align-self: center; max-width: 90%; text-align: center; font-size: 12.5px; color: var(--whs-muted); }

.whs-error { margin: 8px 12px 0; font-size: 13px; color: var(--whs-danger); }
.whs-human {
  margin: 8px 12px 0; padding: 7px 12px; border: 1px solid var(--whs-border); border-radius: 10px;
  background: #fff; color: var(--whs-muted); font: inherit; font-size: 13px; cursor: pointer;
}
.whs-human.is-strong { border-color: var(--whs-ink); color: var(--whs-ink); font-weight: 600; }
.whs-human:hover { border-color: var(--whs-ink); color: var(--whs-ink); }

.whs-foot {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px; margin: 8px 0 0;
  border-top: 1px solid var(--whs-border); background: #fff;
}
.whs-foot textarea {
  flex: 1; width: auto; min-height: 40px; max-height: 120px; resize: none; padding: 9px 12px;
  border: 1px solid var(--whs-border); border-radius: 10px; font: inherit; font-size: 14px;
  color: var(--whs-ink); background: #fff; outline: none;
}
.whs-foot textarea:focus { border-color: var(--whs-ink); }
.whs-foot > .whs-btn:only-child { width: 100%; }

.whs-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.whs-btn--primary { background: var(--whs-action); color: #fff; }
.whs-btn--primary:hover { background: var(--whs-action-deep); }
.whs-btn--secondary { background: #fff; color: var(--whs-ink); border-color: var(--whs-border); }
.whs-btn--secondary:hover { border-color: var(--whs-ink); }
.whs-btn:disabled { opacity: .5; cursor: default; }
.whs-btn:focus-visible { outline: 3px solid var(--whs-ink); outline-offset: 2px; }

/* Signed out (the landing page): a short sign-in prompt instead of the chat. */
.whs-panel.whs-gate { height: auto; }
.whs-gate-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 16px; background: var(--whs-ground); }
.whs-gate-body p { margin: 0 0 4px; font-size: 14px; }
.whs-gate-body .whs-gate-note { margin: 6px 0 0; font-size: 12.5px; color: var(--whs-muted); }
.whs-gate-note a { color: var(--whs-ink); }

.whs-founder {
  display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600;
  color: var(--whs-whatsapp); text-decoration: none;
}
.whs-founder:hover { text-decoration: underline; }
.whs-gate-body .whs-founder { margin-top: 2px; }

/* Phones: the chat takes the screen; the sign-in prompt is a bottom sheet. */
@media (max-width: 640px) {
  .whs-bubble { right: 16px; bottom: 16px; }
  .whs-panel {
    inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh;
    border-radius: 0; border: 0;
  }
  .whs-panel.whs-gate {
    inset: auto 0 0 0; height: auto; border-radius: 16px 16px 0 0; border-top: 1px solid var(--whs-border);
  }
  .whs-foot textarea { font-size: 16px; } /* no iOS zoom on focus */
}
@media (prefers-reduced-motion: reduce) {
  .whs-bubble { transition: none; }
}
@media print { .whs-root { display: none; } }
