.chiroai-widget-container {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 1rem 0;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Ensure block stays at the beginning of chat history */
  order: -1;
  flex-shrink: 0;
}

/* Ensure the block container is positioned at the start */
.mwai-conversation .chiroai-widget-container {
  order: -1;
}

/* If blocks are rendered in a different container, ensure our block is first */
.mwai-message:has(.chiroai-widget-container),
.mwai-reply:has(.chiroai-widget-container) {
  order: -1;
}

.chiroai-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chiroai-avatar {
  width: 36px;
  height: 36px;
  /* border-radius: 999px; */
  /* background: radial-gradient(circle at 30% 20%, #e879f9 0, #a855f7 40%, #4f46e5 100%); */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #f9fafb;
  /* box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9), 0 12px 25px rgba(79, 70, 229, 0.7); */
  /* overflow: hidden; */
}

.chiroai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.chiroai-title {
  font-weight: 600;
  font-size: 1rem;
  color: #f9fafb;
}

.chiroai-subtitle {
  text-align: center;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #cbd5f5;
}

.chiroai-question-list {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.chiroai-question-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  font-size: 1rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.chiroai-question-item:hover,
.chiroai-question-item:focus-visible {
  background: rgba(55, 0, 122, 0.9);
  border-color: rgba(55, 0, 122, 0.9);
  box-shadow: 0 0 0 1px rgba(55, 0, 122, 0.6), 0 10px 20px rgba(55, 0, 122, 0.45);
  outline: none;
  transform: translateY(-1px);
}

.chiroai-question-item:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(55, 0, 122, 0.8), 0 4px 10px rgba(55, 0, 122, 0.6);
}

.chiroai-question-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #e879f9 0, #a855f7 40%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1;
  text-align: center;
}

.chiroai-question-text {
  white-space: normal;
}

@media (max-width: 768px) {
  .chiroai-widget-container {
    padding: 0.9rem 0.9rem;
    border-radius: 10px;
  }

  .chiroai-question-list {
    gap: 0.4rem;
  }

  .chiroai-question-item {
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
  }

  .chiroai-question-text {
    white-space: normal;
  }
}

/* Language Selector Styles */
.mwai-language-selector {
  position: relative;
  display: inline-block;
  margin-right: 8px;
  z-index: 10;
}

.mwai-language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  /* Match submit button height using CSS variables + slightly taller */
  height: calc(var(--mwai-submitHeight, var(--mwai-submitSize, 40px)) + 4px);
  min-height: calc(var(--mwai-submitHeight, var(--mwai-submitSize, 40px)) + 4px);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
  outline: none;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.mwai-language-button:hover,
.mwai-language-button:focus-visible {
  background: rgba(55, 0, 122, 0.9);
  border-color: rgba(55, 0, 122, 0.9);
  box-shadow: 0 0 0 1px rgba(55, 0, 122, 0.6), 0 4px 8px rgba(55, 0, 122, 0.3);
  outline: none;
  transform: translateY(-1px);
}

.mwai-language-button:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(55, 0, 122, 0.8), 0 2px 4px rgba(55, 0, 122, 0.4);
}

.mwai-language-button[aria-expanded="true"] {
  background: rgba(55, 0, 122, 0.9);
  border-color: rgba(55, 0, 122, 0.9);
}

.mwai-language-code {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1;
}

.mwai-language-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  display: inline-block;
  line-height: 1;
  opacity: 0.8;
}

.mwai-language-button[aria-expanded="true"] .mwai-language-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.mwai-language-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: auto;
  margin-bottom: 5px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 180px;
  max-width: 250px;
  z-index: 1000;
  padding: 4px 0;
  /* Custom scrollbar styling for better UX */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Webkit scrollbar styling */
.mwai-language-dropdown::-webkit-scrollbar {
  width: 8px;
}

.mwai-language-dropdown::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

.mwai-language-dropdown::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.mwai-language-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Dropdown is always positioned above the button */

.mwai-language-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: #1f2937;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  outline: none;
  box-sizing: border-box;
}

.mwai-language-item:hover,
.mwai-language-item:focus-visible {
  background-color: #f3f4f6;
  color: #111827;
  outline: none;
}

.mwai-language-item:active {
  background-color: #e5e7eb;
}

