/* ChatHiro illustration — scoped, GPU-friendly SVG animations, zero dependencies. */
.chathiro-chat-illustration {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  max-width: 860px;
  isolation: isolate;
  /* Do not filter the full SVG: Chromium may composite the entire SVG,
     including selectable HTML text, as a temporarily blurry bitmap. */
}

/* Shadow only the stationary window shape so text remains crisp during motion. */
.chathiro-chat-illustration .chathiro-scene > path:first-of-type {
  filter: drop-shadow(0 12px 19px rgba(97, 89, 213, .11));
}

.chathiro-chat-illustration .chathiro-scene,
.chathiro-chat-illustration .chathiro-stage,
.chathiro-chat-illustration .chathiro-typing {
  transform-box: fill-box;
  transform-origin: center;
}

.chathiro-chat-illustration .chathiro-star,
.chathiro-chat-illustration .chathiro-dot,
.chathiro-chat-illustration .chathiro-send-arrow,
.chathiro-chat-illustration .chathiro-online-status,
.chathiro-chat-illustration .chathiro-progress {
  transform-box: fill-box;
  transform-origin: center;
}

/* Full-scene looping story. Avoid scaling the containing SVG or text-heavy
   groups: animated scale + root filters can rasterize foreignObject HTML text. */
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-scene {
  animation: chathiro-scene-cycle var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-incoming-one {
  animation: chathiro-incoming-one var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-ai-message,
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-ai-avatar {
  animation: chathiro-ai-enter var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-incoming-two {
  animation: chathiro-incoming-two var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-suggested {
  animation: chathiro-suggested var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-sentiment {
  animation: chathiro-sentiment var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-metric {
  animation: chathiro-metric var(--chathiro-cycle, 12000ms) ease-in-out infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-typing {
  animation: chathiro-typing-loop var(--chathiro-cycle, 12000ms) linear infinite both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="true"] .chathiro-progress {
  animation: chathiro-progress-loop var(--chathiro-cycle, 12000ms) cubic-bezier(.2,.8,.2,1) infinite both;
  transform-origin: left center;
}

/* One-shot mode has individually delayed animations and ends in the finished SVG. */
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-scene {
  animation: chathiro-once-in 850ms cubic-bezier(.19,1,.22,1) both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-incoming-one {
  animation: chathiro-once-left 670ms cubic-bezier(.16,1,.3,1) 600ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-ai-message,
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-ai-avatar {
  animation: chathiro-once-right 710ms cubic-bezier(.16,1,.3,1) 2850ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-incoming-two {
  animation: chathiro-once-left 650ms cubic-bezier(.16,1,.3,1) 4500ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-suggested {
  animation: chathiro-once-up 730ms cubic-bezier(.16,1,.3,1) 5750ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-sentiment {
  animation: chathiro-once-pop 680ms cubic-bezier(.16,1,.3,1) 6450ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-metric {
  animation: chathiro-once-pop 680ms cubic-bezier(.16,1,.3,1) 6850ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-typing {
  animation: chathiro-typing-once 1570ms ease-in-out 1450ms both;
}
.chathiro-chat-illustration[data-play="true"][data-loop="false"] .chathiro-progress {
  animation: chathiro-once-progress 920ms cubic-bezier(.16,1,.3,1) 7050ms both;
  transform-origin: left center;
}

/* The dots, presence status and send icon provide quiet, continuous micro-motion. */
.chathiro-chat-illustration[data-play="true"] .chathiro-dot {
  animation: chathiro-dot-bounce 760ms ease-in-out infinite alternate;
}
.chathiro-chat-illustration[data-play="true"] .chathiro-dot-2 { animation-delay: 130ms; }
.chathiro-chat-illustration[data-play="true"] .chathiro-dot-3 { animation-delay: 260ms; }
.chathiro-chat-illustration[data-play="true"] .chathiro-online-status {
  animation: chathiro-presence 2900ms ease-in-out infinite;
}
.chathiro-chat-illustration[data-play="true"] .chathiro-send-arrow {
  animation: chathiro-send 2800ms ease-in-out infinite;
}
.chathiro-chat-illustration[data-play="true"] .chathiro-star {
  animation: chathiro-star-shine 3600ms ease-in-out infinite;
}
.chathiro-chat-illustration[data-play="true"] .chathiro-star-2 { animation-delay: -450ms; }
.chathiro-chat-illustration[data-play="true"] .chathiro-star-3 { animation-delay: -900ms; }
.chathiro-chat-illustration[data-play="true"] .chathiro-star-4 { animation-delay: -1350ms; }
.chathiro-chat-illustration[data-play="true"] .chathiro-star-5 { animation-delay: -1800ms; }

@keyframes chathiro-scene-cycle {
  0%    { opacity: 0; }
  7%, 92% { opacity: 1; }
  100%  { opacity: 0; }
}
@keyframes chathiro-incoming-one {
  0%, 9% { opacity: 0; transform: translate(-12px,12px); }
  15%, 92% { opacity: 1; transform: translate(0,0); }
  100% { opacity: 0; transform: translateY(5px); }
}
@keyframes chathiro-ai-enter {
  0%, 28% { opacity: 0; transform: translate(15px,10px); }
  35%, 92% { opacity: 1; transform: translate(0,0); }
  100% { opacity: 0; transform: translateY(4px); }
}
@keyframes chathiro-incoming-two {
  0%, 43% { opacity: 0; transform: translate(-14px,10px); }
  50%, 92% { opacity: 1; transform: translate(0,0); }
  100% { opacity: 0; transform: translateY(4px); }
}
@keyframes chathiro-suggested {
  0%, 56% { opacity: 0; transform: translateY(16px); }
  64%, 92% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(5px); }
}
@keyframes chathiro-sentiment {
  0%, 64% { opacity: 0; transform: translate(12px,-9px); }
  71%, 92% { opacity: 1; transform: translate(0,0); }
  100% { opacity: 0; transform: translateY(5px); }
}
@keyframes chathiro-metric {
  0%, 70% { opacity: 0; transform: translate(-13px,8px); }
  77%, 92% { opacity: 1; transform: translate(0,0); }
  100% { opacity: 0; transform: translateY(5px); }
}
@keyframes chathiro-typing-loop {
  0%, 17%  { opacity: 0; transform: translateY(5px); }
  20%, 26% { opacity: 1; transform: translateY(0); }
  29%, 100% { opacity: 0; transform: translateY(-2px); }
}
@keyframes chathiro-progress-loop {
  0%, 75% { transform: scaleX(0); }
  85%, 100% { transform: scaleX(1); }
}
@keyframes chathiro-typing-once {
  0%, 11% { opacity: 0; transform: translateY(5px); }
  21%, 70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes chathiro-once-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes chathiro-once-left {
  from { opacity: 0; transform: translate(-18px,12px); }
  to { opacity: 1; transform: translate(0,0); }
}
@keyframes chathiro-once-right {
  from { opacity: 0; transform: translate(15px,12px); }
  to { opacity: 1; transform: translate(0,0); }
}
@keyframes chathiro-once-up {
  from { opacity: 0; transform: translateY(17px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes chathiro-once-pop {
  0% { opacity: 0; transform: translateY(13px); }
  70% { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes chathiro-once-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes chathiro-dot-bounce {
  0%, 30% { opacity: .5; transform: translateY(2px); }
  75%, 100% { opacity: 1; transform: translateY(-2px); }
}
@keyframes chathiro-presence {
  0%, 100% { opacity: 1; transform: none; }
  50% { opacity: .8; transform: none; }
}
@keyframes chathiro-send {
  0%, 78%, 100% { transform: translateX(0); }
  83% { transform: translateX(2px); }
  89% { transform: translateX(0); }
}
@keyframes chathiro-star-shine {
  0%, 70%, 100% { opacity: 1; transform: none; }
  83% { opacity: .83; transform: none; }
}

/* Motion preferences are honored even if play=true. The complete original design
   remains visible with no accidental hidden messages in reduced-motion mode. */
@media (prefers-reduced-motion: reduce) {
  .chathiro-chat-illustration *,
  .chathiro-chat-illustration *::before,
  .chathiro-chat-illustration *::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .chathiro-chat-illustration .chathiro-typing { display: none !important; }
}
.chathiro-chat-illustration[data-play="false"] *,
.chathiro-chat-illustration[data-play="false"] *::before,
.chathiro-chat-illustration[data-play="false"] *::after {
  animation: none !important;
}
.chathiro-chat-illustration[data-play="false"] .chathiro-typing { display: none; }

/* Real HTML text embedded inside the original SVG. User can select and copy it. */
.chathiro-chat-illustration .ch-text {
  box-sizing: border-box;
  color: var(--ink);
  font-family: Inter, "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 13.5px;
  line-height: 1.37;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  text-align: left;
  white-space: normal;
}
.chathiro-chat-illustration .ch-text::selection,
.chathiro-chat-illustration .ch-input::selection { background: #cdc7ff; color: var(--foreground); }
.chathiro-chat-illustration .ch-url { font-size: 12.8px; line-height: 17px; text-align: center; color: var(--foreground); }
.chathiro-chat-illustration .ch-agent { font-size: 17px; font-weight: 500; line-height: 21px; letter-spacing: -.35px; }
.chathiro-chat-illustration .ch-muted { font-size: 13.5px; color: #6b7280; line-height: 18px; }
.chathiro-chat-illustration .ch-bubble { font-size: 13.1px; line-height: 18px; }
.chathiro-chat-illustration .ch-last { font-size: 13px; line-height: 18px; max-height: 35px; overflow: hidden; overflow-wrap: anywhere; }
.chathiro-chat-illustration .ch-ai-body { color: #fff; font-size: 13.2px; line-height: 18px; }
.chathiro-chat-illustration .ch-line-gap { display: block; height: 0px; }
.chathiro-chat-illustration .ch-see-more { display: block; color: white; text-decoration: underline; margin-top: 0px; }
.chathiro-chat-illustration .ch-ai-label { color: #fff; font-size: 13px; font-weight: 500; line-height: 17px; }
.chathiro-chat-illustration .ch-suggestion-heading { color:#5546ee; font-size:13.1px; font-weight:500; line-height:18px; }
.chathiro-chat-illustration .ch-suggestion-body { font-size:13.1px; line-height:17.5px; }
.chathiro-chat-illustration .ch-panel-title { font-size:15.8px; color:var(--ink); font-weight:500; line-height:20px; letter-spacing:-.24px; }
.chathiro-chat-illustration .ch-panel-caption { color:#6b7280; font-size:11.4px; line-height:16px; }
.chathiro-chat-illustration .ch-metric-title { font-size:14.6px; letter-spacing:-.45px; }
.chathiro-chat-illustration .ch-message-field { overflow: visible; }
.chathiro-chat-illustration .ch-input {
  display: block; width:100%; height:100%; box-sizing:border-box;
  padding:0 5px; margin:0; border:0; border-radius:4px;
  background: transparent; outline: none; box-shadow:none;
  font: 13.2px/20px Inter,"DM Sans",ui-sans-serif,system-ui,sans-serif;
  color:var(--ink); user-select:text; -webkit-user-select:text;
}
.chathiro-chat-illustration .ch-input::placeholder {color:#6b7280; opacity:1;}
.chathiro-chat-illustration .ch-input:focus-visible {outline:2px solid #aa9aff;outline-offset:2px;}
.chathiro-chat-illustration .ch-send-button {
  appearance:none; display:block; width:100%; height:100%;
  background: transparent; border:0; border-radius:6px;
  padding:0; cursor:pointer;
}
.chathiro-chat-illustration .ch-send-button:hover {background: rgba(255,255,255,.12)}
.chathiro-chat-illustration .ch-send-button:focus-visible {outline:2px solid #a89aff;outline-offset:3px}
/* Keep text and form controls clickable even while the surrounding scene animates. */
.chathiro-chat-illustration foreignObject {pointer-events:auto;}
