.muse-assistant {
  position: fixed;
  right: 24px;
  bottom: 104px;
  z-index: 99997;
  touch-action: none;
  --muse-panel-bg: linear-gradient(180deg, rgba(255, 252, 246, 0.82), rgba(244, 250, 239, 0.72));
  --muse-panel-border: rgba(255, 255, 255, 0.56);
  --muse-panel-shadow: 0 32px 90px rgba(94, 120, 80, 0.18), 0 12px 34px rgba(181, 137, 128, 0.12);
  --muse-text-1: #5d5846;
  --muse-text-2: #8f8b73;
  --muse-launcher-tilt: 0deg;
  --muse-panel-portrait: url("/img/muse/muse_15.png");
  --muse-emotion-shift-x: -8px;
  --muse-tip-overlap: -26px;
  --muse-tip-left-gap: 4px;
}

.muse-launcher {
  position: relative;
  width: 108px;
  height: 102px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: transform 0.24s cubic-bezier(0.22, 1.4, 0.36, 1), filter 0.24s ease;
  overflow: visible;
}

.muse-launcher-hitbox {
  position: absolute;
  inset: -10px -26px -12px -14px;
  background: transparent;
}

.muse-launcher:active {
  transform: scale(0.94);
}

.muse-assistant.is-open .muse-launcher {
  transform: scale(0.96);
}

.muse-assistant.is-docked-left:not(.is-open):not(.is-dragging) .muse-launcher {
  transform: translateX(-20px) scale(0.98);
}

.muse-assistant.is-docked-left:not(.is-open):hover .muse-launcher {
  transform: translateX(0) translateY(-3px) scale(1.03);
}

.muse-assistant:not(.is-open):not(.is-dragging):not(.is-docked-left) .muse-launcher:hover {
  transform: translateY(-3px) scale(1.03);
}

.muse-assistant.is-docking .muse-launcher,
.muse-assistant.is-dragging .muse-launcher {
  transition-duration: 0.18s;
}

.muse-launcher-glow,
.muse-launcher-ring,
.muse-launcher-stage,
.muse-launcher-aura,
.muse-orbit-ring,
.muse-orbit-star {
  display: none;
}

.muse-emotion {
  position: absolute;
  pointer-events: none;
}

.muse-emotion {
  left: 50%;
  bottom: -2px;
  width: 102px;
  height: 102px;
  object-fit: contain;
  opacity: 0;
  transform: translateX(calc(-50% + var(--muse-emotion-shift-x))) translateY(2px) rotate(var(--muse-launcher-tilt)) scale(0.94);
  transform-origin: 50% 100%;
  transition: opacity 0.34s ease, transform 0.42s cubic-bezier(0.22, 1.15, 0.36, 1);
  filter: drop-shadow(0 12px 18px rgba(53, 64, 42, 0.18));
  animation: musePetSway 5.2s ease-in-out infinite;
}

.muse-emotion.is-visible {
  opacity: 1;
  transform: translateX(calc(-50% + var(--muse-emotion-shift-x))) translateY(0) rotate(var(--muse-launcher-tilt)) scale(1);
}