.mwai-language-item-selected {
  background-color: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

.mwai-language-item-selected:hover,
.mwai-language-item-selected:focus-visible {
  background-color: #e0e7ff;
  color: #4338ca;
}

.mwai-language-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Positioning: Language selector should be before submit button */
.mwai-input {
  position: relative;
}

.mwai-input .mwai-language-selector {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
}

/* Ensure language selector doesn't overlap with textarea */
.mwai-input .mwai-input-text {
  padding-right: calc(var(--mwai-submitWidth, 40px) + var(--mwai-submitRight, 12px) + 60px);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Ensure input container uses flexbox for proper alignment */
  .mwai-input {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }

  /* ChatGPT theme specific mobile styles */
  .mwai-chatgpt-theme .mwai-input {
    flex-direction: row!important;
    flex-wrap: wrap;
  }

  .mwai-chatgpt-theme .mwai-input .mwai-input-text {
    flex: 6!important;
  }

  .mwai-input .mwai-language-selector {
    margin-right: 0;
    display: inline-flex;
    align-items: center;
    flex: 1;
  }

  .mwai-language-button {
    padding: 0 8px;
    /* Match submit button height on mobile + slightly taller */
    height: calc(var(--mwai-submitHeight, var(--mwai-submitSize, 40px)) + 4px);
    min-height: calc(var(--mwai-submitHeight, var(--mwai-submitSize, 40px)) + 4px);
    font-size: 0.8rem;
    gap: 3px;
  }

  .mwai-language-code {
    font-size: 0.8rem;
  }

  .mwai-language-arrow {
    font-size: 0.65rem;
  }

  .mwai-language-dropdown {
    min-width: 160px;
    max-width: 220px;
    max-height: 250px;
    margin-bottom: 4px;
    /* Shift dropdown to the left on mobile to prevent overflow */
    left: auto;
    right: 0;
    transform: translateX(0);
  }

  .mwai-language-item {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .mwai-input .mwai-input-text {
    padding-right: calc(var(--mwai-submitWidth, 40px) + var(--mwai-submitRight, 8px) + 55px);
  }
}

@media (max-width: 480px) {
  .mwai-language-button {
    padding: 0 6px;
    /* Match submit button height on small mobile + slightly taller */
    height: calc(var(--mwai-submitHeight, var(--mwai-submitSize, 40px)) + 4px);
    min-height: calc(var(--mwai-submitHeight, var(--mwai-submitSize, 40px)) + 4px);
    font-size: 0.75rem;
    gap: 2px;
  }

  .mwai-language-code {
    font-size: 0.75rem;
  }

  .mwai-language-arrow {
    font-size: 0.65rem;
  }

  .mwai-language-dropdown {
    min-width: 140px;
    max-width: 180px;
    max-height: 200px;
    margin-bottom: 3px;
    /* Shift dropdown to the left on small mobile to prevent overflow */
    left: auto;
    right: 0;
    transform: translateX(0);
  }

  .mwai-language-item {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .mwai-input .mwai-input-text {
    padding-right: calc(var(--mwai-submitWidth, 40px) + var(--mwai-submitRight, 6px) + 50px);
  }
}

/* Follow-up Questions Styles - Minimalistic */
.chiroai-followup-questions {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: none;
}

.chiroai-followup-questions-list {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.chiroai-followup-question-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
  opacity: 0.8;
}

.chiroai-followup-question-item:hover,
.chiroai-followup-question-item:focus-visible {
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
  transform: none;
  opacity: 1;
  color: #a855f7;
}

.chiroai-followup-question-item:active {
  transform: none;
  box-shadow: none;
  opacity: 0.9;
}

.chiroai-followup-question-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex-shrink: 0;
  border-radius: 999px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a855f7;
  line-height: 1;
  text-align: center;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.chiroai-followup-question-item:hover .chiroai-followup-question-icon,
.chiroai-followup-question-item:focus-visible .chiroai-followup-question-icon {
  opacity: 1;
}

.chiroai-followup-question-text {
  white-space: normal;
  color: inherit;
}

@media (max-width: 768px) {
  .chiroai-followup-questions {
    margin-top: 0.5rem;
  }

  .chiroai-followup-questions-list {
    gap: 0.4rem;
  }

  .chiroai-followup-question-item {
    font-size: 0.85rem;
    padding: 0.4rem 0;
  }

  .chiroai-followup-question-icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    font-size: 0.7rem;
  }

  .chiroai-followup-question-text {
    white-space: normal;
  }
}

.chiroai-feedback-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  padding-right: 4px;
}

.chiroai-feedback-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: var(--mwai-fontColor, #e5e7eb);
  opacity: 0.7;
  outline: none;
  box-shadow: none;
}

.chiroai-feedback-button:hover:not(:disabled) {
  opacity: 1;
  background: transparent;
  transform: scale(1.1);
}

.chiroai-feedback-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.chiroai-feedback-button.active {
  opacity: 1;
  background: transparent;
  color: var(--mwai-fontColor, #e5e7eb);
}

.chiroai-feedback-button.active svg {
  stroke: var(--mwai-fontColor, #e5e7eb);
}

.chiroai-feedback-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Override ChatGPT theme button styles with higher specificity */
.mwai-chatgpt-theme .chiroai-feedback-buttons {
  display: flex !important;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  padding-right: 4px;
}

.mwai-chatgpt-theme .chiroai-feedback-button,
.mwai-chatgpt-theme button.chiroai-feedback-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  color: var(--mwai-fontColor, #e5e7eb) !important;
  opacity: 0.7;
  outline: none !important;
  box-shadow: none !important;
  min-width: auto !important;
  font-size: inherit !important;
  position: relative !important;
}

.mwai-chatgpt-theme .chiroai-feedback-button:hover:not(:disabled),
.mwai-chatgpt-theme button.chiroai-feedback-button:hover:not(:disabled) {
  opacity: 1 !important;
  background: transparent !important;
  transform: scale(1.1) !important;
}

.mwai-chatgpt-theme .chiroai-feedback-button:disabled,
.mwai-chatgpt-theme button.chiroai-feedback-button:disabled {
  cursor: not-allowed !important;
  opacity: 0.5 !important;
}

.mwai-chatgpt-theme .chiroai-feedback-button.active,
.mwai-chatgpt-theme button.chiroai-feedback-button.active {
  opacity: 1 !important;
  background: transparent !important;
  color: var(--mwai-fontColor, #e5e7eb) !important;
}

.mwai-chatgpt-theme .chiroai-feedback-button svg,
.mwai-chatgpt-theme button.chiroai-feedback-button svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.mwai-reply-actions .chiroai-feedback-buttons {
  display: flex;
}

.mwai-reply-actions .chiroai-feedback-button {
  display: flex;
}

/* TTS Button Styles */
.chiroai-tts-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  margin-left: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: var(--mwai-fontColor, #e5e7eb);
  opacity: 0.7;
  outline: none;
  box-shadow: none;
}

.chiroai-tts-button:hover:not(:disabled) {
  opacity: 1;
  background: transparent;
  transform: scale(1.1);
}

.chiroai-tts-button:focus-visible {
  opacity: 1;
  outline: 2px solid var(--mwai-fontColor, #e5e7eb);
  outline-offset: 2px;
}

.chiroai-tts-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.chiroai-tts-button.chiroai-tts-playing {
  opacity: 1;
  background: transparent;
  color: var(--mwai-fontColor, #e5e7eb);
  animation: chiroai-tts-pulse 1.5s ease-in-out infinite;
}

.chiroai-tts-button.chiroai-tts-playing svg {
  stroke: currentColor;
}

.chiroai-tts-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chiroai-tts-button .chiroai-tts-waves {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chiroai-tts-button.chiroai-tts-playing .chiroai-tts-waves {
  opacity: 1;
}

/* Pulse animation for playing state */
@keyframes chiroai-tts-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Override ChatGPT theme button styles with higher specificity */
.mwai-chatgpt-theme .chiroai-tts-button,
.mwai-chatgpt-theme button.chiroai-tts-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  margin-left: 4px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  color: var(--mwai-fontColor, #e5e7eb) !important;
  opacity: 0.7;
  outline: none !important;
  box-shadow: none !important;
  min-width: auto !important;
  font-size: inherit !important;
  position: relative !important;
}

.mwai-chatgpt-theme .chiroai-tts-button:hover:not(:disabled),
.mwai-chatgpt-theme button.chiroai-tts-button:hover:not(:disabled) {
  opacity: 1 !important;
  background: transparent !important;
  transform: scale(1.1) !important;
}

.mwai-chatgpt-theme .chiroai-tts-button:focus-visible,
.mwai-chatgpt-theme button.chiroai-tts-button:focus-visible {
  opacity: 1 !important;
  outline: 2px solid var(--mwai-fontColor, #e5e7eb) !important;
  outline-offset: 2px !important;
}

.mwai-chatgpt-theme .chiroai-tts-button:disabled,
.mwai-chatgpt-theme button.chiroai-tts-button:disabled {
  cursor: not-allowed !important;
  opacity: 0.5 !important;
}

.mwai-chatgpt-theme .chiroai-tts-button.chiroai-tts-playing,
.mwai-chatgpt-theme button.chiroai-tts-button.chiroai-tts-playing {
  opacity: 1 !important;
  background: transparent !important;
  color: var(--mwai-fontColor, #e5e7eb) !important;
  animation: chiroai-tts-pulse 1.5s ease-in-out infinite !important;
}

.mwai-chatgpt-theme .chiroai-tts-button svg,
.mwai-chatgpt-theme button.chiroai-tts-button svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.mwai-reply-actions .chiroai-tts-button {
  display: flex;
}

/* User message alignment - right side */
.mwai-reply.mwai-user {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
}

/* Ensure conversation container uses flexbox for alignment */
.mwai-conversation {
  display: flex;
  flex-direction: column;
}

/* For themes that don't have flexbox on conversation, ensure user messages align right */
.mwai-conversation .mwai-reply.mwai-user {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
}

/* Additional support for different conversation layouts */
.mwai-conversation > .mwai-reply.mwai-user {
  align-self: flex-end;
  margin-left: auto;
}

/* PDF Export Button Styles */
.chiroai-pdf-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 12px auto;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
  outline: none;
  user-select: none;
  box-sizing: border-box;
  width: auto;
  min-width: 120px;
}

/* Show PDF button only when hovering the chat (desktop) or when chat is focused (keyboard).
   Keep it visible on touch devices where hover isn't available. */
@media (hover: hover) and (pointer: fine) {
  /* Hidden by default (desktop) */
  [data-mwai-bot-id] .chiroai-pdf-export-btn,
  [data-chiroai-bot-id] .chiroai-pdf-export-btn,
  [id^="mwai-chatbot-"] .chiroai-pdf-export-btn,
  .mwai-chat[id^="mwai-chatbot-"] .chiroai-pdf-export-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
  }

  /* Visible on hover / focus */
  [data-mwai-bot-id]:hover .chiroai-pdf-export-btn,
  [data-chiroai-bot-id]:hover .chiroai-pdf-export-btn,
  [id^="mwai-chatbot-"]:hover .chiroai-pdf-export-btn,
  .mwai-chat[id^="mwai-chatbot-"]:hover .chiroai-pdf-export-btn,
  [data-mwai-bot-id]:focus-within .chiroai-pdf-export-btn,
  [data-chiroai-bot-id]:focus-within .chiroai-pdf-export-btn,
  [id^="mwai-chatbot-"]:focus-within .chiroai-pdf-export-btn,
  .mwai-chat[id^="mwai-chatbot-"]:focus-within .chiroai-pdf-export-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
  }
}

.chiroai-pdf-export-btn:hover:not(:disabled),
.chiroai-pdf-export-btn:focus-visible:not(:disabled) {
  background: rgba(55, 0, 122, 0.9);
  border-color: rgba(55, 0, 122, 0.9);
  box-shadow: 0 0 0 1px rgba(55, 0, 122, 0.6), 0 4px 8px rgba(55, 0, 122, 0.3);
  outline: none;
  transform: translateY(-1px);
}

.chiroai-pdf-export-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(55, 0, 122, 0.8), 0 2px 4px rgba(55, 0, 122, 0.4);
}

.chiroai-pdf-export-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.chiroai-pdf-export-btn.chiroai-pdf-export-loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.chiroai-pdf-export-btn.chiroai-pdf-export-loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: chiroai-pdf-spin 0.8s linear infinite;
  margin-left: 4px;
}

@keyframes chiroai-pdf-spin {
  to {
    transform: rotate(360deg);
  }
}

.chiroai-pdf-export-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.chiroai-pdf-export-text {
  white-space: nowrap;
}

/* Positioning: Center the button above input area */
.mwai-input-container .chiroai-pdf-export-btn,
.mwai-input-wrapper .chiroai-pdf-export-btn {
  display: block;
  margin: 12px auto;
  width: fit-content;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .chiroai-pdf-export-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 100px;
    gap: 4px;
  }

  .chiroai-pdf-export-btn svg {
    width: 14px;
    height: 14px;
  }

  .chiroai-pdf-export-text {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .chiroai-pdf-export-btn {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-width: 90px;
    gap: 3px;
  }

  .chiroai-pdf-export-btn svg {
    width: 12px;
    height: 12px;
  }

  .chiroai-pdf-export-text {
    font-size: 0.7rem;
  }
}
