.cj-shell {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  color: var(--cj-ink);
  font-family: var(--cj-font);
  line-height: 1.4;
}

.cj-shell *,
.cj-shell *::before,
.cj-shell *::after {
  box-sizing: border-box;
}

.cj-shell__launcher {
  position: fixed;
  z-index: 2;
  bottom: clamp(24px, 6vh, 72px);
  left: 50%;
  width: min(720px, calc(100vw - 40px));
  margin: 0;
  pointer-events: auto;
  transform: translateX(-50%);
  transition: opacity 220ms ease, transform 280ms cubic-bezier(.2, .85, .22, 1), visibility 220ms linear;
}

.cj-shell__launcher-glow {
  position: relative;
  padding: 1px;
  overflow: visible;
  border-radius: 999px;
  background: conic-gradient(from 100deg, var(--cj-secondary), var(--cj-accent), var(--cj-primary), var(--cj-accent), var(--cj-secondary));
  box-shadow: 0 16px 44px color-mix(in srgb, var(--cj-shadow) 24%, transparent);
}

.cj-shell__launcher-glow::before {
  position: absolute;
  z-index: -1;
  inset: -5px;
  border-radius: inherit;
  background: conic-gradient(from 100deg, var(--cj-secondary), var(--cj-accent), var(--cj-primary), var(--cj-accent), var(--cj-secondary));
  filter: blur(12px);
  opacity: .75;
  content: "";
  animation: cj-shell-halo 5.5s linear infinite;
}

.cj-shell__launcher-surface {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 66px;
  gap: 10px;
  padding: 7px 8px 7px 15px;
  background: color-mix(in srgb, var(--cj-surface) 98%, transparent);
  border: 1px solid color-mix(in srgb, var(--cj-surface) 92%, transparent);
  border-radius: inherit;
  box-shadow: inset 0 1px 0 var(--cj-surface), 0 8px 20px color-mix(in srgb, var(--cj-shadow) 8%, transparent);
}

.cj-shell__launcher-glow:focus-within {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cj-shadow) 16%, transparent), 0 16px 44px color-mix(in srgb, var(--cj-shadow) 24%, transparent);
}

.cj-shell__launcher-surface:focus-within {
  box-shadow: inset 0 1px 0 var(--cj-surface), 0 8px 20px color-mix(in srgb, var(--cj-shadow) 8%, transparent);
}

.cj-shell__launcher-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 18px;
  color: var(--cj-primary);
  font-size: 0;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.cj-shell__launcher-orb {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cj-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cj-shadow) 12%, transparent), 0 0 14px color-mix(in srgb, var(--cj-shadow) 32%, transparent);
}

.cj-shell__launcher-orb {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--cj-secondary), var(--cj-primary));
  transform: rotate(45deg);
}

.cj-shell__launcher-orb::after {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 6px;
  height: 6px;
  background: var(--cj-secondary);
  border-radius: 1px;
  content: "";
}

.cj-shell__launcher-input,
.cj-shell__input {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--cj-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}

.cj-shell__launcher-input {
  max-height: 108px;
  padding: 10px 0;
}

.cj-shell__launcher-input::placeholder,
.cj-shell__input::placeholder {
  color: var(--cj-primary);
  opacity: 1;
}

.cj-shell__launcher-send,
.cj-shell__send,
.cj-shell__voice,
.cj-shell__close,
.cj-shell__restart,
.cj-shell__speak {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.cj-shell__launcher-send {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  color: var(--cj-surface);
  background: linear-gradient(135deg, var(--cj-primary), var(--cj-primary));
  border-radius: 50%;
  box-shadow: 0 5px 18px color-mix(in srgb, var(--cj-shadow) 36%, transparent);
  transition: transform 180ms ease, filter 180ms ease;
}

.cj-shell__launcher-send svg,
.cj-shell__close svg {
  width: 20px;
  height: 20px;
  fill: currentcolor;
}

.cj-shell__launcher-send:hover:not(:disabled),
.cj-shell__launcher-send:focus-visible:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px) scale(1.03);
}

