/* generated by scripts/keltar_build_assets.py: keltar-core.css + keltar-launcher.css */
/* Keltar core: the felt avatar in its red mug, and the shared voice-call UI. */

.kav {
  --kav-h: 64px;
  --kav-ar: .8066;
  --kav-level: 0;
  --kav-mic: 0;
  --kav-pupil: 26%;
  position: relative;
  display: inline-block;
  width: calc(var(--kav-h) * var(--kav-ar) * 1.18);
  height: calc(var(--kav-h) * 1.07);
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.kav-nomug { height: var(--kav-h); width: calc(var(--kav-h) * var(--kav-ar)); }

.kav-float {
  position: absolute;
  inset: 0;
  transform-origin: 42% 90%;
  animation: kavBob 4.4s ease-in-out infinite;
}
.kav-reduced .kav-float { animation: none; }

.kav-body {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: calc(var(--kav-h) * var(--kav-ar));
  height: var(--kav-h);
  transform-origin: 50% 85%;
  will-change: transform;
}
.kav-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 calc(var(--kav-h) * .02) calc(var(--kav-h) * .04) rgba(0, 0, 0, .28));
}
.kav-eye {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}
.kav-pupil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--kav-pupil);
  aspect-ratio: 1 / 1;
  margin: calc(var(--kav-pupil) / -2) 0 0 calc(var(--kav-pupil) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #4b4136 0, #1c140e 46%, #0b0705 100%);
  box-shadow: 0 0 0 .5px rgba(30, 20, 12, .5);
  will-change: transform;
}
.kav-glint {
  position: absolute;
  left: 20%;
  top: 16%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}
.kav-lid {
  position: absolute;
  inset: -6%;
  background: #2b9373 url(img/felt.webp) center / 300% auto;
  border-bottom: 1px solid rgba(20, 50, 40, .55);
  transform: translateY(-112%);
}
.kav-lid.kav-blink { animation: kavBlink .18s ease-in-out; }
.kav-lid.kav-blink2 { animation: kavBlink .16s ease-in-out 2; }

.kav-mug-back, .kav-mug-front {
  position: absolute;
  left: 0;
  top: calc(var(--kav-h) * .565);
  width: calc(var(--kav-h) * var(--kav-ar) * 1.173);
  height: calc(var(--kav-h) * var(--kav-ar) * .625);
  pointer-events: none;
}
.kav-mug-back { z-index: 2; }
.kav-mug-front { z-index: 4; filter: drop-shadow(0 calc(var(--kav-h) * .03) calc(var(--kav-h) * .04) rgba(0, 0, 0, .3)); }
.kav-mug-back svg, .kav-mug-front svg { width: 100%; height: 100%; display: block; overflow: visible; }
.kav-nomug .kav-mug-back, .kav-nomug .kav-mug-front { display: none; }