.muse-assistant.is-bouncing .muse-emotion.is-visible {
  animation: musePetBounce 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.muse-tip-bubble {
  position: absolute;
  top: 18px;
  width: max-content;
  min-width: 108px;
  max-width: 164px;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(255, 253, 246, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 14px 28px rgba(104, 120, 75, 0.14);
  color: #66724a;
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.muse-tip-text {
  display: block;
  min-height: 1.4em;
}

.muse-tip-bubble.is-typing .muse-tip-text::after {
  content: "";
  display: inline-block;
  width: 0.48em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.08em;
  border-right: 2px solid rgba(112, 122, 78, 0.72);
  animation: museTipCaret 0.8s steps(1) infinite;
}

.muse-tip-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  transform: rotate(-45deg);
}

.muse-assistant:not(.is-docked-left) .muse-tip-bubble {
  right: calc(100% + var(--muse-tip-overlap));
}

.muse-assistant:not(.is-docked-left) .muse-tip-bubble::after {
  right: -5px;
}

.muse-assistant.is-docked-left .muse-tip-bubble {
  left: calc(100% + var(--muse-tip-left-gap));
}

.muse-assistant.is-docked-left .muse-tip-bubble::after {
  left: -5px;
  transform: rotate(135deg);
}

.muse-assistant.show-tip .muse-tip-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.muse-launcher-badge {
  position: absolute;
  top: 10px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff7db8, #ff9f82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(255, 113, 170, 0.34);
  opacity: 0;
  transform: translateY(-4px) scale(0.8);
  transition: opacity 0.22s ease, transform 0.24s ease;
  pointer-events: none;
}

.muse-assistant.has-unread .muse-launcher-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.muse-assistant.has-unread .muse-emotion.is-visible {
  filter:
    drop-shadow(0 0 10px rgba(230, 255, 165, 0.5))
    drop-shadow(0 12px 18px rgba(53, 64, 42, 0.18));
}

.muse-panel {
  position: absolute;
  width: min(384px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 32px;
  overflow: hidden;
  background: var(--muse-panel-bg);
  border: 1px solid var(--muse-panel-border);
  box-shadow: var(--muse-panel-shadow);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.86);
  transform-origin: 84% 100%;
  transition:
    opacity 0.24s ease,
    transform 0.38s cubic-bezier(0.18, 1.2, 0.36, 1),
    box-shadow 0.28s ease;
}

.muse-panel::before,
.muse-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.muse-panel::before {
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 84% 18%, rgba(208, 234, 184, 0.28), rgba(208, 234, 184, 0) 34%),
    radial-gradient(circle at 78% 82%, rgba(255, 190, 202, 0.24), rgba(255, 190, 202, 0) 28%),
    var(--muse-panel-portrait);
  background-repeat: no-repeat;
  background-size: auto, auto, auto, 58px auto;
  background-position: 0 0, 0 0, 0 0, right 88px bottom 22px;
  opacity: 0.88;
}

.muse-panel::after {
  inset: 1px;
  border-radius: 31px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.muse-assistant.is-open .muse-panel {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.muse-assistant.is-panel-below .muse-panel {
  transform-origin: 84% 0%;
}

.muse-assistant.is-panel-shift-right .muse-panel {
  transform-origin: 16% 100%;
}

.muse-assistant.is-panel-below.is-panel-shift-right .muse-panel {
  transform-origin: 16% 0%;
}

.muse-panel-head,
.muse-panel > * {
  position: relative;
  z-index: 1;
}

.muse-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.muse-assistant.is-dragging .muse-panel-head,
.muse-assistant.is-dragging .muse-launcher {
  cursor: grabbing;
}

.muse-panel-avatar {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
}

.muse-avatar-ring {
  display: none;
}

.muse-panel-portrait {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(126, 143, 94, 0.14));
}

.muse-panel-meta {
  min-width: 0;
}

.muse-panel-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--muse-text-1);
}

.muse-panel-subtitle {
  font-size: 0.82rem;
  color: var(--muse-text-2);
}

.muse-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.32);
  color: #7684a3;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s ease, transform 0.2s ease;
  position: relative;
  z-index: 4;
}

.muse-close:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.46);
}

.muse-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 4px 0 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(146, 151, 255, 0.4) transparent;
  user-select: text;
  -webkit-user-select: text;
}

.muse-messages::-webkit-scrollbar {
  width: 6px;
}

.muse-messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(146, 151, 255, 0.38);
}

.muse-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
}

.muse-message.is-user {
  align-self: flex-end;
}

.muse-message.is-assistant,
.muse-message.is-status {
  align-self: flex-start;
}

.muse-bubble {
  max-width: 92%;
  padding: 13px 15px;
  border-radius: 22px;
  line-height: 1.72;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.muse-bubble.is-assistant {
  color: #5f5a46;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(247, 252, 239, 0.74));
  border: 1px solid rgba(219, 235, 197, 0.42);
  box-shadow: 0 12px 28px rgba(125, 136, 93, 0.08);
}

.muse-bubble.is-user {
  color: #fff;
  background: linear-gradient(135deg, rgba(180, 214, 116, 0.96), rgba(158, 188, 104, 0.94), rgba(255, 171, 179, 0.88));
  box-shadow: 0 14px 30px rgba(166, 177, 110, 0.18);
}

.muse-bubble.is-status {
  color: #667493;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.82rem;
}

.muse-bubble-actions {
  display: flex;
  justify-content: flex-start;
  padding-left: 4px;
}

.muse-copy-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.72rem;
  line-height: 1;
  color: #6d7852;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 6px 16px rgba(149, 165, 110, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  user-select: none;
}

.muse-copy-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.86);
  color: #5f6b44;
}

.muse-bubble.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.52em;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  border-right: 2px solid rgba(118, 108, 224, 0.8);
  animation: museCaretBlink 0.8s steps(1) infinite;
}

.muse-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.muse-quick-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.79rem;
  color: #6d6a51;
  background: linear-gradient(135deg, rgba(228, 240, 203, 0.72), rgba(255, 243, 225, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.muse-quick-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(223, 238, 188, 0.9), rgba(255, 238, 212, 0.78));
  box-shadow: 0 10px 20px rgba(158, 169, 106, 0.12);
}

.muse-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.muse-input {
  flex: 1;
  min-height: 56px;
  max-height: 120px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(193, 208, 171, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(248, 252, 241, 0.34));
  resize: none;
  outline: none;
  color: #625f4b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 10px 20px rgba(134, 146, 105, 0.08);
}

.muse-input::placeholder {
  color: rgba(107, 108, 86, 0.72);
}