.cj-shell__backdrop {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: color-mix(in srgb, var(--cj-shadow) 12%, transparent);
  border: 0;
  transition: opacity 300ms ease, visibility 300ms linear;
}

.cj-shell__panel {
  position: fixed;
  z-index: 3;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: clamp(360px, 26vw, 480px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  color: var(--cj-ink);
  background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--cj-shadow) 15%, transparent), transparent 30%), var(--cj-panel);
  border-left: 1px solid var(--cj-line);
  box-shadow: -16px 0 42px color-mix(in srgb, var(--cj-shadow) 13%, transparent);
  opacity: 0;
  transform: translate3d(104%, 0, 0);
  transition: transform 360ms cubic-bezier(.16, 1, .3, 1), opacity 240ms ease, visibility 360ms linear;
}

.cj-shell__panel::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cj-secondary), var(--cj-accent), var(--cj-primary), var(--cj-accent));
  content: "";
}

.cj-shell[data-shell-state="OPENING"] .cj-shell__launcher,
.cj-shell[data-shell-state="ACTIVE"] .cj-shell__launcher {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 16px);
}

.cj-shell[data-shell-state="OPENING"] .cj-shell__backdrop,
.cj-shell[data-shell-state="ACTIVE"] .cj-shell__backdrop {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.cj-shell[data-shell-state="OPENING"] .cj-shell__panel,
.cj-shell[data-shell-state="ACTIVE"] .cj-shell__panel {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.cj-shell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 16px;
  padding: 17px 18px;
  background: color-mix(in srgb, var(--cj-surface) 94%, transparent);
  border-bottom: 1px solid var(--cj-line);
}

.cj-shell__identity,
.cj-shell__header-actions,
.cj-shell__presence {
  display: flex;
  align-items: center;
}

.cj-shell__identity {
  min-width: 0;
  gap: 10px;
}

.cj-shell__mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  padding: 3px;
  overflow: hidden;
  background: var(--cj-surface);
  border: 1px solid var(--cj-line);
  border-radius: 50%;
  box-shadow: 0 7px 20px color-mix(in srgb, var(--cj-shadow) 18%, transparent);
}

.cj-shell__mark-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cj-shell__title,
.cj-shell__message p {
  margin: 0;
}

.cj-shell__title {
  overflow: hidden;
  color: var(--cj-ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cj-shell__presence {
  gap: 6px;
  margin-top: 4px;
  color: var(--cj-muted);
  font-size: 11px;
  font-weight: 650;
}

.cj-shell__state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cj-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cj-shadow) 15%, transparent), 0 0 12px var(--cj-primary);
}

.cj-shell[data-state="LISTENING"] .cj-shell__state-dot {
  background: var(--cj-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cj-shadow) 16%, transparent), 0 0 12px var(--cj-secondary);
}

.cj-shell[data-state="PROCESSING"] .cj-shell__state-dot,
.cj-shell[data-state="SPEAKING"] .cj-shell__state-dot {
  background: var(--cj-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cj-shadow) 16%, transparent), 0 0 12px var(--cj-accent);
}

.cj-shell[data-state="ERROR"] .cj-shell__state-dot {
  background: var(--cj-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cj-shadow) 16%, transparent), 0 0 12px var(--cj-accent);
}

.cj-shell__header-actions {
  flex: 0 0 auto;
  gap: 7px;
}

.cj-shell__restart {
  min-height: 34px;
  padding: 0 8px;
  color: var(--cj-primary);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.cj-shell__close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--cj-ink);
  background: var(--cj-surface);
  border: 1px solid var(--cj-line);
  border-radius: 9px;
}

.cj-shell__restart:hover,
.cj-shell__restart:focus-visible,
.cj-shell__close:hover,
.cj-shell__close:focus-visible {
  color: var(--cj-primary-hover);
  background: var(--cj-primary-light);
}

.cj-shell__messages {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--cj-shadow) 52%, transparent) transparent;
  background: linear-gradient(180deg, var(--cj-surface) 0%, var(--cj-surface) 100%);
}

