/* Liya, the public site's support chat (liya-chat.js): a launcher pinned
   bottom-right, a teaser card before first open, and a small panel (every
   page, the docs too) — and on the docs a separate right-hand drawer, opened
   from the docs header's Ask Liya button. The Factory palette — ink, off-white,
   one orange signal — painted here, so it looks the same on every public
   page; a dark theme (data-theme="dark": the docs and legal pages) gets dark
   tokens. Everything is scoped under .lc-. */
.lc-root {
  --lc-ground: #f3f3f0; --lc-paper: #fbfbf9; --lc-ink: #111111; --lc-ink-2: #3b3b38;
  --lc-mute: #66665f; --lc-line: #d6d6cf; --lc-line-2: #c4c4bb; --lc-signal: #ff5b1f;
  --lc-signal-text: #c2410c; --lc-bubble: #ebebe6;
  --lc-sans: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --lc-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font: 14px/1.5 var(--lc-sans); color: var(--lc-ink);
}
:root[data-theme="dark"] .lc-root {
  --lc-ground: #0e0e0d; --lc-paper: #161614; --lc-ink: #f1f1ec; --lc-ink-2: #c9c9c1;
  --lc-mute: #9a9a92; --lc-line: #2a2a27; --lc-line-2: #3a3a36; --lc-signal-text: #ff7a45;
  --lc-bubble: #22221f;
}
.lc-root *, .lc-root *::before, .lc-root *::after { box-sizing: border-box; }
.lc-vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the launcher ---- */
.lc-launch {
  /* --cc-lift: the consent sheet's height on a phone while it shows
     (consent.css), so the launcher sits above it, never under it. */
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px) + var(--cc-lift, 0px)); z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; border: 2px solid #111111; cursor: pointer;
  background: #111111; color: #fbfbf9; display: grid; place-items: center;
  box-shadow: 0 16px 34px -14px rgba(17,17,17,.6); transition: transform 160ms ease;
}
.lc-launch:hover { transform: translateY(-2px); }
.lc-launch:focus-visible { outline: 3px solid var(--lc-signal); outline-offset: 3px; }
.lc-launch svg { width: 28px; height: 28px; }
.lc-launch[aria-expanded="true"] .lc-spark { display: none; }
.lc-launch .lc-x { display: none; font: 400 26px/1 var(--lc-sans); }
.lc-launch[aria-expanded="true"] .lc-x { display: block; }
:root[data-theme="dark"] .lc-launch { border-color: #f1f1ec; }
/* On the agent finder the launcher sits above the answer box. */
body.af .lc-launch { bottom: calc(var(--af-dock-h, 0px) + 16px + var(--cc-lift, 0px)); }
@media (min-width: 900px) { body.af .lc-launch { bottom: 24px; } }

/* ---- the teaser (desktop, before first open) ---- */
.lc-teaser {
  position: fixed; right: 20px; bottom: 90px; z-index: 59; width: 300px; padding: 14px;
  border: 1px solid var(--lc-line-2); border-radius: 12px; background: var(--lc-paper);
  box-shadow: 0 26px 60px -30px rgba(17,17,17,.55); animation: lc-up 260ms ease both;
}
.lc-teaser[hidden] { display: none; }
.lc-teaser .lc-who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.lc-teaser p { margin: 0 0 10px; color: var(--lc-ink-2); }
.lc-teaser .lc-close { position: absolute; top: 8px; right: 8px; }
@media (max-width: 640px) { .lc-teaser { display: none !important; } }

/* ---- the spark wake (once a visit): the launcher's spark draws itself and
   breathes twice, and a small bubble types a question for the page ---- */
.lc-launch.lc-waking .lc-spark path { stroke-dasharray: 100; animation: lc-draw 1.1s cubic-bezier(.65,0,.35,1) both; }
.lc-launch.lc-waking .lc-spark { animation: lc-breathe 0.9s ease-in-out 1.1s 2; }
.lc-launch.lc-waking .lc-spark circle { transform-box: fill-box; transform-origin: center; animation: lc-core 0.9s ease-in-out 1.1s 2; }
@keyframes lc-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes lc-breathe { 50% { transform: scale(1.16); } }
@keyframes lc-core { 50% { transform: scale(1.6); } }
.lc-wake {
  position: fixed; right: 20px; bottom: 90px; z-index: 59; width: min(300px, calc(100vw - 40px)); padding: 12px 14px 14px;
  border: 1px solid var(--lc-line-2); border-radius: 12px; border-bottom-right-radius: 3px; background: var(--lc-paper);
  color: var(--lc-ink); box-shadow: 0 26px 60px -30px rgba(17,17,17,.55); animation: lc-up 240ms ease both;
}
.lc-wake.lc-still { animation: none; }
.lc-wake [hidden] { display: none !important; }
.lc-wake .lc-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; }
.lc-wake .lc-avatar { width: 26px; height: 26px; }
.lc-wake .lc-avatar svg { width: 16px; height: 16px; }
.lc-wake-line { margin: 0 24px 10px 0; color: var(--lc-ink-2); min-height: 3em; }
.lc-wake .lc-close { position: absolute; top: 6px; right: 6px; }
.lc-wake-acts { align-self: auto; justify-content: flex-start; }
.lc-wake-acts .lc-opt:first-child { background: #111111; color: #fbfbf9; border-color: #111111; }
:root[data-theme="dark"] .lc-wake-acts .lc-opt:first-child { background: #f1f1ec; color: #111111; border-color: #f1f1ec; }
.lc-wake a.lc-opt { text-decoration: none; }
.lc-wake .lc-opt:focus-visible, .lc-wake .lc-close:focus-visible { outline: 2px solid var(--lc-signal); outline-offset: 2px; }
@media (max-width: 640px) { .lc-wake { right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px) + var(--cc-lift, 0px)); } }

