#homeChat {
  display: none;
}
/*
 * The stand-in is the desk's closed chat sheet tab, drawn the way bubble.js draws it for operator vaki
 * (.bubble.sheet.has-logo, colours from the vaki operator file's chatSheet, the same in light and dark mode),
 * so swapping it for the real one on the first tap shows no change. The logo is the site icon (favicon.svg) drawn inline.
 */
.js #homeChat {
  --hc-paper: #fffdf6;
  --hc-ink: #0a2a33;
  --hc-accent: #0e7c86;
  --hc-grip: #f28f32;
  --hc-logo-ground: #081f2c;
  --hc-logo-mark: #f4fbf6;
  --hc-logo-dot: #f08c2e;
  position: fixed;
  right: 10px;
  bottom: 0;
  z-index: 900;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  height: auto;
  min-height: 46px;
  max-width: calc(100vw - 20px);
  margin: 0;
  padding: 11px 11px calc(5px + env(safe-area-inset-bottom, 0px)) 8px;
  border: 0;
  border-radius: 16px 16px 0 0;
  background: var(--hc-paper);
  color: var(--hc-ink);
  box-shadow: 0 -4px 16px rgba(4,24,30,.28);
  font: 700 15px/1.2 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
.js body:has(#homeChat) { padding-bottom: 54px } /* the room bubble.js keeps under its tab (sheetRoom: tab height + 8) */
.js #homeChat.hc-late { display: none }
#homeChat .hc-logo { display: block; width: 26px; height: 26px; flex: none; border-radius: 50% }
#homeChat .hc-label { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
#homeChat .hc-grip { display: block; position: absolute; top: 4px; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 2px; background: var(--hc-grip) }
#homeChat .hc-chev { display: block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; color: var(--hc-accent) }
#homeChat:focus-visible { outline: 3px solid var(--hc-accent); outline-offset: 3px }
.wf .wf-say { box-sizing: content-box; padding: 0 }
.wf .wf-say:not(:empty)::before { content: ""; display: block; height: 10px }
.wf-node[aria-expanded="true"] .wf-say { opacity: 1 }
.wf-line:nth-of-type(2) { --line-delay: 300ms }
.wf-line:nth-of-type(3) { --line-delay: 600ms }

@property --home-wf-light {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .home-drawing path[style*="--draw-duration"] { stroke-dasharray: 1 1; stroke-dashoffset: 1 }
  .home-draw-in path[style*="--draw-duration"] {
    animation: home-draw var(--draw-duration) cubic-bezier(.37,0,.63,1) var(--draw-delay) forwards;
  }
  .wf.in .wf-line {
    stroke-dasharray: 1 1;
    animation: home-draw 1100ms cubic-bezier(.22,1,.36,1) var(--line-delay, 0ms) both;
  }
  .wf .wf-say { transition: height 180ms ease-out, opacity 180ms ease-out }
  .wf-node[aria-expanded="true"] .wf-say { transition-duration: 260ms }
  .wf .wf-sys {
    transition: transform .18s ease, box-shadow .64s ease-in-out, border-radius .64s ease-in-out, min-height .64s ease-in-out;
  }
  .wf-sys .wf-ic { transition: border-radius .64s ease-in-out, background-color .64s ease-in-out, color .64s ease-in-out }
  .home-system-out { animation: home-system-out 170ms ease-in both }
  .home-system-in { animation: home-system-in 320ms ease-out both }
  .wf .home-packet {
    offset-anchor: 0 0;
    offset-rotate: 0deg;
    animation: home-packet 1500ms cubic-bezier(.37,0,.63,1) both;
  }
  .wf .home-trail { animation: home-trail 1500ms cubic-bezier(.37,0,.63,1) both }
  .wf .home-lit { --lit: var(--home-wf-light); animation: home-light 1800ms ease-in-out both }
  .wf .home-ring { animation: home-ring 1000ms ease-out both }
}

@keyframes home-draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
@keyframes home-system-out { to { opacity: 0; transform: translateY(-10px) } }
@keyframes home-system-in { from { opacity: 0; transform: translateY(10px) } }
@keyframes home-packet {
  0% { offset-distance: 0%; opacity: 0 }
  10%, 86% { opacity: 1 }
  100% { offset-distance: 100%; opacity: 0 }
}
@keyframes home-trail {
  0% { stroke-dasharray: 0 2; stroke-dashoffset: 0; opacity: 0 }
  10%, 86% { opacity: 1 }
  30% { stroke-dasharray: .3 2; stroke-dashoffset: 0 }
  100% { stroke-dasharray: .3 2; stroke-dashoffset: -.7; opacity: 0 }
}
@keyframes home-light { 0%, 100% { --home-wf-light: 0 } 18%, 39% { --home-wf-light: 1 } }
@keyframes home-ring {
  0% { opacity: 0; transform: scale(.97) }
  6% { opacity: .9 }
  100% { opacity: 0; transform: scale(1.08) }
}

#homeChatStatus:not(:empty) {
  position: fixed;
  right: 10px;
  bottom: 58px;
  z-index: 900;
  max-width: min(320px, calc(100vw - 32px));
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 25%, transparent);
}
