/* The help chat (site/help.js): the site's own look. Ink, rose and soft rose on warm paper, the envelope mark, Hanken
   Grotesk, 10px corners. Its own tokens, so it looks the same in the editor, which has its own style sheet. */
.hp { --ink: #18181B; --ink-2: #63635E; --rose: #A8324F; --rose-soft: #F7E9EC; --paper: #FBFAF8; --paper-2: #F4F1EC; --line: #E6E2DB; --sand: #F4EFE6; --sage: #EBF2EC; --ok: #3FA56B;
  --hp-font: 'Hanken Grotesk', ui-sans-serif, sans-serif; font: 400 15px/1.5 var(--hp-font); color: var(--ink); }
.hp *, .hp *::before, .hp *::after { box-sizing: border-box; }
.hp-mark { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='10' y='22' width='44' height='30' rx='4' fill='%23fff' stroke='%2318181B' stroke-width='3'/%3E%3Cpath d='M10 26l22 15 22-15' fill='none' stroke='%2318181B' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M12 22L32 8l20 14' fill='%23F7E9EC' stroke='%23A8324F' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M32 30c-3-4-9-2-8 2 1 3 8 7 8 7s7-4 8-7c1-4-5-6-8-2z' fill='%23A8324F'/%3E%3C/svg%3E") center / 72% no-repeat; border-radius: 10px; flex: none; }

/* the button */
.hp-btn { position: fixed; z-index: 990; right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--hp-lift, 0px)); display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 18px 0 7px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; font: 600 15px/1 var(--hp-font); cursor: pointer;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55), 0 0 0 5px rgba(24, 24, 27, .14), 0 18px 40px -14px rgba(0, 0, 0, .55); transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); }
.hp-btn:hover { transform: translateY(-2px); }
.hp-btn:focus-visible, .hp button:focus-visible, .hp textarea:focus-visible, .hp input:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.hp-btn .hp-mark { position: relative; width: 36px; height: 36px; }
.hp-btn .hp-dot { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2.5px var(--ink); }
.hp-btn.away .hp-dot { background: #f2a7b8; }
.hp-btn.new::after { content: ''; position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 3px #fff; }
.hp-btn.nudge .hp-mark { animation: hp-nudge 3.2s ease-in-out 1.2s 2; }
/* while the chat has not been opened: a small hop every few seconds, resting in between */
.hp-btn.idle { animation: hp-hop 4s cubic-bezier(.3, 0, .3, 1) 2s infinite; }
.hp-btn.idle .hp-mark { animation: hp-wiggle 4s ease-in-out 2s infinite; }
@keyframes hp-hop { 0%, 70%, 100% { transform: translateY(0); } 76% { transform: translateY(-16px); } 82% { transform: translateY(0); } 87% { transform: translateY(-6px); } 92% { transform: translateY(0); } }
@keyframes hp-wiggle { 0%, 72%, 100% { transform: none; } 76% { transform: rotate(-12deg) scale(1.08); } 80% { transform: rotate(10deg) scale(1.08); } 84% { transform: rotate(-6deg); } 88% { transform: none; } }
/* just before it opens by itself: a quick shake */
.hp-btn.shake { animation: hp-shake .6s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes hp-shake { 10%, 90% { transform: translateX(-1px) rotate(-1deg); } 20%, 80% { transform: translateX(3px) rotate(2deg); } 30%, 50%, 70% { transform: translateX(-5px) rotate(-3deg); } 40%, 60% { transform: translateX(5px) rotate(3deg); } }
@keyframes hp-nudge { 0%, 100% { transform: none; } 20% { transform: rotate(-8deg) scale(1.06); } 40% { transform: rotate(6deg); } 60% { transform: none; } }
.hp.open .hp-btn, .hp.open .hp-greet { display: none; }
@media (max-width: 600px) { .hp-btn { height: 46px; padding-right: 15px; font-size: 14px; } .hp-btn .hp-mark { width: 32px; height: 32px; } }

/* the greeting, once a visit, beside the button */
.hp-greet { position: fixed; z-index: 990; right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--hp-lift, 0px) + 64px); max-width: min(290px, calc(100vw - 32px)); padding: 14px 44px 14px 16px; border: 0; border-radius: 14px 14px 4px 14px; background: #fff; color: var(--ink); text-align: left; font: 400 15px/1.45 var(--hp-font); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px -20px rgba(0, 0, 0, .35); transform-origin: 100% 100%; animation: hp-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.hp-greet b { display: block; margin-bottom: 3px; font: 600 13px/1.3 var(--hp-font); letter-spacing: .02em; color: var(--rose); }
.hp-greet-x { position: fixed; z-index: 991; width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--paper-2); color: var(--ink-2); font: 400 17px/1 var(--hp-font); cursor: pointer; }
@keyframes hp-pop { from { opacity: 0; transform: translateY(10px) scale(.85); } to { opacity: 1; transform: none; } }

/* the panel */
.hp-panel { position: fixed; z-index: 1000; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 380px; height: min(620px, calc(100dvh - 32px)); display: none; flex-direction: column; overflow: hidden; border-radius: 16px; background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 40px 90px -30px rgba(0, 0, 0, .45); transform-origin: 100% 100%; }
.hp.open .hp-panel { display: flex; animation: hp-unfold .45s cubic-bezier(.2, 1, .3, 1); }
@keyframes hp-unfold { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .hp-panel { inset: auto 0 0 0; width: 100%; height: min(88dvh, 100dvh - 48px); border-radius: 18px 18px 0 0; transform-origin: 50% 100%; } }
.hp-head { position: relative; flex: none; display: flex; gap: 14px; align-items: center; padding: 16px 56px 18px 16px; background: var(--ink); color: #fff; }
.hp-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #f2a7b8, #ffe2b8, #f2a7b8); }
.hp-head .hp-mark { width: 42px; height: 42px; }
.hp-head h2 { margin: 0; font: 600 17px/1.25 var(--hp-font); letter-spacing: -.01em; }
.hp-head h2 span { display: inline-block; margin: 0 8px 0 0; padding: 3px 9px; vertical-align: 2px; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.hp-head p { margin: 4px 0 0; color: #d9d9de; font-size: 13px; }
.hp-head p i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ok); }
.hp-head p.away i { background: #f2a7b8; }
.hp-x { position: absolute; top: 14px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font: 400 20px/1 var(--hp-font); cursor: pointer; }

.hp-feed { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.hp-intro { margin: 0 0 4px; color: var(--ink-2); font-size: 14px; }
.hp-m { max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hp-m.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.hp-m.bot { align-self: flex-start; background: var(--rose-soft); border: 1px solid #EED3DA; border-bottom-left-radius: 4px; }
.hp-m.us { align-self: flex-start; background: #fff; border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--rose); border-bottom-left-radius: 4px; }
.hp-who { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font: 600 12px/1.3 var(--hp-font); color: var(--ink); }
.hp-m.us .hp-who { color: var(--rose); }
.hp-who em { font-style: normal; padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid #EED3DA; color: var(--rose); font-weight: 600; }
.hp-sys { align-self: center; margin: 4px 0; color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: center; }
.hp-typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px; border-radius: 14px; background: var(--rose-soft); }
.hp-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: hp-dot 1s ease-in-out infinite; }
.hp-typing i:nth-child(2) { animation-delay: .15s; } .hp-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hp-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.hp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.hp-chips button, .hp-helped button { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 500 14px/1.25 var(--hp-font); text-align: left; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.hp-chips button:hover, .hp-helped button:hover { background: var(--rose-soft); border-color: var(--rose); color: var(--rose); }
.hp-helped { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.hp-helped button.person { background: var(--ink); border-color: var(--ink); color: #fff; }
.hp-helped button.person:hover { background: #2a2a30; color: #fff; }

.hp-ask { align-self: stretch; padding: 12px; border-radius: 12px; background: var(--sand); }
.hp-ask b { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.hp-ask form { display: flex; gap: 8px; }
.hp-ask input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 400 16px/1 var(--hp-font); }
.hp-ask input[aria-invalid="true"] { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }
.hp-ask button[type="submit"] { height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font: 600 15px/1 var(--hp-font); cursor: pointer; }
.hp-ask button:disabled { opacity: .45; cursor: not-allowed; }
.hp-ask .hp-err { margin: 8px 0 0; font-size: 13px; color: var(--rose); }
.hp-ask .hp-fix { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.hp-ask .hp-fix button { min-height: 32px; padding: 0; border: 0; background: none; color: var(--rose); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hp-ask.done { background: var(--sage); color: #1F6F45; font-size: 14px; }

.hp-compose { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.hp-compose textarea { flex: 1; min-width: 0; max-height: 120px; min-height: 44px; padding: 11px 12px; resize: none; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 400 16px/1.35 var(--hp-font); }
.hp-compose button { height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font: 600 15px/1 var(--hp-font); cursor: pointer; }
.hp-compose button:disabled { opacity: .45; cursor: not-allowed; }
.hp-note { flex: none; margin: 0; padding: 0 14px 10px; background: #fff; color: var(--ink-2); font-size: 12px; }

@media (prefers-reduced-motion: reduce) { .hp-greet, .hp.open .hp-panel, .hp-btn, .hp-btn .hp-mark, .hp-typing i { animation: none !important; } .hp-btn { transition: none; } }

/* in a header (the editor's): a small Help button beside Sign in, never over the card */
.hp-btn.hp-inline { position: static; height: 40px; padding: 0 14px 0 4px; gap: 8px; border-radius: 999px; font-size: 14px; box-shadow: none; transform: none; }
.hp-btn.hp-inline .hp-mark { width: 32px; height: 32px; border-radius: 999px; }
.hp-btn.hp-inline .hp-dot { box-shadow: 0 0 0 2px var(--ink); width: 9px; height: 9px; }
.hp-btn.hp-inline:hover { transform: none; background: #2a2a30; }
.hp-btn.hp-inline { --ink: #18181B; --ok: #3FA56B; --hp-font: 'Hanken Grotesk', ui-sans-serif, sans-serif; margin-right: 8px; }
.hp-btn.hp-inline .hp-mark { background-color: #fff; }
.hp-m .hp-link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.hp-m.me .hp-link { color: #fff; }
/* on a computer: room from the corner (on a phone, the corner is where the thumb is) */
@media (min-width: 900px) {
  .hp-btn:not(.hp-inline), .hp-greet { right: max(32px, env(safe-area-inset-right)); }
  .hp-btn:not(.hp-inline) { bottom: calc(max(32px, env(safe-area-inset-bottom)) + var(--hp-lift, 0px)); }
  .hp-greet { bottom: calc(max(32px, env(safe-area-inset-bottom)) + var(--hp-lift, 0px) + 66px); }
  .hp-panel { right: 32px; bottom: 32px; height: min(620px, calc(100dvh - 64px)); }
}
@media (min-width: 1400px) {
  .hp-btn:not(.hp-inline), .hp-greet, .hp-panel { right: 44px; }
  .hp-btn:not(.hp-inline), .hp-panel { bottom: 40px; }
  .hp-greet { bottom: 106px; }
}
/* the chat's messages are its own: no page style with the same short name (the account page's .me) reaches them */
.hp .hp-m { display: block; margin: 0; padding: 10px 13px; gap: 0; max-width: 86%; }
.hp .hp-m.me { align-self: flex-end; }

/* on a phone: a small "Ask us" pill in the corner, a speech bubble; away while the home page's wall fills the screen,
   moving clear of any small button under it (help.js phoneCorner) */
.hp-btn .hp-talk { display: none; }
@media (max-width: 600px) {
  .hp.hp-phone .hp-btn { height: 44px; gap: 7px; padding: 0 16px 0 12px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 22px rgba(24, 24, 27, .22); transition: opacity .3s, transform .35s var(--hp-ease, ease); }
  .hp.hp-phone .hp-btn .hp-mark { position: absolute; top: 0; right: 0; width: 0; height: 0; background: none; animation: none; }
  .hp.hp-phone .hp-btn .hp-dot { top: -2px; right: -2px; width: 10px; height: 10px; }
  .hp.hp-phone .hp-btn .hp-talk { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
  .hp.hp-phone .hp-btn .hp-talk circle { fill: currentColor; stroke: none; }
  .hp.hp-phone.hp-wall:not(.open) .hp-btn, .hp.hp-phone.hp-cover:not(.open) .hp-btn { opacity: 0; transform: translateY(18px) scale(.92); pointer-events: none; }
  .hp.hp-phone .hp-greet, .hp.hp-phone .hp-greet-x { display: none; }
  .hp.hp-phone.hp-on-dark .hp-btn { background: #fff; color: #18181B; box-shadow: 0 8px 22px rgba(0, 0, 0, .35); }
  .hp.hp-phone.hp-on-dark .hp-btn .hp-dot { box-shadow: 0 0 0 2px #fff; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) { .hp.hp-phone .hp-btn { transition: none; } }

/* the design picker on a phone: in the header beside Menu, a round speech bubble in Menu's colours (help.js headerSpot) */
@media (max-width: 600px) {
  .hp-btn.hp-top { position: relative; inset: auto; z-index: auto; flex: none; width: 42px; height: 42px; margin: 0 -10px 0 auto; padding: 0; justify-content: center; border: 1px solid var(--ink); border-radius: 999px; box-shadow: none; transform: none; opacity: 1; pointer-events: auto; box-sizing: border-box; --ink: #18181B; --ok: #3FA56B; }
  .hp-btn.hp-top .hp-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hp-btn.hp-top .hp-mark { position: absolute; top: 0; right: 0; width: 0; height: 0; background: none; animation: none; }
  .hp-btn.hp-top .hp-dot { top: -2px; right: -2px; width: 10px; height: 10px; box-shadow: 0 0 0 2px #fff; }
  .hp-btn.hp-top .hp-talk { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
  .hp-btn.hp-top .hp-talk circle { fill: currentColor; stroke: none; }
}

/* the panel on a phone: a card floating clear of the edges, as tall as the conversation needs (up to about two thirds of
   the screen, the page's top always showing above it), a slim header, the conversation scrolling inside it */
@media (max-width: 600px) {
  .hp-panel { inset: auto max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); width: auto; height: auto; min-height: 0; max-height: min(600px, 100dvh - 110px); border-radius: 20px; transform-origin: 85% 100%; box-shadow: 0 0 0 1px var(--line), 0 24px 60px -12px rgba(0, 0, 0, .45); }
  .hp-head { gap: 10px; padding: 12px 52px 13px 12px; }
  .hp-head .hp-mark { width: 34px; height: 34px; flex: none; }
  .hp-head h2 { font-size: 15.5px; line-height: 1.25; }
  .hp-head h2 span { padding: 2px 7px; margin-right: 6px; font-size: 12px; }
  .hp-head p { margin-top: 3px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hp-x { top: 10px; right: 10px; width: 34px; height: 34px; }
  .hp-feed { flex: 1 1 auto; min-height: 0; padding: 14px 12px 6px; gap: 8px; -webkit-overflow-scrolling: touch; }
  .hp-intro { font-size: 13.5px; }
  .hp-compose { padding-left: 10px; padding-right: 10px; }
  .hp-note { padding-left: 12px; padding-right: 12px; font-size: 12px; }
}

/* who wrote each message: the assistant (a small robot, automatic), a real person from the team, or the visitor */
.hp-who .hp-ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hp-m.me .hp-who { justify-content: flex-end; color: rgba(255, 255, 255, .7); font-weight: 600; }
.hp-m.us .hp-who em { background: var(--rose-soft); border-color: #EED3DA; }
