/* Help chat widget: self-contained, works on both the marketing site and the app pages */
.hc { --hc-ink: #1F1D1A; --hc-soft: #6B655E; --hc-line: #E4DED4; --hc-bg: #FFFFFF; --hc-tint: #F4F0E8; --hc-accent: #9E4A2C;
  position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 60; font-family: inherit; color: var(--hc-ink); }
.hc__fab { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
  background: var(--hc-ink); color: #fff; font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 24px rgba(31, 29, 26, .22); transition: transform .15s ease, box-shadow .15s ease; }
.hc__fab:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(31, 29, 26, .28); }

/* the closed state: a friendly round bot */
.hc .hc__fab { width: 64px; height: 64px; padding: 0; justify-content: center; border-radius: 50%; background: var(--hc-accent); color: #fff;
  animation: hc-hop 3.2s ease-in-out 2s 2; }
.hc__bot { width: 46px; height: 46px; overflow: visible; }
.hc__bot-tip { fill: #FFD9A8; }
.hc__eyes { transform-origin: 32px 31px; animation: hc-blink 4.5s infinite; }
.hc__fab:hover .hc__bot { transform: rotate(-8deg); transition: transform .2s ease; }
@keyframes hc-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes hc-hop { 0%, 20%, 100% { transform: translateY(0); } 8% { transform: translateY(-8px); } 14% { transform: translateY(-2px); } }

.hc__bubble { position: absolute; bottom: 74px; inset-inline-end: 4px; display: flex; align-items: center; gap: 2px;
  background: #fff; color: var(--hc-ink); border: 1px solid var(--hc-line); border-radius: 16px; border-end-end-radius: 4px;
  box-shadow: 0 8px 26px rgba(31, 29, 26, .16); white-space: nowrap; animation: hc-pop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.hc__bubble[hidden] { display: none; }
.hc__bubble-open { border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: inherit; padding: 10px 4px 10px 14px; cursor: pointer; }
[dir="rtl"] .hc__bubble-open { padding: 10px 14px 10px 4px; }
.hc__bubble-x { border: 0; background: none; color: var(--hc-soft); font-size: 18px; line-height: 1; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; margin-inline-end: 4px; }
.hc__bubble-x:hover { background: var(--hc-tint); }
@keyframes hc-pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.hc.is-open .hc__bubble { display: none; }
@media (prefers-reduced-motion: reduce) { .hc .hc__fab, .hc__eyes, .hc__bubble { animation: none; } }
.hc__fab:focus-visible, .hc button:focus-visible, .hc textarea:focus-visible, .hc a:focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }
.hc.is-open .hc__fab { display: none; }

.hc__panel { position: absolute; inset-inline-end: 0; bottom: 0; width: min(380px, calc(100vw - 36px)); height: min(560px, calc(100vh - 36px));
  display: flex; flex-direction: column; background: var(--hc-bg); border: 1px solid var(--hc-line); border-radius: 18px;
  box-shadow: 0 18px 60px rgba(31, 29, 26, .25); overflow: hidden; }
.hc__panel[hidden] { display: none; }
.hc__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--hc-ink); color: #fff; }
.hc__head div { display: grid; gap: 2px; }
.hc__head strong { font-size: 16px; font-weight: 600; }
.hc__head small { font-size: 12px; opacity: .75; }
.hc__x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

.hc__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--hc-tint); }
.hc__msg { margin: 0; max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.hc__msg--assistant { align-self: flex-start; background: var(--hc-bg); border: 1px solid var(--hc-line); border-start-start-radius: 4px; }
.hc__msg--user { align-self: flex-end; background: var(--hc-ink); color: #fff; border-start-end-radius: 4px; }
.hc__msg a { color: var(--hc-accent); text-decoration: underline; text-underline-offset: 2px; }
.hc__msg--user a { color: #fff; }
.hc__msg.is-wait { color: var(--hc-soft); animation: hc-pulse 1.2s ease-in-out infinite; }
.hc__msg.is-err { border-color: #E2B4A4; background: #FBF1EC; }
@keyframes hc-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .hc__msg.is-wait { animation: none; } .hc__fab { transition: none; } }

.hc__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; background: var(--hc-tint); }
.hc__chips[hidden] { display: none; }
.hc__chips button { border: 1px solid var(--hc-line); background: var(--hc-bg); color: var(--hc-ink); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.hc__chips button:hover { border-color: var(--hc-ink); }

.hc__form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--hc-line); background: var(--hc-bg); }
.hc__form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--hc-line); border-radius: 12px;
  font: inherit; font-size: 16px; line-height: 1.35; color: var(--hc-ink); background: var(--hc-bg); }
.hc__form button { height: 42px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--hc-accent); color: #fff; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.hc__form button:disabled { opacity: .5; cursor: default; }
.hc__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 14px 12px; background: var(--hc-bg); font-size: 13px; }
.hc__wa { color: #1F7A4A; font-weight: 600; text-decoration: none; }
.hc__wa:hover { text-decoration: underline; }
.hc__reset { border: 0; background: none; color: var(--hc-soft); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 0; }

/* phones: the open chat takes the whole screen */
@media (max-width: 560px) {
  .hc { inset-inline-end: 12px; bottom: 12px; }
  .hc .hc__fab { width: 58px; height: 58px; }
  .hc__bubble { bottom: 68px; }
  .hc.is-open { inset: 0; }
  .hc__panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  html.hc-open { overflow: hidden; }
}
/* never sit on top of the full-screen drawing tool */
html.sketch-open .hc { display: none; }
@media print { .hc { display: none; } }