.muse-input:focus {
  border-color: rgba(166, 191, 122, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 0 0 4px rgba(182, 214, 136, 0.16),
    0 12px 22px rgba(131, 147, 102, 0.08);
}

.muse-send {
  flex: 0 0 auto;
  min-width: 76px;
  height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(135deg, #c6e58f, #a8d676, #f4b4bf);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(161, 181, 109, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.muse-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(161, 181, 109, 0.32);
}

.muse-send:disabled {
  cursor: wait;
  opacity: 0.82;
}

[data-user-color-scheme="dark"] .muse-assistant {
  --muse-panel-bg: linear-gradient(180deg, rgba(27, 34, 23, 0.84), rgba(24, 29, 21, 0.74));
  --muse-panel-border: rgba(195, 218, 158, 0.12);
  --muse-panel-shadow: 0 30px 90px rgba(6, 10, 5, 0.62), 0 0 48px rgba(167, 197, 110, 0.12);
  --muse-text-1: #eef5ff;
  --muse-text-2: rgba(223, 232, 211, 0.7);
}

[data-user-color-scheme="dark"] .muse-close {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(233, 238, 248, 0.82);
}

[data-user-color-scheme="dark"] .muse-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

[data-user-color-scheme="dark"] .muse-bubble.is-assistant,
[data-user-color-scheme="dark"] .muse-bubble.is-status {
  color: rgba(232, 239, 249, 0.92);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(180, 216, 132, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-user-color-scheme="dark"] .muse-quick-btn {
  color: #e6edd9;
  background: linear-gradient(135deg, rgba(141, 171, 89, 0.24), rgba(255, 198, 208, 0.12));
}

[data-user-color-scheme="dark"] .muse-input {
  color: #eff4ff;
  border-color: rgba(176, 205, 133, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-user-color-scheme="dark"] .muse-input::placeholder {
  color: rgba(226, 231, 244, 0.54);
}

[data-user-color-scheme="dark"] .muse-copy-btn {
  color: #e0ebcc;
  background: rgba(255, 255, 255, 0.08);
}

[data-user-color-scheme="dark"] .muse-tip-bubble {
  background: rgba(31, 39, 27, 0.82);
  border-color: rgba(196, 221, 159, 0.16);
  box-shadow: 0 14px 28px rgba(7, 10, 7, 0.28);
  color: rgba(232, 239, 221, 0.88);
}

[data-user-color-scheme="dark"] .muse-tip-bubble::after {
  border-right-color: rgba(196, 221, 159, 0.16);
  border-bottom-color: rgba(196, 221, 159, 0.16);
}

[data-user-color-scheme="dark"] .muse-tip-bubble.is-typing .muse-tip-text::after {
  border-right-color: rgba(220, 233, 197, 0.72);
}

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

@keyframes musePetSway {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

@keyframes musePetBounce {
  0% {
    transform: translateX(calc(-50% + var(--muse-emotion-shift-x))) translateY(0) rotate(var(--muse-launcher-tilt)) scale(1);
  }
  35% {
    transform: translateX(calc(-50% + var(--muse-emotion-shift-x))) translateY(-8px) rotate(calc(var(--muse-launcher-tilt) * 0.7)) scale(1.04);
  }
  65% {
    transform: translateX(calc(-50% + var(--muse-emotion-shift-x))) translateY(0) rotate(calc(var(--muse-launcher-tilt) * 1.05)) scale(0.98);
  }
  100% {
    transform: translateX(calc(-50% + var(--muse-emotion-shift-x))) translateY(0) rotate(var(--muse-launcher-tilt)) scale(1);
  }
}

@keyframes museCaretBlink {
  0%, 50% {
    opacity: 1;
  }
  50.01%, 100% {
    opacity: 0;
  }
}

@keyframes museTipCaret {
  0%, 50% {
    opacity: 1;
  }
  50.01%, 100% {
    opacity: 0;
  }
}

@media (max-width: 576px) {
  .muse-assistant {
    right: 16px;
    bottom: 88px;
  }

  .muse-launcher {
    width: 96px;
    height: 90px;
  }

  .muse-launcher-hitbox {
    inset: -8px -20px -10px -10px;
  }

  .muse-assistant.is-docked-left:not(.is-open):not(.is-dragging) .muse-launcher {
    transform: translateX(-16px) scale(0.98);
  }

  .muse-assistant {
    --muse-emotion-shift-x: -6px;
    --muse-tip-overlap: -18px;
    --muse-tip-left-gap: 3px;
  }

  .muse-panel {
    width: min(356px, calc(100vw - 24px));
    height: min(74vh, calc(100vh - 24px));
    padding: 16px;
  }

  .muse-emotion {
    width: 90px;
    height: 90px;
  }

  .muse-tip-bubble {
    min-width: 96px;
    max-width: 136px;
    padding: 8px 10px;
    font-size: 0.72rem;
    top: 14px;
  }

  .muse-assistant:not(.is-docked-left) .muse-tip-bubble {
    right: calc(100% + var(--muse-tip-overlap));
  }

  .muse-assistant.is-docked-left .muse-tip-bubble {
    left: calc(100% + var(--muse-tip-left-gap));
  }






  .muse-form {
    gap: 10px;
  }

  .muse-send {
    min-width: 72px;
  }
}