/* ---- the panel ---- */
.lc-panel {
  position: fixed; right: 20px; bottom: 88px; z-index: 61; width: min(380px, calc(100vw - 40px));
  height: min(600px, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--lc-ink); border-radius: 14px; background: var(--lc-paper);
  box-shadow: 0 40px 90px -40px rgba(17,17,17,.6); animation: lc-up 200ms ease both;
}
.lc-panel[hidden] { display: none; }
@keyframes lc-up { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: #111111; color: #fbfbf9; }
.lc-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--lc-signal); color: #111111; display: grid; place-items: center; }
.lc-avatar svg { width: 20px; height: 20px; }
.lc-head .lc-title { display: flex; flex-direction: column; line-height: 1.2; }
.lc-head b { font-size: 15px; letter-spacing: .02em; }
.lc-head small { font: 10.5px var(--lc-mono); letter-spacing: .1em; text-transform: uppercase; color: #c9c9c1; }
.lc-close {
  margin-left: auto; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: inherit; font: 400 22px/1 var(--lc-sans); cursor: pointer;
}
.lc-close:hover { border-color: currentColor; }
.lc-close:focus-visible { outline: 2px solid var(--lc-signal); outline-offset: 1px; }
.lc-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--lc-ground); }
.lc-time { align-self: center; font: 10.5px var(--lc-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lc-mute); }
.lc-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.lc-msg p { margin: 0; }
.lc-msg p + p, .lc-msg ol, .lc-msg ul { margin-top: 6px; }
.lc-msg ol, .lc-msg ul { padding-left: 18px; margin-bottom: 0; }
.lc-bot { align-self: flex-start; background: var(--lc-paper); border: 1px solid var(--lc-line); border-bottom-left-radius: 3px; }
.lc-me { align-self: flex-end; background: #111111; color: #fbfbf9; border-bottom-right-radius: 3px; }
:root[data-theme="dark"] .lc-me { background: #f1f1ec; color: #111111; }
.lc-msg a { color: var(--lc-signal-text); text-decoration: underline; text-underline-offset: 2px; }
.lc-badge { display: inline-block; margin-bottom: 8px; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--lc-line-2); font: 500 9.5px var(--lc-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lc-mute); }

/* ---- an answer: a card with a lead, points and its sources ---- */
.lc-answer { width: 100%; max-width: 100%; padding: 12px 14px 14px; border-radius: 12px; }
.lc-answer .lc-lead { font-size: 14.5px; line-height: 1.5; color: var(--lc-ink); }
.lc-answer p + p { margin-top: 8px; }
.lc-answer .lc-points { margin: 8px 0 0; padding-left: 0 !important; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lc-answer ol.lc-points { counter-reset: lc-step; }
.lc-answer .lc-points li { position: relative; padding-left: 16px; color: var(--lc-ink-2); line-height: 1.45; }
.lc-answer ul.lc-points li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--lc-signal); }
.lc-answer ol.lc-points li { padding-left: 22px; counter-increment: lc-step; }
.lc-answer ol.lc-points li::before { content: counter(lc-step); position: absolute; left: 0; top: 0; font: 600 11px/1.9 var(--lc-mono); color: var(--lc-signal-text); }
.lc-msg a.lc-cite {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 3px; padding: 0 4px;
  border-radius: 999px; border: 1px solid var(--lc-line-2); background: var(--lc-ground);
  font: 600 9.5px/1 var(--lc-mono); color: var(--lc-ink-2); text-decoration: none; vertical-align: 2px;
}
.lc-msg a.lc-cite:hover, .lc-msg a.lc-cite:focus-visible { border-color: var(--lc-signal); color: var(--lc-signal-text); }
.lc-sources-wrap { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--lc-line); }
.lc-sources-label { margin: 0 0 6px !important; font: 500 9.5px var(--lc-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lc-mute); }
.lc-sources { list-style: none; padding: 0 !important; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lc-msg .lc-sources a.lc-src {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--lc-line);
  border-radius: 8px; background: var(--lc-ground); text-decoration: none; color: var(--lc-ink);
}
.lc-msg .lc-sources a.lc-src:hover { border-color: var(--lc-ink); }
.lc-sources .n {
  flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--lc-ink); color: var(--lc-paper); font: 600 10.5px/1 var(--lc-mono);
}
.lc-src-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lc-src-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lc-src-head b { font-size: 13px; line-height: 1.3; }
.lc-src-head small { font: 500 9.5px var(--lc-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--lc-mute); }
.lc-src-sum {
  font-size: 12px; line-height: 1.4; color: var(--lc-mute);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-opts { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lc-opts.lc-compact { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
.lc-opt {
  padding: 8px 12px; border: 1px solid var(--lc-ink); border-radius: 999px; background: var(--lc-paper);
  color: var(--lc-ink); font: 13px/1.2 var(--lc-sans); cursor: pointer; text-align: right;
}
.lc-opt:hover { background: #111111; color: #fbfbf9; }
:root[data-theme="dark"] .lc-opt:hover { background: #f1f1ec; color: #111111; }
.lc-opt:focus-visible, .lc-copy:focus-visible, .lc-send:focus-visible { outline: 2px solid var(--lc-signal); outline-offset: 2px; }
.lc-mail { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lc-mail .sel { user-select: all; -webkit-user-select: all; font: 13px var(--lc-mono); padding: 5px 8px; border-radius: 4px; background: var(--lc-ground); border: 1px solid var(--lc-line); }
.lc-copy { padding: 5px 9px; border: 1px solid var(--lc-ink); border-radius: 4px; background: transparent; color: var(--lc-ink); font: 500 10.5px var(--lc-mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.lc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px; }
.lc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--lc-ink-2); animation: lc-dot 1s infinite ease-in-out; }
.lc-typing i:nth-child(2) { animation-delay: .15s; }
.lc-typing i:nth-child(3) { animation-delay: .3s; background: var(--lc-signal); }
@keyframes lc-dot { 50% { transform: translateY(-4px); opacity: .5; } }
.lc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--lc-line); background: var(--lc-paper); }
.lc-form input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--lc-line-2); border-radius: 10px;
  background: var(--lc-ground); color: var(--lc-ink); font: 15px var(--lc-sans);
}
.lc-form input:focus { outline: 2px solid var(--lc-signal); outline-offset: 0; border-color: var(--lc-ink); }
.lc-send { flex: none; width: 42px; border: 0; border-radius: 10px; background: #111111; color: #fbfbf9; cursor: pointer; display: grid; place-items: center; }
:root[data-theme="dark"] .lc-send { background: #f1f1ec; color: #111111; }
.lc-send svg { width: 18px; height: 18px; }
.lc-send[disabled] { opacity: .5; cursor: progress; }
.lc-foot { margin: 0; padding: 8px 12px 10px; font-size: 11.5px; line-height: 1.4; color: var(--lc-mute); background: var(--lc-paper); }
.lc-foot a { color: var(--lc-ink-2); text-decoration: underline; }

.lc-opts a.lc-opt { text-decoration: none; }
.lc-src:focus-visible, .lc-foot a:focus-visible { outline: 2px solid var(--lc-signal); outline-offset: 2px; }
.lc-slot { display: none; }

/* ---- the docs' Ask Liya: a drawer on the right, full height ---- */
.lc-suggest { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.lc-suggest .lc-opt { text-align: left; border-radius: 10px; border-color: var(--lc-line-2); }
.lc-suggest .lc-opt:hover { border-color: var(--lc-ink); }
.lc-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(17,17,17,.32); animation: lc-fade 200ms ease both; }
.lc-scrim[hidden] { display: none; }
.lc-panel.lc-drawer {
  top: 0; right: 0; bottom: 0; width: min(440px, 100vw); height: 100dvh;
  border: 0; border-left: 1px solid var(--lc-line-2); border-radius: 0;
  box-shadow: -30px 0 80px -40px rgba(17,17,17,.55); animation: lc-in 220ms ease both;
}
.lc-drawer-open .lc-launch { display: none; }
.lc-drawer .lc-msg { max-width: 100%; }
.lc-drawer .lc-foot { border-top: 1px solid var(--lc-line); }
@keyframes lc-in { from { translate: 24px 0; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes lc-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- phones: a full-screen sheet ---- */
@media (max-width: 640px) {
  .lc-panel, .lc-panel.lc-drawer { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .lc-open .lc-launch, .lc-drawer-open .lc-launch { display: none; }
  .lc-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .lc-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .lc-panel, .lc-teaser, .lc-scrim, .lc-wake { animation: none; }
  .lc-launch.lc-waking .lc-spark, .lc-launch.lc-waking .lc-spark path, .lc-launch.lc-waking .lc-spark circle { animation: none; }
  .lc-typing i { animation: none; }
  .lc-launch { transition: none; }
}

/* The launcher is fixed bottom-right, over whatever ends the page: the
   footers keep that corner clear (it covered the footer's Book a demo). */
body .foot, body .site-foot, body .lfoot { padding-right: 96px; }
@media (max-width: 640px) {
  body .foot, body .site-foot, body .lfoot { padding-right: 16px; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}
