.mascot-wrap {
  right: 18px;
  bottom: 98px;
  align-items: flex-end;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.mascot-assistant-panel {
  width: min(390px, calc(100vw - 92px));
  max-width: none;
  min-width: 310px;
  padding: 0;
  overflow: hidden;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  overscroll-behavior: contain;
}

/* The wrapper fades out when the assistant is closed.  Its panel deliberately
 * enables child hit targets while open, so explicitly disable those descendants
 * while hidden; otherwise an invisible text cursor remains over the canvas. */
.mascot-wrap:not(.visible) .mascot-assistant-panel,
.mascot-wrap:not(.visible) .mascot-assistant-panel * {
  pointer-events: none !important;
}

.fab-btn.mascot-launcher {
  width: 72px;
  height: 72px;
  right: 14px;
  bottom: 14px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  animation: mascotLauncherFloat 3.2s ease-in-out infinite;
}

.fab-btn.mascot-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.52);
}

.fab-btn.mascot-launcher:focus-visible {
  outline: 2px solid var(--indigo-70);
  outline-offset: 3px;
}

.mascot-launcher img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes mascotLauncherFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.mascot-assistant-header,
.mascot-assistant-toolbar,
.mascot-composer,
.mascot-quick-prompts {
  display: flex;
  align-items: center;
}

.mascot-assistant-header {
  justify-content: space-between;
  padding: 12px 14px 9px;
  border-bottom: 1px solid var(--stroke-default);
}

.mascot-assistant-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mascot-assistant-header strong {
  color: var(--text-primary);
  font-size: 13px;
}

.mascot-assistant-header span,
.mascot-assistant-toolbar span {
  color: var(--text-muted);
  font-size: 10px;
}

.mascot-assistant-header button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.mascot-assistant-toolbar {
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--white-02);
}

.mascot-model-menu {
  min-width: 214px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--stroke-default);
  border-radius: 10px;
  background: var(--bg-input);
}

.mascot-model-option {
  flex: 1 1 0;
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 8px;
  text-align: center;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.mascot-model-option:hover,
.mascot-model-option:focus-visible {
  outline: none;
  color: var(--text-primary);
  background: var(--white-05);
}

.mascot-model-option.is-selected {
  color: #fff;
  background: var(--indigo-gradient);
  box-shadow: 0 3px 10px rgba(92, 98, 255, 0.24);
}

.mascot-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 230px;
  overflow-y: auto;
  padding: 12px;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.mascot-message {
  max-width: 88%;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: var(--text-cursor) !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.mascot-message-content {
  cursor: var(--text-cursor) !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.mascot-message-content[contenteditable='true'] {
  outline: none;
  caret-color: transparent;
}

.mascot-message-copy {
  display: block;
  margin: 6px 0 0 auto;
  padding: 2px 5px;
  border: 0;
  border-radius: 5px;
  color: var(--text-muted);
  background: transparent;
  font-size: 9px;
  cursor: var(--link-cursor);
}

.mascot-message-copy:hover,
.mascot-message-copy:focus-visible {
  color: var(--text-primary);
  background: var(--white-08);
  outline: none;
}

.mascot-message.is-assistant {
  align-self: flex-start;
  background: var(--white-05);
  border: 1px solid var(--stroke-default);
}

.mascot-message.is-user {
  align-self: flex-end;
  background: var(--indigo-30);
  border: 1px solid var(--indigo-45);
}

.mascot-quick-prompts {
  gap: 6px;
  padding: 0 12px 9px;
}

.mascot-quick-prompts button {
  border: 1px solid var(--stroke-default);
  border-radius: 999px;
  background: var(--white-05);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px 9px;
  font-size: 10px;
}

.mascot-composer {
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--stroke-default);
}

.mascot-composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--stroke-default);
  border-radius: 9px;
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 8px 9px;
  font: inherit;
  font-size: 12px;
}

.mascot-composer textarea:focus {
  border-color: var(--indigo-70);
}

.mascot-composer button {
  height: 34px;
  min-width: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--indigo-gradient);
  color: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.mascot-composer button:disabled,
.mascot-quick-prompts button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .mascot-wrap {
    right: 12px;
    bottom: 92px;
  }

  .mascot-assistant-panel {
    width: calc(100vw - 24px);
    min-width: 0;
  }
}