.kav-glow {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 46%;
  width: calc(var(--kav-h) * 1.45);
  height: calc(var(--kav-h) * 1.45);
  margin: calc(var(--kav-h) * -.725) 0 0 calc(var(--kav-h) * -.725);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 255, 214, .55) 0, rgba(120, 140, 255, .22) 38%, rgba(255, 60, 180, 0) 68%);
  opacity: calc(.22 + var(--kav-level) * .7 + var(--kav-mic) * .35);
  transform: scale(calc(.85 + var(--kav-level) * .35));
  pointer-events: none;
  transition: opacity .2s;
}
.kav-glyph {
  position: absolute;
  left: 42%;
  top: 44%;
  z-index: 1;
  font: 700 calc(var(--kav-h) * .13) / 1 Georgia, "Linux Libertine", "Times New Roman", serif;
  color: #14866d;
  text-shadow: 0 0 calc(var(--kav-h) * .05) rgba(120, 255, 214, .8);
  pointer-events: none;
  will-change: transform, opacity;
}
.kav-glyph:nth-child(3n) { color: #6b4ba1; text-shadow: 0 0 calc(var(--kav-h) * .05) rgba(200, 140, 255, .8); }
.kav-glyph:nth-child(4n) { color: #3366cc; text-shadow: 0 0 calc(var(--kav-h) * .05) rgba(120, 170, 255, .8); }
.kav-reduced .kav-glyph { display: none; }

.kav-hop { animation: kavHop .55s cubic-bezier(.3, 1.6, .5, 1) !important; }
.kav-mood-excited .kav-float { animation: kavExcited .5s ease-in-out 3, kavBob 4.4s ease-in-out 1.5s infinite; }
.kav-mood-thinking .kav-glow { animation: kavThink 1.6s ease-in-out infinite; }
.kav-mood-speaking .kav-float { animation-duration: 2.6s; }
.kav-mood-dizzy .kav-float { animation: kavDizzy 1.2s linear 2; }

@keyframes kavBob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-5%) rotate(1.4deg); }
}
@keyframes kavBlink {
  0% { transform: translateY(-112%); }
  45%, 55% { transform: translateY(0); }
  100% { transform: translateY(-112%); }
}
@keyframes kavHop {
  0% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(2%) scale(1.06, .92); }
  55% { transform: translateY(-16%) scale(.95, 1.07); }
  80% { transform: translateY(1%) scale(1.04, .96); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes kavExcited {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-12%) rotate(-6deg); }
  65% { transform: translateY(-6%) rotate(6deg); }
}
@keyframes kavThink {
  0%, 100% { opacity: .25; transform: scale(.9); }
  50% { opacity: .65; transform: scale(1.08); }
}
@keyframes kavDizzy {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------ voice call UI (launcher panel and chat page) */

.kcall {
  --kc-ink: #eef2ff;
  --kc-dim: #9aa6c8;
  --kc-accent: #78ffd6;
  --kc-pink: #ff4fb3;
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--kc-ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.kcall-stage {
  position: relative;
  height: 250px;
  overflow: hidden;
  border-radius: 10px;
  background: #050512;
  isolation: isolate;
}
.kcall-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kcall-stage .kav { position: absolute; left: 50%; top: 50%; transform: translate(-46%, -52%); z-index: 2; }
.kcall-rings { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.kcall-rings i {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 1.5px solid rgba(120, 255, 214, .55);
  opacity: 0;
  transform: scale(calc(.8 + var(--kc-level, 0) * 2.2));
  transition: transform .08s linear, opacity .2s;
}
.kcall.is-live .kcall-rings i { opacity: calc(.15 + var(--kc-level, 0) * .8); }
.kcall-rings i:nth-child(2) { width: 170px; height: 170px; margin: -85px 0 0 -85px; border-color: rgba(255, 79, 179, .4); transition-delay: .05s; }
.kcall-rings i:nth-child(3) { width: 230px; height: 230px; margin: -115px 0 0 -115px; border-color: rgba(120, 140, 255, .35); transition-delay: .1s; }

.kcall-status {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: rgba(5, 5, 20, .62);
  color: var(--kc-ink);
  font-size: 12px;
  letter-spacing: .02em;
  backdrop-filter: blur(4px);
}
.kcall-status b { width: 8px; height: 8px; border-radius: 50%; background: #9aa6c8; display: inline-block; }
.kcall.is-connecting .kcall-status b { background: #ffcf5a; animation: kcPulse 1s ease-in-out infinite; }
.kcall.is-live .kcall-status b { background: #ff4f6d; box-shadow: 0 0 8px #ff4f6d; animation: kcPulse 1.4s ease-in-out infinite; }
.kcall-timer { position: absolute; right: 10px; top: 10px; z-index: 3; font: 600 12px/1.6 ui-monospace, Menlo, Consolas, monospace; color: var(--kc-dim); }

.kcall-captions {
  position: relative;
  margin-top: 10px;
  min-height: 74px;
  max-height: 150px;
  overflow-y: auto;
  padding: 8px 12px;
  border-radius: 10px;
  background: #0b0d22;
  border: 1px solid #23284d;
  scroll-behavior: smooth;
}
.kcall-line { margin: 0 0 6px; }
.kcall-line.k { font: 16px/1.45 Georgia, "Linux Libertine", "Times New Roman", serif; color: #f4f1ff; }
.kcall-line.u { color: #9fb0d8; font-size: 13.5px; }
.kcall-line.u::before { content: "You: "; color: #6f7ca3; }
.kcall-line.partial { opacity: .65; }
.kcall-empty { color: #6f7ca3; font-size: 13px; }

.kcall-controls { display: flex; gap: 8px; margin-top: 10px; }
.kcall-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #2c3366;
  border-radius: 8px;
  background: #141838;
  color: var(--kc-ink);
  font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer;
}
.kcall-btn:hover { background: #1d2250; }
.kcall-btn:focus-visible { outline: 2px solid var(--kc-accent); outline-offset: 2px; }
.kcall-btn svg { width: 17px; height: 17px; }
.kcall-btn.is-end { background: #b0213b; border-color: #d33c57; }
.kcall-btn.is-end:hover { background: #c92a46; }
.kcall-btn.is-primary { background: linear-gradient(135deg, #14866d, #3366cc 60%, #8a3bd1); border-color: transparent; }
.kcall-btn.is-on { background: #3a2a10; border-color: #c08a2c; }
.kcall-btn[hidden] { display: none; }
.kcall-note { margin-top: 8px; color: var(--kc-dim); font-size: 12px; }
.kcall-error { margin-top: 8px; color: #ffb3c0; font-size: 13px; }

@keyframes kcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  .kcall-rings i { transition: none; }
}

/* Keltar on Molecupedia: header avatar, dock, pop-ups, portal panel, chat drawer. Colors follow the wiki's
 * Vector skin in day and night themes; the portal interior is always deep space. */

.kl-slot, .kl-card, .kl-greet, .kl-pop, .kl-panel, .kl-dock, .kl-toast, .kl-mini, .kl-drawer {
  --kl-bg: #fff;
  --kl-ink: #202122;
  --kl-sub: #54595d;
  --kl-faint: #72777d;
  --kl-line: #a2a9b1;
  --kl-soft: #f8f9fa;
  --kl-link: #36c;
  --kl-link-h: #447ff5;
  --kl-shadow: 0 10px 40px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .1);
  --kl-serif: "Linux Libertine", "Georgia", "Times", "Source Serif Pro", serif;
  --kl-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, "Helvetica Neue", Arial, sans-serif;
}
html.skin-theme-clientpref-night .kl-slot, html.skin-theme-clientpref-night .kl-card, html.skin-theme-clientpref-night .kl-greet,
html.skin-theme-clientpref-night .kl-pop,
html.skin-theme-clientpref-night .kl-panel, html.skin-theme-clientpref-night .kl-dock, html.skin-theme-clientpref-night .kl-toast,
html.skin-theme-clientpref-night .kl-mini, html.skin-theme-clientpref-night .kl-drawer {
  --kl-bg: #101418; --kl-ink: #eaecf0; --kl-sub: #a2a9b1; --kl-faint: #8a9099; --kl-line: #54595d; --kl-soft: #1b1f24;
  --kl-link: #88a3e8; --kl-link-h: #a7bcf0; --kl-shadow: 0 10px 40px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  html.skin-theme-clientpref-os .kl-slot, html.skin-theme-clientpref-os .kl-card, html.skin-theme-clientpref-os .kl-greet,
  html.skin-theme-clientpref-os .kl-pop,
  html.skin-theme-clientpref-os .kl-panel, html.skin-theme-clientpref-os .kl-dock, html.skin-theme-clientpref-os .kl-toast,
  html.skin-theme-clientpref-os .kl-mini, html.skin-theme-clientpref-os .kl-drawer {
    --kl-bg: #101418; --kl-ink: #eaecf0; --kl-sub: #a2a9b1; --kl-faint: #8a9099; --kl-line: #54595d; --kl-soft: #1b1f24;
    --kl-link: #88a3e8; --kl-link-h: #a7bcf0; --kl-shadow: 0 10px 40px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
  }
}

/* ------------------------------------------------------------ header */

.kl-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 0 10px;
  height: 3.125rem;
  flex: none;
  opacity: 0;
  transform: translateY(-8px) scale(.85);
  transition: opacity .6s ease, transform .8s cubic-bezier(.3, 1.6, .5, 1);
}
.kl-slot.kl-in { opacity: 1; transform: none; }
.kl-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 14px;
  color: inherit;
}
.kl-trigger:focus-visible { outline: 2px solid var(--kl-link, #36c); outline-offset: 3px; }
.kl-trigger-header .kav { margin-top: -4px; }
.kl-header-kav .kav-glyph { font-size: 7px; }
.kl-slot.kl-away .kl-trigger-header .kav { visibility: hidden; }
.kl-trace-wrap { display: inline-block; width: 58px; height: 16px; opacity: .8; border-radius: 3px; transition: opacity .2s, background .2s; }
.kl-trace-wrap:hover { opacity: 1; background: rgba(51, 102, 204, .08); }
.kl-trace { display: block; width: 58px; height: 16px; }
.mw-logo-icon.kl-logo-spin { animation: klLogoSpin 1.1s cubic-bezier(.3, 1.4, .5, 1); }
.mw-logo-icon.kl-logo-wink { animation: klLogoWink .7s ease-in-out; }
@keyframes klLogoSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes klLogoWink { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg) scale(1.06); } 60% { transform: rotate(8deg); } }

/* ------------------------------------------------------------ hovercard (page-preview style) */

.kl-card {
  position: absolute;
  z-index: 1003;
  display: flex;
  gap: 12px;
  width: 330px;
  padding: 14px 14px 14px 16px;
  background: var(--kl-bg);
  color: var(--kl-ink);
  border-radius: 2px;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .3), 0 0 1px 1px rgba(0, 0, 0, .05);
  font: 14px/1.5 var(--kl-sans);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.kl-card.kl-show { opacity: 1; transform: none; pointer-events: auto; }
.kl-card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 30px;
  border: 7px solid transparent;
  border-top: 0;
  border-bottom-color: var(--kl-bg);
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, .06));
}
.kl-card-title { font: 700 16px/1.3 var(--kl-sans); }
.kl-card-sub { color: var(--kl-sub); font-size: 13px; margin-bottom: 6px; }
.kl-card p { margin: 0 0 6px; }
.kl-card-fine { color: var(--kl-faint); font-style: italic; font-size: 13px; }
.kl-card-thumb { flex: none; width: 80px; height: auto; align-self: flex-start; }

/* ------------------------------------------------------------ Keltar in flight
 * Behind the text: z-index -1 inside .mw-page-container (a stacking context), so above the page background and under
 * the article. In front (.kl-front, in body) only near where he is leaving or landing. The sidebars share the page's
 * background color, so during a flight they turn transparent, or he would vanish into plain white. */

.kl-flyer { position: fixed; left: 0; top: 0; z-index: -1; line-height: 0; pointer-events: none; will-change: transform; }
.kl-flyer.kl-front { z-index: 1002; }
html.kl-flying .vector-pinned-container { background-color: transparent; }

/* ------------------------------------------------------------ hello bubbles under the header avatar (front page) */

.kl-greet {
  position: absolute;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  pointer-events: none;
  animation: klGreetFloat 3.4s ease-in-out infinite;
}
.kl-greet-b {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: max-content;
  max-width: calc(100vw - 52px);
  margin: 0;
  padding: 7px 14px 8px;
  background: var(--kl-bg);
  color: var(--kl-ink);
  border: 2px solid var(--kl-ink);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  font: 600 16px/1.3 var(--kl-serif);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: scale(.3) rotate(var(--kl-rot));
  transform-origin: var(--kl-tail, 22px) -10px;
  transition: opacity .25s, transform .55s cubic-bezier(.3, 1.6, .5, 1);
}
.kl-greet-1 { --kl-rot: -2deg; }
.kl-greet-2 { --kl-rot: 1.5deg; margin-left: 26px; transform-origin: 21px -14px; }
.kl-greet-b.kl-in { opacity: 1; transform: rotate(var(--kl-rot)); }
.kl-greet-b:hover { background: var(--kl-soft); }
.kl-greet-ghost { visibility: hidden; }
.kl-greet-typed { position: absolute; left: 14px; right: 14px; top: 7px; }
/* the tail points up at Keltar; the neck links the second bubble to the first, comic style */
.kl-greet-1::before {
  content: "";
  position: absolute;
  top: -8px;
  left: calc(var(--kl-tail, 22px) - 7px);
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 2px solid var(--kl-ink);
  border-top: 2px solid var(--kl-ink);
  border-radius: 2px 0 0 0;
  transform: rotate(45deg);
}
.kl-greet-2::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 15px;
  width: 9px;
  height: 17px;
  background: inherit;
  border-left: 2px solid var(--kl-ink);
  border-right: 2px solid var(--kl-ink);
}
.kl-greet.kl-out .kl-greet-b { opacity: 0; transform: translateY(-8px) scale(.8) rotate(var(--kl-rot)); transition: opacity .3s, transform .35s ease-in; }
@keyframes klGreetFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .kl-greet { animation: none; }
  .kl-greet-b, .kl-greet-b.kl-in, .kl-greet.kl-out .kl-greet-b { transform: none; transition: opacity .2s; }
}

/* ------------------------------------------------------------ dock */

.kl-dock {
  position: fixed;
  right: 18px;
  bottom: 12px;
  z-index: 990;
  display: flex;
  align-items: center;
  gap: 8px;
  visibility: hidden;
  pointer-events: none;
}
/* no transition: he flies in and out (see "travel" in keltar-launcher.js), so the dock just appears under him */
.kl-dock.kl-show { visibility: visible; pointer-events: auto; }
.kl-dock::before {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 255, 214, .25), rgba(130, 90, 255, .12) 45%, rgba(255, 60, 180, 0) 70%);
  pointer-events: none;
}
.kl-dock-label {
  padding: 5px 12px;
  border: 1px solid var(--kl-line);
  border-radius: 999px;
  background: var(--kl-bg);
  color: var(--kl-link);
  box-shadow: var(--kl-shadow);
  font: 600 13px/1.3 var(--kl-sans);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity .2s, transform .25s;
  pointer-events: none;
}
.kl-dock:hover .kl-dock-label, .kl-dock:focus-within .kl-dock-label { opacity: 1; transform: none; }

/* ------------------------------------------------------------ pop-ups */

.kl-pop { position: fixed; z-index: 995; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.kl-pop .kl-bubble, .kl-pop .kl-pop-kav { pointer-events: auto; }
.kl-pop-kav { position: relative; line-height: 0; flex: none; }
.kl-bubble {
  position: relative;
  max-width: 270px;
  padding: 12px 14px 9px;
  background: var(--kl-bg);
  color: var(--kl-ink);
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  box-shadow: var(--kl-shadow);
  font: 14px/1.45 var(--kl-sans);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .3s .35s, transform .45s .35s cubic-bezier(.3, 1.5, .5, 1);
}
.kl-pop.kl-in .kl-bubble { opacity: 1; transform: none; }
.kl-bubble-t { margin: 0 0 10px; font: 16.5px/1.42 var(--kl-serif); }
.kl-bubble-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kl-b-yes, .kl-b-no, .kl-btn {
  appearance: none;
  border-radius: 2px;
  padding: 5px 12px;
  min-height: 32px;
  font: 700 14px/1.3 var(--kl-sans);
  cursor: pointer;
}
.kl-b-yes, .kl-btn-text { background: #36c; border: 1px solid #36c; color: #fff; }
.kl-b-yes:hover, .kl-btn-text:hover { background: #447ff5; border-color: #447ff5; }
.kl-b-no, .kl-btn-close { background: var(--kl-soft); border: 1px solid var(--kl-line); color: var(--kl-ink); }
.kl-b-no:hover, .kl-btn-close:hover { background: var(--kl-bg); }
.kl-b-stop {
  display: block;
  margin: 7px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--kl-faint);
  font: 12px/1.4 var(--kl-sans);
  text-decoration: underline dotted;
  cursor: pointer;
}
.kl-b-yes:focus-visible, .kl-b-no:focus-visible, .kl-b-stop:focus-visible, .kl-btn:focus-visible { outline: 2px solid var(--kl-link); outline-offset: 2px; }

/* peeking from the right edge */
.kl-pop-right { right: 0; top: var(--kl-y, 40vh); flex-direction: row-reverse; transform: translateX(105%); transition: transform .8s cubic-bezier(.2, 1.35, .4, 1); }
.kl-pop-right.kl-in { transform: translateX(26px); }
.kl-pop-right .kl-bubble::after { content: ""; position: absolute; right: -8px; top: 40%; border: 8px solid transparent; border-right: 0; border-left-color: var(--kl-bg); }
/* peeking from the left edge */
.kl-pop-left { left: 0; top: var(--kl-y, 40vh); flex-direction: row; transform: translateX(-105%); transition: transform .8s cubic-bezier(.2, 1.35, .4, 1); }
.kl-pop-left.kl-in { transform: translateX(-26px); }
.kl-pop-left .kl-bubble::after { content: ""; position: absolute; left: -8px; top: 40%; border: 8px solid transparent; border-left: 0; border-right-color: var(--kl-bg); }
/* rising from the bottom edge, mug first */
.kl-pop-bottom { left: var(--kl-x, 50vw); bottom: 0; flex-direction: column-reverse; transform: translate(-50%, 110%); transition: transform .8s cubic-bezier(.2, 1.35, .4, 1); }
.kl-pop-bottom.kl-in { transform: translate(-50%, 6px); }
.kl-pop-bottom .kl-bubble::after { content: ""; position: absolute; bottom: -8px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--kl-bg); }
/* dangling upside down from the top edge on a felt thread */
.kl-pop-top { left: var(--kl-x, 50vw); top: 0; flex-direction: column; transform: translate(-50%, -120%); transition: transform 1s cubic-bezier(.2, 1.25, .4, 1); }
.kl-pop-top.kl-in { transform: translate(-50%, 0); }
.kl-pop-top .kl-pop-kav { transform-origin: 50% -60px; animation: klSwing 3.2s ease-in-out infinite; padding-top: 60px; }
.kl-pop-top .kl-pop-kav .kav { transform: rotate(180deg); }
.kl-thread { position: absolute; left: 50%; top: 0; width: 2px; height: 66px; margin-left: -1px; background: linear-gradient(#2b9373, #1f6e56); border-radius: 1px; }
.kl-pop-top .kl-bubble::after { content: ""; position: absolute; top: -8px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--kl-bg); }
/* emerging from a rift in the page */
.kl-pop-rift { right: 6vw; top: var(--kl-y, 40vh); flex-direction: row-reverse; }
.kl-pop-rift .kl-pop-kav { transform: scale(.15) rotate(-30deg); opacity: 0; transition: transform .9s .45s cubic-bezier(.2, 1.5, .4, 1), opacity .4s .45s; }
.kl-pop-rift.kl-in .kl-pop-kav { transform: none; opacity: 1; }
/* he flies to the rift instead of growing out of it; the bubble waits for him */
.kl-pop-rift.kl-flown .kl-pop-kav { transform: none; opacity: 1; transition: none; }
.kl-pop-rift.kl-flown:not(.kl-arrived) .kl-bubble { opacity: 0; transform: scale(.85); }
.kl-rift {
  position: absolute;
  right: 40px;
  top: 50%;
  width: 6px;
  height: 0;
  margin-top: -90px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #fff 0, #78ffd6 22%, #8a5bff 48%, rgba(255, 50, 180, .0) 72%);
  box-shadow: 0 0 22px 8px rgba(255, 60, 190, .55), 0 0 60px 20px rgba(120, 255, 214, .35);
  filter: blur(.4px);
  transition: height .45s cubic-bezier(.2, 1.4, .4, 1), width .5s .3s;
}
.kl-pop-rift.kl-in .kl-rift { height: 180px; width: 26px; animation: klRift 2.4s ease-in-out .9s infinite; }
.kl-pop-rift.kl-out .kl-rift { height: 0; width: 2px; transition: height .5s, width .3s; }
/* reduced motion: a quiet corner */
.kl-pop-corner { right: 16px; bottom: 90px; flex-direction: row-reverse; opacity: 0; transition: opacity .4s; }
.kl-pop-corner.kl-in { opacity: 1; }

.kl-pop.kl-out { transition-duration: .5s; }
.kl-pop-right.kl-out { transform: translateX(110%); }
.kl-pop-left.kl-out { transform: translateX(-110%); }
.kl-pop-bottom.kl-out { transform: translate(-50%, 110%); }
.kl-pop-top.kl-out { transform: translate(-50%, -130%); }
.kl-pop-rift.kl-out .kl-pop-kav { transform: scale(.1) rotate(40deg); opacity: 0; transition-delay: 0s; }
.kl-pop.kl-out .kl-bubble, .kl-pop.kl-accept .kl-bubble { opacity: 0; transform: scale(.9); transition-delay: 0s; }
.kl-pop.kl-accept { opacity: 0; transition: opacity .4s; }

@keyframes klSwing { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes klRift { 0%, 100% { filter: blur(.4px) hue-rotate(0deg); } 50% { filter: blur(1px) hue-rotate(40deg); } }

/* ------------------------------------------------------------ hotpink spark */

.kl-spark {
  position: fixed;
  left: -140px;
  z-index: -1;
  width: 96px;
  height: 118px;
  pointer-events: none;
  animation: klSpark 2.5s cubic-bezier(.45, .05, .55, .95) forwards;
}
.kl-spark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: hue-rotate(205deg) saturate(3.2) brightness(1.25) drop-shadow(0 0 10px #ff2fb4) drop-shadow(-46px 0 18px rgba(255, 47, 180, .55)) drop-shadow(-90px 0 24px rgba(255, 47, 180, .3));
}
@keyframes klSpark {
  0% { left: -140px; transform: translateY(0) rotate(-20deg); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translateY(-40px) rotate(10deg); }
  90% { opacity: 1; }
  100% { left: calc(100vw + 140px); transform: translateY(10px) rotate(30deg); opacity: 0; }
}

/* ------------------------------------------------------------ toast and mini call pill */

.kl-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1005;
  max-width: min(460px, calc(100vw - 32px));
  padding: 9px 16px;
  border-radius: 999px;
  background: #202122;
  color: #fff;
  font: 14px/1.4 var(--kl-sans);
  box-shadow: var(--kl-shadow);
  transform: translate(-50%, 30px);
  opacity: 0;
  transition: opacity .3s, transform .4s cubic-bezier(.3, 1.4, .5, 1);
}
.kl-toast.kl-show { opacity: 1; transform: translate(-50%, 0); }
.kl-mini {
  position: fixed;
  right: 18px;
  bottom: 100px;
  z-index: 996;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #d33c57;
  border-radius: 999px;
  background: #170a14;
  color: #fff;
  font: 14px/1.2 var(--kl-sans);
  box-shadow: 0 6px 24px rgba(200, 30, 80, .35);
  cursor: pointer;
}
.kl-mini b { color: #78ffd6; }
.kl-mini-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4f6d; box-shadow: 0 0 8px #ff4f6d; animation: kcPulse 1.3s ease-in-out infinite; }

/* ------------------------------------------------------------ portal panel */

.kl-panel {
  position: fixed;
  z-index: 1000;
  width: 392px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 14px;
  background: var(--kl-bg);
  color: var(--kl-ink);
  border: 1px solid var(--kl-line);
  border-radius: 12px;
  box-shadow: var(--kl-shadow);
  font: 14px/1.5 var(--kl-sans);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(.96);
  transform-origin: 20px 0;
  transition: opacity .22s ease, transform .35s cubic-bezier(.3, 1.4, .5, 1), visibility 0s .35s;
}
.kl-panel.kl-anchored-bottom { transform-origin: calc(100% - 30px) 100%; transform: translateY(10px) scale(.96); }
.kl-panel.kl-center { left: 50% !important; top: 50% !important; transform: translate(-50%, -48%) scale(.96); transform-origin: 50% 50%; }
.kl-panel.kl-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.kl-panel.kl-center.kl-open { transform: translate(-50%, -50%); }
.kl-panel.kl-minimized { opacity: 0; visibility: hidden; pointer-events: none; }

.kl-panel-head { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.kl-ph { flex: 1; min-width: 0; }
.kl-ph-name { font: 400 24px/1.15 var(--kl-serif); }
.kl-ph-sub { color: var(--kl-sub); font-size: 12.5px; }
.kl-icon {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--kl-ink);
  cursor: pointer;
}
.kl-icon:hover { background: var(--kl-soft); }
.kl-icon:focus-visible { outline: 2px solid var(--kl-link); }
.kl-icon svg { width: 20px; height: 20px; display: block; }

.kl-portal {
  position: relative;
  height: 172px;
  overflow: hidden;
  border-radius: 10px;
  background: #050512;
  isolation: isolate;
}
.kl-portal canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kl-portal .kav { position: absolute; left: 50%; top: 52%; transform: translate(-45%, -50%); z-index: 2; }
.kl-portal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 40px rgba(120, 90, 255, .25);
  pointer-events: none;
  z-index: 3;
}
.kl-intro { margin: 12px 2px 12px; font: 17px/1.42 var(--kl-serif); }

.kl-email { display: block; margin: 0 0 12px; }
.kl-email-l { display: block; margin-bottom: 3px; font-weight: 700; font-size: 13.5px; }
.kl-email-l i { font-weight: 400; color: var(--kl-faint); font-style: normal; }
.kl-email input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--kl-line);
  border-radius: 2px;
  background: var(--kl-bg);
  color: var(--kl-ink);
  font: 15px/1.4 var(--kl-sans);
  box-shadow: inset 0 0 0 1px transparent;
  transition: border-color .15s, box-shadow .15s;
}
.kl-email input:focus { outline: 0; border-color: var(--kl-link); box-shadow: inset 0 0 0 1px var(--kl-link); }
.kl-email-help { display: block; margin-top: 3px; color: var(--kl-faint); font-size: 12.5px; }
.kl-email.kl-bad input { border-color: #d73333; box-shadow: inset 0 0 0 1px #d73333; }
.kl-email.kl-bad .kl-email-help { color: #d73333; }

.kl-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kl-opt {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  background: var(--kl-bg);
  color: var(--kl-ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.kl-opt svg { grid-row: 1 / span 2; width: 24px; height: 24px; }
.kl-opt b { font: 700 16px/1.2 var(--kl-sans); }
.kl-opt span { font-size: 12.5px; line-height: 1.3; color: var(--kl-sub); }
.kl-opt:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(51, 102, 204, .2); border-color: var(--kl-link); }
.kl-opt:focus-visible { outline: 2px solid var(--kl-link); outline-offset: 2px; }
.kl-opt-voice {
  color: #fff;
  border-color: transparent;
  background: radial-gradient(120% 160% at 0% 0%, #3a1a78 0, #14866d 40%, #1d3f9e 75%, #5b2aa8 100%);
}
.kl-opt-voice span { color: rgba(255, 255, 255, .82); }
.kl-opt-voice::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, .22) 80%, transparent 90%);
  animation: klSweep 4s linear infinite;
  pointer-events: none;
}
@keyframes klSweep { to { transform: rotate(360deg); } }
.kl-fine { margin: 12px 2px 0; color: var(--kl-faint); font-size: 12px; line-height: 1.45; }
.kl-sound { padding: 0; border: 0; background: none; color: var(--kl-link); font: inherit; cursor: pointer; text-decoration: underline dotted; }

.kl-callwrap .kl-email { margin: 12px 0 0; }
.kl-after { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--kl-soft); border: 1px solid var(--kl-line); }
.kl-after-t { margin: 0 0 8px; }
.kl-after-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ chat drawer */

.kl-drawer { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }
.kl-drawer-backdrop { position: absolute; inset: 0; background: rgba(2, 2, 12, .35); opacity: 0; transition: opacity .3s; }
.kl-drawer-sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: #060716;
  box-shadow: -14px 0 50px rgba(10, 0, 40, .35);
  transform: translateX(104%);
  transition: transform .5s cubic-bezier(.2, .9, .3, 1);
  pointer-events: auto;
}
.kl-drawer-sheet iframe { width: 100%; height: 100%; border: 0; display: block; background: #060716; }
.kl-drawer.kl-open .kl-drawer-sheet { transform: none; }
@media (max-width: 1279.98px) {
  .kl-drawer.kl-open { pointer-events: auto; }
  .kl-drawer.kl-open .kl-drawer-backdrop { opacity: 1; }
}
@media (min-width: 1280px) {
  html.kl-drawer-open .mw-page-container { margin-right: 440px; transition: margin-right .5s cubic-bezier(.2, .9, .3, 1); }
  html.kl-drawer-open .vector-header-container .vector-header { margin-right: 440px; }
}

/* ------------------------------------------------------------ phones */

@media (max-width: 719.98px) {
  .kl-slot { margin-left: 4px; height: auto; }
  .kl-trigger-header .kav { margin-top: 0; }
  .kl-dock { right: 10px; bottom: 10px; }
  .kl-panel.kl-sheet {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: auto;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: opacity .2s, transform .45s cubic-bezier(.2, .9, .3, 1), visibility 0s .45s;
  }
  .kl-panel.kl-sheet.kl-open { transform: none; transition-delay: 0s; }
  .kl-options { grid-template-columns: 1fr; }
  .kl-bubble { max-width: min(300px, calc(100vw - 24px)); }
  .kl-drawer-sheet { width: 100vw; }
  .kl-mini { right: 10px; bottom: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  .kl-slot, .kl-dock, .kl-panel, .kl-drawer-sheet, .kl-pop, .kl-bubble, .kl-toast { transition-duration: .01s !important; }
  .kl-opt-voice::after, .kl-pop-top .kl-pop-kav, .kl-rift { animation: none !important; }
}

@media print {
  .kl-slot, .kl-dock, .kl-pop, .kl-panel, .kl-drawer, .kl-card, .kl-toast, .kl-mini, .kl-spark, .kl-flyer, .kl-greet { display: none !important; }
}

.kl-pop-right .kl-pop-kav .kav { transform: rotate(-14deg); transform-origin: 30% 60%; }
.kl-pop-left .kl-pop-kav .kav { transform: rotate(14deg); transform-origin: 70% 60%; }