.cj-shell__message {
  width: fit-content;
  max-width: 89%;
  padding: 11px 13px;
  overflow-wrap: anywhere;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.cj-shell__message--assistant {
  align-self: flex-start;
  color: var(--cj-ink);
  background: var(--cj-surface);
  border: 1px solid var(--cj-line);
  border-top-left-radius: 5px;
}

.cj-shell__message--visitor {
  align-self: flex-end;
  color: var(--cj-ink);
  background: linear-gradient(135deg, var(--cj-line), var(--cj-line));
  border-bottom-right-radius: 5px;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--cj-shadow) 16%, transparent);
}

.cj-shell__speak {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-top: 8px;
  padding: 0 8px;
  color: var(--cj-primary);
  background: var(--cj-line);
  border: 1px solid var(--cj-line);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 750;
}

.cj-shell__speak.is-speaking {
  color: var(--cj-surface);
  background: var(--cj-primary);
}

.cj-shell__status {
  margin: 0 18px;
  padding: 8px 0 2px;
  color: var(--cj-muted);
  font-size: 12px;
  line-height: 1.4;
}

.cj-shell__status[hidden] {
  display: none;
}

.cj-shell__status.is-error {
  color: var(--cj-accent);
}

.cj-shell__retry {
  margin-left: 5px;
  padding: 0;
  color: currentcolor;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentcolor;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.cj-shell__composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 13px 16px calc(16px + env(safe-area-inset-bottom));
  margin: 12px;
  padding: 9px 10px;
  background: var(--cj-surface);
  border-top: 1px solid var(--cj-line);
  border: 1px solid var(--cj-line);
  border-radius: 16px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--cj-shadow) 5%, transparent);
}

.cj-shell__composer:focus-within {
  border-color: color-mix(in srgb, var(--cj-shadow) 62%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cj-shadow) 11%, transparent), 0 4px 16px color-mix(in srgb, var(--cj-shadow) 5%, transparent);
}

.cj-shell__input {
  min-height: 42px;
  max-height: 120px;
  padding: 10px 0;
  resize: vertical;
}

.cj-shell__voice,
.cj-shell__send {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
}

.cj-shell__voice {
  width: 42px;
  padding: 0;
  color: var(--cj-primary);
  background: var(--cj-line);
  border: 1px solid var(--cj-line);
  border-radius: 11px;
}

.cj-shell__voice-icon {
  width: 18px;
  height: 18px;
  fill: currentcolor;
}

.cj-shell__voice[data-state="listening"] {
  color: var(--cj-surface);
  background: var(--cj-secondary);
  border-color: var(--cj-secondary);
  animation: cj-shell-listening 1.15s ease-in-out infinite;
}

.cj-shell__send {
  min-width: 60px;
  padding: 0 14px;
  color: var(--cj-surface);
  background: linear-gradient(135deg, var(--cj-primary), var(--cj-primary));
  border-radius: 11px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--cj-shadow) 20%, transparent);
  font-size: 13px;
  font-weight: 850;
}

.cj-shell__send:hover:not(:disabled),
.cj-shell__send:focus-visible:not(:disabled),
.cj-shell__voice:hover:not(:disabled),
.cj-shell__voice:focus-visible:not(:disabled),
.cj-shell__speak:hover,
.cj-shell__speak:focus-visible {
  filter: brightness(1.1);
}

.cj-shell button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cj-shadow) 55%, transparent);
  outline-offset: 3px;
}

.cj-shell textarea:focus-visible {
  outline: 0;
}

.cj-shell :is(button, textarea):disabled {
  cursor: wait;
  opacity: .58;
}

@keyframes cj-shell-halo {
  to {
    filter: blur(16px); opacity:.45;
  }
}

@keyframes cj-shell-listening {
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--cj-shadow) 20%, transparent);
  }
}

@media (max-width: 700px) {
  .cj-shell__panel {
    width: min(72vw, 480px);
  }
}

