.lx-lastmsg {
  max-width: 480px;
  margin: 0 auto;
  backdrop-filter: blur(12px);
  padding: 0 20px;
}

.lx-lastmsg__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 0;
}

.lx-lastmsg__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      var(--lx-color-neutral-700) 0%,
      var(--lx-color-neutral-900) 100%);
  border: 1px solid var(--lx-color-neutral-500);
  color: var(--lx-color-neutral-50);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--lx-shadow-sm);
}

.lx-lastmsg__play:hover {
  background: linear-gradient(135deg, #363636 0%, #262626 100%);
  border-color: #505050;
  transform: translateY(-2px);
  box-shadow: var(--lx-shadow-md);
}

.lx-lastmsg__play:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

.lx-lastmsg__play-icon {
  font-size: 24px !important;
  max-height: 24px;
  max-width: 24px;
  display: flex;
  align-items: center;
}

.lx-lastmsg__expand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  background: var(--lx-color-neutral-100);
  border: 1px solid var(--lx-color-neutral-300);
  color: var(--lx-color-neutral-600);
  border-radius: var(--lx-rounded-xl);
  font-size: var(--lx-text-sm);
  font-weight: var(--lx-font-medium);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  min-width: 150px;
  justify-content: center;
  box-shadow: var(--lx-shadow-xs);
}

.lx-lastmsg__expand:hover {
  background: var(--lx-color-neutral-200);
  border-color: var(--lx-color-neutral-400);
  color: var(--lx-color-neutral-700);
  transform: translateY(-1px);
  box-shadow: var(--lx-shadow-sm);
}

.lx-lastmsg__expand:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}

.lx-lastmsg__expand-icon {
  font-size: 18px !important;
  max-height: 18px;
  max-width: 18px;
  display: flex;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lx-lastmsg__expand--expanded .lx-lastmsg__expand-icon {
  transform: rotate(180deg);
}

.lx-lastmsg--locked .lx-lastmsg__expand {
  opacity: 0.4;
  pointer-events: none;
  transform: none;
}

.lx-lastmsg--locked .lx-lastmsg__expand-icon {
  transform: none !important;
}

.lx-lastmsg__transcript {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease,
    margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  margin-top: 0;
  border-radius: var(--lx-rounded-xl);
  border: 1px solid var(--lx-color-neutral-300);
  box-shadow: var(--lx-shadow-xs);
  background: white;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  min-width: 280px;
  max-width: 100%;
}

.lx-lastmsg__transcript--expanded {
  max-height: 160px;
  margin-top: 16px;
  opacity: 1;
}

.lx-lastmsg__transcript-content {
  overflow-y: auto;
  padding: 16px 20px;
  transition: opacity 0.3s ease, max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 280px;

  /* Always reserve space for scrollbar */
  scrollbar-width: thin;
  /* Firefox */
}

/* WebKit: minimal modern scrollbar */
.lx-lastmsg__transcript-content::-webkit-scrollbar {
  width: 2px;
  background: transparent;
}

/* Hide thumb by default */
.lx-lastmsg__transcript-content::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px;
  transition: background 0.2s ease;
}

/* Show thumb on hover - darker and more visible */
.lx-lastmsg__transcript-content:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.4);
}

/* Track style - transparent for minimal look */
.lx-lastmsg__transcript-content::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

/* Thumb hover style - even darker */
.lx-lastmsg__transcript-content:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Firefox: minimal modern scrollbar with darker color */
.lx-lastmsg__transcript-content {
  scrollbar-color: transparent transparent;
}

.lx-lastmsg__transcript-content:hover {
  scrollbar-color: rgba(0, 0, 0, 0.4) transparent;
}

.lx-lastmsg__transcript-content * {
  font-size: var(--lx-text-sm);
  color: var(--lx-color-neutral-600);
  line-height: 1.5;
  margin: 0;
  font-weight: var(--lx-font-normal);
}

@media (max-width: 640px) {
  .lx-lastmsg {
    padding: 0 16px;
  }

  .lx-lastmsg__header {
    gap: 10px;
    flex-wrap: wrap;
  }

  .lx-lastmsg__play {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .lx-lastmsg__expand {
    height: 40px;
    padding: 0 14px;
    font-size: var(--lx-text-xs);
    min-width: 140px;
  }

  .lx-lastmsg__transcript {
    min-width: 240px;
  }

  .lx-lastmsg__transcript-content {
    padding: 14px 16px;
    font-size: var(--lx-text-xs);
    min-width: 240px;
    max-height: 100px;
  }

  .lx-lastmsg__transcript--expanded {
    max-height: 140px;
  }
}

.lx-ai-question {
  font-weight: var(--lx-font-semibold);
  font-style: italic;
}