.chvmpai {
  --cm-ink: #101014;
  --cm-accent: #ff2e6b;
  --cm-surface: #ffffff;
  --cm-muted: #64748b;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  color: var(--cm-ink);
  font: 400 15px/1.45 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.chvmpai *, .chvmpai *::before, .chvmpai *::after { box-sizing: border-box; }
.chvmpai button, .chvmpai textarea, .chvmpai a {
  font: inherit !important;
  letter-spacing: normal !important;
  text-indent: 0 !important;
  text-transform: none !important;
}

.chvmpai__launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px 0 13px;
  color: #fff !important;
  background: linear-gradient(135deg, #ff2e6b 0%, #d91e57 100%) !important;
  box-shadow: 0 12px 32px rgba(23, 35, 61, .24);
  cursor: pointer;
  font-weight: 750;
}

.chvmpai__launcher::before {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(255, 46, 107, .28);
  border-radius: inherit;
  content: "";
  animation: chvmpai-pulse 2.8s ease-out infinite;
  pointer-events: none;
}

.chvmpai__launcher-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--cm-accent);
  background: #fff;
  font-size: 17px;
}

.chvmpai__launcher-label { letter-spacing: -.01em; }

.chvmpai__nudge {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(360px, calc(100vw - 28px));
  min-height: 84px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 18px;
  padding: 15px 42px 15px 66px;
  color: #fff;
  background: linear-gradient(135deg, #ff2e6b 0%, #d91e57 100%);
  box-shadow: 0 18px 46px rgba(108, 10, 49, .32);
  cursor: pointer;
}

.chvmpai__nudge::before {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  color: var(--cm-accent);
  background: #fff;
  content: "V";
  font-size: 20px;
  font-weight: 850;
}

.chvmpai__nudge:not([hidden]) { display: grid; gap: 3px; }
.chvmpai__nudge strong { color: #fff; font-size: 15px; line-height: 1.25; }
.chvmpai__nudge span { color: rgba(255, 255, 255, .9); font-size: 13px; line-height: 1.35; }
.chvmpai__nudge-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  color: #fff !important;
  background: transparent !important;
  cursor: pointer;
  font-size: 20px;
  opacity: .86;
}

.chvmpai__nudge:hover { transform: translateY(-2px); box-shadow: 0 22px 52px rgba(108, 10, 49, .38); }
.chvmpai__nudge:focus-within { outline: 3px solid #f7b32b; outline-offset: 3px; }

.chvmpai__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 104px));
  overflow: hidden;
  border: 1px solid rgba(23, 35, 61, .12);
  border-radius: 18px;
  background: var(--cm-surface);
  box-shadow: 0 22px 65px rgba(23, 35, 61, .22);
}

.chvmpai__panel:not([hidden]) { display: grid; grid-template-rows: auto 1fr auto auto auto; }

.chvmpai__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: #fff;
  background: var(--cm-ink);
}

.chvmpai__header small { display: block; max-width: 260px; opacity: .82; font-size: 11px; }
.chvmpai .chvmpai__close { border: 0 !important; color: #fff !important; background: transparent !important; cursor: pointer; font-size: 26px !important; }

.chvmpai__messages { overflow-y: auto; padding: 16px; background: #f7f9fc; }
.chvmpai__message { position: relative; max-width: 88%; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chvmpai__message--assistant { background: #fff; border: 1px solid #e4e9f2; }
.chvmpai__message--user { margin-left: auto; color: #fff; background: var(--cm-accent); }
.chvmpai__listen { display: block; margin: 7px 0 0 auto; min-width: 30px; min-height: 28px; border: 1px solid #dbe2ef !important; border-radius: 999px; color: var(--cm-accent) !important; background: #fff !important; cursor: pointer; }
.chvmpai__listen[data-speaking="true"] { color: #fff !important; background: var(--cm-accent) !important; }

.chvmpai__quick, .chvmpai__actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 12px; }
.chvmpai__quick button, .chvmpai__actions a { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid #cfd8ea !important; border-radius: 999px; padding: 8px 12px; color: var(--cm-ink) !important; background: #fff !important; text-align: center; text-decoration: none !important; cursor: pointer; }
.chvmpai__quick button:hover, .chvmpai__actions a:hover { border-color: var(--cm-accent) !important; color: var(--cm-accent) !important; }

.chvmpai__form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 10px 12px; border-top: 1px solid #e4e9f2; }
.chvmpai__form textarea { min-height: 42px; max-height: 112px; resize: vertical; border: 1px solid #cfd8ea; border-radius: 10px; padding: 10px; color: var(--cm-ink); background: #fff; }
.chvmpai__form button { display: inline-flex; align-self: end; min-height: 42px; align-items: center; justify-content: center; border: 0 !important; border-radius: 10px; padding: 0 15px; color: #fff !important; background: var(--cm-accent) !important; text-align: center; cursor: pointer; }
.chvmpai__form button:disabled { cursor: wait; opacity: .55; }
.chvmpai__form .chvmpai__mic { width: 42px; padding: 0; border: 1px solid #cfd8ea !important; color: var(--cm-accent) !important; background: #fff !important; }
.chvmpai__form .chvmpai__mic[data-listening="true"] { color: #fff !important; background: #c4334b !important; animation: chvmpai-pulse 1.25s infinite; }
.chvmpai__voice-status { margin: 0; padding: 0 12px 6px; color: var(--cm-accent); font-size: 11px; }
.chvmpai__notice { margin: 0; padding: 0 12px 10px; color: var(--cm-muted); font-size: 11px; }

.chvmpai :focus-visible { outline: 3px solid #f7b32b; outline-offset: 2px; }

@keyframes chvmpai-pulse {
  0%, 45% { opacity: 0; transform: scale(.98); }
  60% { opacity: .8; }
  100% { opacity: 0; transform: scale(1.1); }
}

@media (max-width: 480px) {
  .chvmpai { right: 10px; bottom: 10px; }
  .chvmpai__launcher { min-width: 58px; width: 58px; padding: 0; justify-content: center; }
  .chvmpai__launcher-label { display: none; }
  .chvmpai__panel { bottom: 68px; width: calc(100vw - 20px); height: calc(100dvh - 88px); border-radius: 14px; }
  .chvmpai__nudge { bottom: 68px; width: min(340px, calc(100vw - 20px)); }
}

@media (prefers-reduced-motion: reduce) {
  .chvmpai * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
