.zs-creation-assistant {
  --zsca-purple: #6234c7;
  --zsca-ink: #29223a;
  --zsca-muted: #6b617d;
  --zsca-line: #e9e2f2;
  position: fixed;
  z-index: 45;
  inset: 0 auto auto 0;
  width: max-content;
  font-size: 13px;
  line-height: 1.5;
  color: var(--zsca-ink);
}
.zs-creation-assistant [hidden], .zs-creation-assistant[hidden] { display: none !important; }
.zs-creation-assistant button { font: inherit; cursor: pointer; }
.zs-creation-assistant :is(button,textarea,[tabindex]):focus-visible { outline: 2px solid #8a62e2; outline-offset: 2px; }
.zs-creation-assistant .zsca-launch {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid #ab8bf2;
  border-radius: 20px;
  background: linear-gradient(145deg,#9665f2,#6130cd 70%);
  box-shadow: 0 7px 23px #4f2b9e40, inset 0 1px 0 #ffffff78;
  color: #fff;
  transition: box-shadow .15s;
}
.zs-creation-assistant .zsca-launch:hover { box-shadow: 0 9px 24px #4f2b9e68, inset 0 1px 0 #ffffff78; }
.zsca-logo {
  position: relative;
  display: block;
  flex: none;
  width: 31px;
  height: 24px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #ffffff24;
}
.zsca-logo::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  width: 9px;
  height: 9px;
  background: #fff;
  clip-path: polygon(0 0,100% 50%,0 100%);
}
.zsca-logo::after {
  content: "";
  position: absolute;
  right: -6px;
  top: -7px;
  width: 12px;
  height: 12px;
  background: #eee2ff;
  clip-path: polygon(50% 0,63% 36%,100% 50%,63% 64%,50% 100%,37% 64%,0 50%,37% 36%);
}
.zsca-panel {
  display: flex;
  flex-direction: column;
  width: min(390px, calc(var(--zsca-viewport-width,100vw) - 20px));
  height: min(550px, calc(var(--zsca-viewport-height,100dvh) - 28px));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--zsca-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 52px #24113b33,0 2px 7px #35205314;
}
.zs-creation-assistant.is-switching .zsca-launch {
  position: absolute;
  z-index: 1;
  top: var(--zsca-anchor-y, 0px);
  left: var(--zsca-anchor-x, 0px);
}
.zsca-panel-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.zsca-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--zsca-line);
  background: linear-gradient(125deg,#f6efff,#fcfaff 75%);
}
.zsca-drag-handle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-radius: 6px;
}
.zsca-drag-handle,.zs-creation-assistant .zsca-launch { touch-action: none; user-select: none; cursor: grab; }
.zs-creation-assistant.is-dragging :is(.zsca-drag-handle,.zsca-launch) { cursor: grabbing; }
.zsca-head-icon {
  flex: none;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg,#9b6af3,#6938cf);
}
.zsca-head-icon .zsca-logo { transform: scale(.64); }
.zsca-head-title { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 700; }
.zsca-context { color: var(--zsca-muted); font-size: 11px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zsca-labels { min-width: 0; }
.zsca-actions { display: flex; flex: none; gap: 4px; }
.zsca-actions button {
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--zsca-muted);
  font-size: 12px;
}
.zsca-actions button:last-child { min-width: 33px; font-size: 18px; }
.zsca-actions button:hover { background: #efe7fc; border-color: var(--zsca-line); color: var(--zsca-purple); }
.zsca-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 15px 14px; }
.zsca-welcome { padding: 6px 2px; }
.zsca-welcome p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.zsca-suggestions { display: grid; justify-items: start; gap: 7px; }
.zsca-suggestions button {
  max-width: 100%;
  text-align: left;
  padding: 7px 11px;
  border: 1px solid #e5dbf5;
  border-radius: 9px;
  color: #572c9d;
  background: #faf7ff;
}
.zsca-suggestions button:hover { background: #f1e7ff; border-color: #bd9eea; }
.zsca-messages { display: grid; gap: 12px; align-content: start; }
.zsca-message { max-width: 92%; min-width: 0; justify-self: start; }
.zsca-message[data-role="user"] { justify-self: end; }
.zsca-message p {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #eee8f5;
  border-radius: 11px;
  background: #f8f6fb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.zsca-message[data-role="user"] p { background: #f0e8ff; color: #3e2866; border-color: #e7d9fa; }
.zsca-copy {
  margin-top: 3px;
  padding: 3px 5px;
  color: var(--zsca-muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
}
.zsca-copy:hover { color: var(--zsca-purple); background: #f4edff; }
.zsca-feedback { margin-top: 10px; color: var(--zsca-muted); font-size: 12px; }
.zsca-feedback[data-error="true"] { color: #a23551; }
.zsca-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 7px;
  min-width: 0;
  padding: 9px 11px;
  border-top: 1px solid var(--zsca-line);
}
.zsca-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 45px;
  max-height: 104px;
  resize: none;
  border: 1px solid var(--zsca-line);
  border-radius: 9px;
  padding: 8px 9px;
  font: inherit;
  line-height: 1.4;
  color: inherit;
  background: #fcfaff;
}
.zsca-send {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--zsca-purple);
  border-radius: 9px;
  background: var(--zsca-purple);
  color: #fff;
}
.zsca-send:disabled { opacity: .55; cursor: default; }
@media (max-width: 520px) {
  .zsca-form textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .zs-creation-assistant .zsca-launch { transition: none; }
}

.zsca-tip {
  --zsca-tip-tail: 50%;
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  width: min(254px, calc(var(--zsca-viewport-width, 100vw) - 20px));
  box-sizing: border-box;
  border: 1px solid #ded1f3;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 28px #39215f23;
  animation: zsca-tip-in .18s ease-out both;
}
.zsca-tip::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: solid #ded1f3;
  border-width: 1px 1px 0 0;
  pointer-events: none;
}
.zsca-tip[data-side="left"]::after { top: var(--zsca-tip-tail); right: 0; transform: translate(50%, -50%) rotate(45deg); }
.zsca-tip[data-side="right"]::after { top: var(--zsca-tip-tail); left: 0; transform: translate(-50%, -50%) rotate(225deg); }
.zsca-tip[data-side="above"]::after { left: var(--zsca-tip-tail); bottom: 0; transform: translate(-50%, 50%) rotate(135deg); }
.zsca-tip[data-side="below"]::after { left: var(--zsca-tip-tail); top: 0; transform: translate(-50%, -50%) rotate(-45deg); }
.zs-creation-assistant .zsca-tip-open {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 3px;
  padding: 10px 0 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--zsca-ink);
  text-align: left;
}
.zsca-tip-title { color: var(--zsca-purple); font-size: 12px; font-weight: 700; }
.zsca-tip-text { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.zs-creation-assistant .zsca-tip-close {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 4px 4px 0 2px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--zsca-muted);
  font-size: 18px;
  line-height: 1;
}
.zs-creation-assistant .zsca-tip-close:hover { background: #f3ecfd; color: var(--zsca-purple); }
.zsca-tip-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}
@keyframes zsca-tip-in {
  from { opacity: 0; scale: .98; }
  to { opacity: 1; scale: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .zsca-tip { animation: none; }
}