@media (max-width: 640px) {
  .cj-shell__launcher {
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }

  .cj-shell__launcher-surface {
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 14px;
  }

  .cj-shell__launcher-copy {
    display: none;
  }

  .cj-shell__launcher-send {
    width: 45px;
    height: 45px;
  }

  .cj-shell__panel {
    width: 100vw;
    border-left: 0;
  }

  .cj-shell__header {
    min-height: 72px;
    padding: 15px 16px;
  }

  .cj-shell__messages {
    padding: 16px;
  }

  .cj-shell__status {
    margin-right: 16px;
    margin-left: 16px;
  }

  .cj-shell__composer {
    padding-right: 14px;
    padding-left: 14px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .cj-shell *,
  .cj-shell *::before,
  .cj-shell *::after {
    scroll-behavior: auto;
    transition-duration: .01ms;
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}

/* Scoped palette overrides keep the recovered dimensions and shell transitions. */
@property --cj-angle { syntax:"<angle>"; initial-value:0deg; inherits:false; }
@keyframes cj-border-turn { to { --cj-angle:360deg; } }
.cj-shell__launcher-glow,.cj-shell__launcher-glow::before {background:conic-gradient(from var(--cj-angle),var(--cj-stops)); animation:cj-border-turn 6s linear infinite;}
.cj-shell__launcher-glow {padding:2px;}
.cj-shell__launcher-glow::before {opacity:.56;}
.cj-shell__launcher-surface,.cj-shell__header,.cj-shell__composer {background:var(--cj-surface);}
.cj-shell__launcher-send,.cj-shell__send {background:var(--cj-button);color:var(--cj-button-text);}
.cj-shell__launcher-surface {grid-template-columns:auto minmax(0,1fr) auto;}
.cj-shell__launcher-copy {display:grid;place-items:center;width:26px;}
.cj-shell__launcher-copy img {width:24px;height:24px;object-fit:contain;}
.cj-shell__launcher-input::placeholder,.cj-shell__input::placeholder {color:var(--cj-muted);}
.cj-shell__message--visitor {background:var(--cj-user);color:var(--cj-user-text);}
.cj-shell__message--assistant {background:var(--cj-surface);color:var(--cj-ink);}
.cj-shell__panel {grid-template-rows:auto minmax(0,1fr) auto auto auto;width:var(--cj-drawer-width);}
.cj-shell__messages {margin:0;list-style:none;background:var(--cj-background);}
.cj-shell__composer {grid-template-columns:minmax(0,1fr) auto;align-items:center;}
.cj-shell__composer .cj-tools {display:flex;align-items:center;gap:4px;}
.cj-shell__status {margin:0 var(--cj-space);color:var(--cj-muted);}
.cj-shell__restart,.cj-shell__close {color:var(--cj-ink);}
.cj-shell__title {font-weight:var(--cj-weight);}
.cj-shell__composer,.cj-shell__message {border-radius:var(--cj-radius);border-style:var(--cj-border);}
.cj-shell .cj-follow {margin:0 var(--cj-space);color:var(--cj-muted);font-size:.8rem;}
.cj-chat .cj-lead {display:grid;gap:6px;padding:8px 0;}
.cj-chat .cj-lead input[type=email] {width:100%;box-sizing:border-box;}
.cj-chat .cj-lead button {background:var(--cj-button);color:var(--cj-button-text);border:0;border-radius:var(--cj-radius);padding:8px;}
.cj-chat [hidden] {display:none!important;}
.cj-chat .cj-sr {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
@media(max-width:700px){.cj-shell__panel{width:min(72vw,480px)}}
@media(max-width:640px){.cj-shell__panel{width:100vw}.cj-shell__launcher-copy{display:grid}.cj-shell__launcher-surface{grid-template-columns:auto minmax(0,1fr) auto}}
@media(prefers-reduced-motion:reduce){.cj-shell__launcher-glow,.cj-shell__launcher-glow::before{animation:none}}

.cj-chat[data-brand]:not([data-appearance-ready]){visibility:hidden}.cj-chat[data-brand]:not([data-appearance-ready]) *{visibility:inherit}

.cj-shell__composer,.cj-shell__message{border-width:1px;border-color:var(--cj-line)}
.cj-shell__message--visitor{border:0}
.cj-shell__title,.cj-front .cj-front__name,.cj-front .cj-front__headline,.cj-front .cj-front__team-title{font-family:var(--cj-heading-font,var(--cj-font));font-weight:var(--cj-weight)}
