/*
 * Chat widget CSS — standalone (no Tailwind dependency)
 * Scoped under .studio-chatbot namespace
 * Design: Inter font, #1D1D1F text, #6E6E73 secondary, #FF7000 CTA
 */

.studio-chatbot {
  --studio-chatbot-content-max-width: 672px;
  --studio-chatbot-accent: #FF7000;
  --studio-chatbot-accent-hover: #E66500;
  --studio-chatbot-accent-strong: #EA580C;
  --studio-chatbot-accent-soft: rgba(255, 112, 0, 0.1);
  --studio-chatbot-accent-soft-strong: rgba(255, 112, 0, 0.3);
  --studio-chatbot-accent-hover-soft: #FFF7ED;
  --studio-chatbot-accent-hover-border: #FDBA74;
  --studio-chatbot-accent-glow-soft: rgba(255, 112, 0, 0.18);
  --studio-chatbot-accent-glow-medium: rgba(255, 112, 0, 0.28);
  --studio-chatbot-accent-glow-hover-soft: rgba(255, 112, 0, 0.24);
  --studio-chatbot-accent-glow-hover-medium: rgba(255, 112, 0, 0.32);
  --studio-chatbot-accent-glow-key-strong: rgba(255, 112, 0, 0.4);
  --studio-chatbot-accent-glow-key-soft: rgba(255, 112, 0, 0.1);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1D1D1F;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.studio-chatbot[data-theme="blue"],
.article-chat-modal[data-theme="blue"] {
  --studio-chatbot-accent: #2563EB;
  --studio-chatbot-accent-hover: #1D4ED8;
  --studio-chatbot-accent-strong: #1D4ED8;
  --studio-chatbot-accent-soft: rgba(37, 99, 235, 0.1);
  --studio-chatbot-accent-soft-strong: rgba(37, 99, 235, 0.25);
  --studio-chatbot-accent-hover-soft: #EFF6FF;
  --studio-chatbot-accent-hover-border: #93C5FD;
  --studio-chatbot-accent-glow-soft: rgba(37, 99, 235, 0.18);
  --studio-chatbot-accent-glow-medium: rgba(37, 99, 235, 0.28);
  --studio-chatbot-accent-glow-hover-soft: rgba(37, 99, 235, 0.24);
  --studio-chatbot-accent-glow-hover-medium: rgba(37, 99, 235, 0.32);
  --studio-chatbot-accent-glow-key-strong: rgba(37, 99, 235, 0.4);
  --studio-chatbot-accent-glow-key-soft: rgba(37, 99, 235, 0.1);
}

.studio-chatbot[data-theme="emerald"],
.article-chat-modal[data-theme="emerald"] {
  --studio-chatbot-accent: #059669;
  --studio-chatbot-accent-hover: #047857;
  --studio-chatbot-accent-strong: #047857;
  --studio-chatbot-accent-soft: rgba(5, 150, 105, 0.1);
  --studio-chatbot-accent-soft-strong: rgba(5, 150, 105, 0.25);
  --studio-chatbot-accent-hover-soft: #ECFDF5;
  --studio-chatbot-accent-hover-border: #6EE7B7;
  --studio-chatbot-accent-glow-soft: rgba(5, 150, 105, 0.18);
  --studio-chatbot-accent-glow-medium: rgba(5, 150, 105, 0.28);
  --studio-chatbot-accent-glow-hover-soft: rgba(5, 150, 105, 0.24);
  --studio-chatbot-accent-glow-hover-medium: rgba(5, 150, 105, 0.32);
  --studio-chatbot-accent-glow-key-strong: rgba(5, 150, 105, 0.4);
  --studio-chatbot-accent-glow-key-soft: rgba(5, 150, 105, 0.1);
}

.studio-chatbot[data-theme="rose"],
.article-chat-modal[data-theme="rose"] {
  --studio-chatbot-accent: #E11D48;
  --studio-chatbot-accent-hover: #BE123C;
  --studio-chatbot-accent-strong: #BE123C;
  --studio-chatbot-accent-soft: rgba(225, 29, 72, 0.1);
  --studio-chatbot-accent-soft-strong: rgba(225, 29, 72, 0.25);
  --studio-chatbot-accent-hover-soft: #FFF1F2;
  --studio-chatbot-accent-hover-border: #FDA4AF;
  --studio-chatbot-accent-glow-soft: rgba(225, 29, 72, 0.18);
  --studio-chatbot-accent-glow-medium: rgba(225, 29, 72, 0.28);
  --studio-chatbot-accent-glow-hover-soft: rgba(225, 29, 72, 0.24);
  --studio-chatbot-accent-glow-hover-medium: rgba(225, 29, 72, 0.32);
  --studio-chatbot-accent-glow-key-strong: rgba(225, 29, 72, 0.4);
  --studio-chatbot-accent-glow-key-soft: rgba(225, 29, 72, 0.1);
}

.studio-chatbot[data-theme="slate"],
.article-chat-modal[data-theme="slate"] {
  --studio-chatbot-accent: #475569;
  --studio-chatbot-accent-hover: #334155;
  --studio-chatbot-accent-strong: #334155;
  --studio-chatbot-accent-soft: rgba(71, 85, 105, 0.1);
  --studio-chatbot-accent-soft-strong: rgba(71, 85, 105, 0.25);
  --studio-chatbot-accent-hover-soft: #F8FAFC;
  --studio-chatbot-accent-hover-border: #CBD5E1;
  --studio-chatbot-accent-glow-soft: rgba(71, 85, 105, 0.18);
  --studio-chatbot-accent-glow-medium: rgba(71, 85, 105, 0.28);
  --studio-chatbot-accent-glow-hover-soft: rgba(71, 85, 105, 0.24);
  --studio-chatbot-accent-glow-hover-medium: rgba(71, 85, 105, 0.32);
  --studio-chatbot-accent-glow-key-strong: rgba(71, 85, 105, 0.4);
  --studio-chatbot-accent-glow-key-soft: rgba(71, 85, 105, 0.1);
}

.studio-chatbot,
.studio-chatbot *,
.studio-chatbot *::before,
.studio-chatbot *::after {
  box-sizing: border-box;
}

.studio-chatbot button,
.studio-chatbot input,
.studio-chatbot textarea {
  font: inherit;
}

.studio-chatbot input,
.studio-chatbot textarea {
  color: inherit;
}

/* ── Chat Launcher ── */

.studio-chatbot__bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-height: 52px;
  max-width: calc(100vw - 48px);
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--studio-chatbot-accent), #ec4899, #8b5cf6, #3b82f6, #10b981, #f59e0b, var(--studio-chatbot-accent), #ec4899) border-box;
  border: 2px solid transparent;
  background-size: 100% 100%, 200% 100%;
  color: #1D1D1F;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.38s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease;
  z-index: 9998;
  visibility: visible;
  animation: studio-chatbot-rainbow-flow 2s linear infinite, studio-chatbot-rainbow-pulse 2.5s ease-in-out infinite;
}

.studio-chatbot__bubble--preenter {
  opacity: 0;
  transform: translateY(22px);
  pointer-events: none;
}

.studio-chatbot__bubble::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: studio-chatbot-rainbow-glow 3s ease-in-out infinite;
}

.studio-chatbot__bubble:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.04);
  animation: studio-chatbot-rainbow-flow 1.2s linear infinite, studio-chatbot-rainbow-pulse-hover 1.2s ease-in-out infinite;
}

.studio-chatbot__bubble:hover::after {
  opacity: 1;
}

.studio-chatbot__bubble:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent);
  outline-offset: 2px;
}

@keyframes studio-chatbot-rainbow-flow {
  to { background-position: 0 0, -200% 0; }
}

@keyframes studio-chatbot-rainbow-pulse {
  0%, 100% {
    box-shadow:
      0 0 10px var(--studio-chatbot-accent-glow-soft),
      0 0 18px rgba(139, 92, 246, 0.12);
  }
  50% {
    box-shadow:
      0 0 16px var(--studio-chatbot-accent-glow-medium),
      0 0 28px rgba(139, 92, 246, 0.18),
      0 0 36px rgba(236, 72, 153, 0.12);
  }
}

@keyframes studio-chatbot-rainbow-pulse-hover {
  0%, 100% {
    box-shadow:
      0 0 14px var(--studio-chatbot-accent-glow-hover-soft),
      0 0 24px rgba(139, 92, 246, 0.16);
  }
  50% {
    box-shadow:
      0 0 18px var(--studio-chatbot-accent-glow-hover-medium),
      0 0 30px rgba(139, 92, 246, 0.22),
      0 0 42px rgba(236, 72, 153, 0.14);
  }
}

@keyframes studio-chatbot-rainbow-glow {
  0%, 100% { box-shadow: 0 0 18px var(--studio-chatbot-accent-glow-key-strong), 0 0 36px var(--studio-chatbot-accent-glow-key-soft); }
  17% { box-shadow: 0 0 18px rgba(236, 72, 153, 0.4), 0 0 36px rgba(236, 72, 153, 0.1); }
  33% { box-shadow: 0 0 18px rgba(139, 92, 246, 0.4), 0 0 36px rgba(139, 92, 246, 0.1); }
  50% { box-shadow: 0 0 18px rgba(59, 130, 246, 0.4), 0 0 36px rgba(59, 130, 246, 0.1); }
  67% { box-shadow: 0 0 18px rgba(16, 185, 129, 0.4), 0 0 36px rgba(16, 185, 129, 0.1); }
  83% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.4), 0 0 36px rgba(245, 158, 11, 0.1); }
}

.studio-chatbot__bubble-icon {
  color: #1D1D1F;
  font-size: 16px;
  line-height: 1;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.studio-chatbot__bubble-avatar {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 999px;
  display: block;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.studio-chatbot__bubble-avatar--idle {
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
  animation: fitty-idle 1.6s ease-in-out infinite;
}

.studio-chatbot__bubble-avatar.fitty-bob {
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
  animation: fitty-bob 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.studio-chatbot__bubble-text {
  overflow-wrap: anywhere;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 12px), #a78bfa, transparent calc(50% + 12px)),
    linear-gradient(#1D1D1F, #1D1D1F);
  background-size: 250% 100%, auto;
  background-repeat: no-repeat, no-repeat;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: studio-chatbot-text-shimmer 4s linear infinite;
}

.studio-chatbot[data-source="embed"] .studio-chatbot__bubble,
.studio-chatbot[data-source="embed"] .studio-chatbot__bubble-text {
  font-weight: 700;
}

.studio-chatbot__bubble-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--studio-chatbot-accent-strong);
  background-color: var(--studio-chatbot-accent-soft);
  animation: studio-chatbot-badge-ping 4s linear infinite;
}

@keyframes studio-chatbot-text-shimmer {
  0% { background-position: 100% 0, 0 0; }
  40%, 100% { background-position: 0 0, 0 0; }
}

@keyframes studio-chatbot-badge-ping {
  0%, 25% { background-color: var(--studio-chatbot-accent-soft); }
  38% { background-color: var(--studio-chatbot-accent-soft-strong); }
  55%, 100% { background-color: var(--studio-chatbot-accent-soft); }
}

.studio-chatbot__bubble--hidden {
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease,
    visibility 0s linear 0.32s;
}

/* ── Modal Overlay ── */

.studio-chatbot__overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  background-color: rgba(17, 24, 39, 0.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 300ms ease-in-out;
}

.studio-chatbot__overlay--hidden {
  display: none;
}

.studio-chatbot__overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Chat Window ── */

.studio-chatbot__window {
  --studio-chatbot-keyboard-offset: 0px;
  --studio-chatbot-viewport-height: min(82vh, 760px);
  position: relative;
  width: min(896px, calc(100vw - 48px));
  height: var(--studio-chatbot-viewport-height);
  max-height: var(--studio-chatbot-viewport-height);
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: 24px;
  border: 1px solid #E8E8ED;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  opacity: 0;
  transform: translateY(48px);
  transform-origin: center bottom;
  will-change: transform, opacity;
}

.article-chat-modal {
  --studio-chatbot-keyboard-offset: var(--article-chat-keyboard-offset, 0px);
  --studio-chatbot-viewport-height: min(82vh, 760px);
  width: min(896px, calc(100vw - 48px));
  height: var(--studio-chatbot-viewport-height);
  max-height: var(--studio-chatbot-viewport-height);
  transform-origin: center bottom;
  will-change: transform, opacity;
}

.studio-chatbot__window--hidden {
  display: none;
}

/* ── Header ── */

.studio-chatbot__header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}

.studio-chatbot__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-chatbot__header-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--studio-chatbot-accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.studio-chatbot__header-icon svg {
  width: 16px;
  height: 16px;
}

.studio-chatbot__header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  display: block;
  overflow: hidden;
}

.studio-chatbot__header-title {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1F;
  display: block;
}

.studio-chatbot__header-subtitle {
  display: block;
  font-size: 12px;
  color: #6E6E73;
  line-height: 1.2;
}

.studio-chatbot__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.studio-chatbot__header-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6E6E73;
  padding: 0;
  transition: background 0.15s ease;
}

.studio-chatbot__header-btn svg {
  width: 16px;
  height: 16px;
}

.studio-chatbot__header-btn:hover {
  background: #F5F5F7;
}

.studio-chatbot__header-btn--voice[data-voice-muted="false"] {
  background: #EEF2FF;
  color: #1D4ED8;
}

.studio-chatbot__header-btn--voice[data-voice-playing="true"] {
  background: #DBEAFE;
  color: #1D4ED8;
}

.studio-chatbot__header-btn:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent);
  outline-offset: -2px;
}

/* ── Messages ── */

.studio-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  padding: 40px 20px calc(16px + var(--studio-chatbot-keyboard-offset));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  transition: padding-bottom 220ms ease;
}

.studio-chatbot__messages--welcome {
  justify-content: flex-start;
  padding-top: 24px;
  padding-bottom: calc(24px + var(--studio-chatbot-keyboard-offset, 0px));
}

.studio-chatbot__sheet-handle {
  display: none;
}

.studio-chatbot__messages > * {
  width: 100%;
  max-width: var(--studio-chatbot-content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.studio-chatbot__stream-dock {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-chatbot__stream-dock > * {
  width: 100%;
}

.studio-chatbot__welcome-panel {
  width: 100%;
  max-width: var(--studio-chatbot-content-max-width);
  margin: 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, #F5F5F7 0%, #FFFFFF 52%, #F5F5F7 100%);
  border: none;
  box-shadow: none;
  padding: 16px;
}

.studio-chatbot__welcome-panel--transition-out {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-chatbot__welcome-panel--transition-out.studio-chatbot__welcome-panel--hidden {
  opacity: 0;
  transform: translateY(-10px) scale(0.992);
  pointer-events: none;
}

.studio-chatbot__messages--transition-enter {
  opacity: 0;
  transform: translateY(14px) scale(0.994);
}

.studio-chatbot__messages--transition-enter.studio-chatbot__messages--transition-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar {
  position: relative;
}

.studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar .studio-chatbot__welcome-eyebrow,
.studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar .studio-chatbot__welcome-title,
.studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar .studio-chatbot__welcome-text {
  padding-right: 184px;
}

.studio-chatbot__welcome-avatar {
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
  overflow: visible;
  pointer-events: auto;
  user-select: none;
}

.studio-chatbot__welcome-avatar--idle {
  position: absolute;
  right: 20px;
  top: 24px;
  --fitty-dir: -1;
}

.studio-chatbot__welcome-avatar--idle:not(.studio-chatbot__avatar-animated) {
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
  animation: fitty-idle 1.6s ease-in-out infinite;
}

.studio-chatbot__welcome-eyebrow {
  margin: 0;
  color: var(--studio-chatbot-accent, #FF7000);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.studio-chatbot__welcome-title {
  margin: 8px 0 0;
  color: #1D1D1F;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(2rem, 8.4vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 700;
  overflow-wrap: normal;
  text-wrap: balance;
}

.studio-chatbot__welcome-text {
  margin: 10px 0 0;
  color: #6E6E73;
  font-size: 17px;
  line-height: 1.58;
}

.studio-chatbot__welcome-quickstart {
  margin: 16px 0 2px;
  color: #6E6E73;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.studio-chatbot__welcome-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-chatbot__welcome-input {
  width: 100%;
  margin-top: 16px;
}

.studio-chatbot__welcome-input .studio-chatbot__composer {
  max-width: 100%;
  margin: 0;
}

.studio-chatbot__composer--with-avatar {
  min-height: 64px;
}

.studio-chatbot__composer--with-avatar .studio-chatbot__input {
  min-height: 64px;
  max-height: 64px;
  padding-top: 19px;
  padding-bottom: 19px;
  padding-left: 66px;
  padding-right: 70px;
  line-height: 1.35;
}

.studio-chatbot__composer-avatar {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  pointer-events: auto;
}

.studio-chatbot__composer-avatar[hidden] {
  display: none !important;
}

.studio-chatbot__composer-avatar .studio-chatbot__welcome-avatar,
.studio-chatbot__composer-avatar .studio-chatbot__composer-avatar-img,
.studio-chatbot__composer-avatar [data-assistant-avatar="true"] {
  width: 100%;
  height: 100%;
}

.studio-chatbot__avatar-node {
  display: block;
  box-sizing: border-box;
}

.studio-chatbot__avatar-static {
  object-fit: contain;
  object-position: center;
}

.studio-chatbot__composer-avatar .studio-chatbot__welcome-avatar--idle {
  position: static;
  right: auto;
  top: auto;
}

.studio-chatbot__composer-avatar-img.fitty-idle {
  animation: fitty-idle 1.6s ease-in-out infinite;
}

.studio-chatbot__composer-avatar-img.fitty-bob {
  animation: fitty-bob 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.studio-chatbot__welcome-question {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 12px;
  min-height: 40px;
  padding: 8px 12px;
  text-align: left;
  color: #6E6E73;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease;
}

.studio-chatbot__welcome-question-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #6E6E73;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.studio-chatbot__welcome-question-icon svg {
  width: 16px;
  height: 16px;
}

.studio-chatbot__welcome-question-text {
  text-align: left;
}

.studio-chatbot__welcome-question:hover {
  color: var(--studio-chatbot-accent, #FF7000);
}

.studio-chatbot__welcome-question:hover .studio-chatbot__welcome-question-icon {
  color: var(--studio-chatbot-accent, #FF7000);
}

.studio-chatbot__welcome-question:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent, #FF7000);
  outline-offset: 1px;
}

.studio-chatbot__welcome-booking-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  background-color: var(--studio-chatbot-accent, #FF7000);
  border: none;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transform-origin: 50% 50%;
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.4, 0, 0.2, 1), filter 140ms ease, background-color 0.15s ease;
  will-change: opacity, transform, filter;
}

.chat-shell__welcome-cta-shell {
  width: 100%;
  margin-top: 8px;
  max-height: 72px;
  overflow: hidden;
  transition: max-height 180ms cubic-bezier(0.4, 0, 0.2, 1), opacity 140ms ease, transform 180ms cubic-bezier(0.4, 0, 0.2, 1), margin 180ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: max-height, opacity, transform, margin;
}

.chat-shell__welcome-cta-shell .studio-chatbot__welcome-booking-cta {
  margin-top: 0;
  transform-origin: 50% 0;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
  transition: background-color 0.15s ease, opacity 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1), filter 220ms ease;
}

.studio-chatbot__welcome-booking-cta:hover {
  background-color: var(--studio-chatbot-accent-hover, #E66500);
}

.studio-chatbot__welcome-booking-cta:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent, #FF7000);
  outline-offset: 2px;
}

.studio-chatbot__handoff-banner {
  width: 100%;
  max-width: var(--studio-chatbot-content-max-width);
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--studio-chatbot-accent, #FF7000) 32%, #FFFFFF);
  border-radius: 8px;
  background: color-mix(in srgb, var(--studio-chatbot-accent, #FF7000) 10%, #FFFFFF);
  color: #3A3A3C;
  font-size: 13px;
  line-height: 1.4;
}

.studio-chatbot__message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-chatbot__message--user {
  align-items: flex-end;
}

.studio-chatbot__message--bot {
  align-items: flex-start;
}

.studio-chatbot__message--error {
  align-items: flex-start;
}

.studio-chatbot__message-body {
  width: 100%;
}

.studio-chatbot__message-body--assistant {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.studio-chatbot__message-avatar {
  width: 84px;
  height: 84px;
  margin-top: 0;
  border-radius: 0;
  object-fit: contain;
  display: block;
  overflow: visible;
  flex-shrink: 0;
  user-select: none;
  pointer-events: auto;
}

.studio-chatbot__message-avatar--inline {
  width: 56px;
  height: 56px;
}

.studio-chatbot__avatar-animated {
  position: relative;
  contain: layout;
  isolation: isolate;
}

.studio-chatbot__avatar-fallback,
.studio-chatbot__avatar-lottie,
.studio-chatbot__avatar-lottie svg {
  width: 100%;
  height: 100%;
  display: block;
}

.studio-chatbot__avatar-fallback {
  border-radius: inherit;
  object-fit: contain;
  opacity: 1;
  transition: opacity 220ms ease;
  will-change: opacity;
  pointer-events: none;
}

.studio-chatbot__header-avatar .studio-chatbot__avatar-fallback {
  object-fit: cover;
}

.studio-chatbot__avatar-lottie {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: visible;
  opacity: 0;
  transition: opacity 220ms ease;
  will-change: opacity;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.studio-chatbot__avatar-lottie svg {
  transform: translateZ(0);
  backface-visibility: hidden;
}

.studio-chatbot__avatar-animated[data-fitty-layer-visible="true"][data-fitty-layer-painted="true"] .studio-chatbot__avatar-fallback {
  opacity: 0;
}

.studio-chatbot__avatar-lottie[data-fitty-layer-visible="true"] {
  opacity: 1;
}

.studio-chatbot__avatar-animated.studio-chatbot__welcome-avatar--idle {
  transform: scaleX(-1);
}

.studio-chatbot__message-avatar.fitty-idle {
  animation: fitty-idle 1.6s ease-in-out infinite;
}

.studio-chatbot__message-avatar.fitty-bob {
  animation: fitty-bob 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

.studio-chatbot[data-source="embed"] .studio-chatbot__message--bot[data-has-avatar="true"]:not([data-avatar-placement="inline"]) .studio-chatbot__message-meta-row--assistant,
.studio-chatbot[data-source="embed"] .studio-chatbot__message--error[data-has-avatar="true"]:not([data-avatar-placement="inline"]) .studio-chatbot__message-meta-row--assistant {
  padding-left: 98px;
}

.studio-chatbot__message--bot[data-avatar-placement="inline"],
.studio-chatbot__message--error[data-avatar-placement="inline"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.studio-chatbot__message--bot[data-avatar-placement="inline"] .studio-chatbot__message-bubble,
.studio-chatbot__message--error[data-avatar-placement="inline"] .studio-chatbot__message-bubble {
  width: 100%;
  max-width: 100%;
}

.studio-chatbot__message-inline-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.studio-chatbot__message-inline-content {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
}

.studio-chatbot__message-bubble {
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.studio-chatbot__message-bubble--user {
  background: var(--studio-chatbot-accent, #FF7000);
  color: #FFFFFF;
  border-bottom-right-radius: 6px;
}

.studio-chatbot__message-bubble--collapsible {
  position: relative;
  padding-right: 40px;
}

.studio-chatbot__message-bubble--bot {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
  color: #1D1D1F;
  border-bottom-left-radius: 6px;
}

.studio-chatbot__message-bubble--error {
  background: #FEF2F2;
  color: #991B1B;
  border-bottom-left-radius: 6px;
  font-size: 13px;
}

.studio-chatbot__message-text ul,
[data-message-text="true"] ul {
  list-style: disc;
  margin: 6px 0;
  padding-left: 1.25rem;
}

.studio-chatbot__message-text ol,
[data-message-text="true"] ol {
  list-style: decimal;
  margin: 6px 0;
  padding-left: 1.25rem;
}

.studio-chatbot__message-text li + li,
[data-message-text="true"] li + li {
  margin-top: 2px;
}

.studio-chatbot__message-link {
  color: var(--studio-chatbot-accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--studio-chatbot-accent) 50%, transparent);
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.studio-chatbot__message-link:hover {
  color: var(--studio-chatbot-accent-hover);
  text-decoration-color: color-mix(in srgb, var(--studio-chatbot-accent-hover) 60%, transparent);
}

.studio-chatbot__response-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 9999px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.studio-chatbot__response-chip--accent {
  color: #FFFFFF;
  background: var(--studio-chatbot-accent);
  border: 1px solid var(--studio-chatbot-accent);
}

.studio-chatbot__response-chip--accent:hover {
  background: var(--studio-chatbot-accent-hover);
  border-color: var(--studio-chatbot-accent-hover);
}

.studio-chatbot__response-chip--neutral {
  color: #6E6E73;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
}

.studio-chatbot__response-chip--neutral:hover {
  color: var(--studio-chatbot-accent);
  background: var(--studio-chatbot-accent-hover-soft);
  border-color: var(--studio-chatbot-accent-hover-border);
}

.studio-chatbot__link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
  border-radius: 9999px;
  border: 1px solid var(--studio-chatbot-accent-hover-border);
  background: var(--studio-chatbot-accent-hover-soft);
  color: var(--studio-chatbot-accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.studio-chatbot__link-chip:hover {
  background: color-mix(in srgb, var(--studio-chatbot-accent-hover-soft) 70%, #FFFFFF);
  color: var(--studio-chatbot-accent-hover);
  border-color: var(--studio-chatbot-accent);
}

.studio-chatbot__message-text {
  white-space: normal;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
}

.studio-chatbot__message-text--user {
  white-space: pre-wrap;
}

.studio-chatbot__message-text--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.studio-chatbot__message-toggle {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

@keyframes fitty-bob {
  0%, 100% {
    transform: translate3d(0, 0, 0) scaleX(var(--fitty-dir, 1)) scale(1);
  }
  12% {
    transform: translate3d(0, 0, 0) scaleX(var(--fitty-dir, 1)) scale(1.06, 0.94);
  }
  36% {
    transform: translate3d(0, -9px, 0) scaleX(var(--fitty-dir, 1)) scale(0.98, 1.02);
  }
  54% {
    transform: translate3d(0, 0, 0) scaleX(var(--fitty-dir, 1)) scale(1.03, 0.97);
  }
  70% {
    transform: translate3d(0, -3px, 0) scaleX(var(--fitty-dir, 1)) scale(0.995, 1.005);
  }
  82% {
    transform: translate3d(0, 0, 0) scaleX(var(--fitty-dir, 1)) scale(1);
  }
}

@keyframes fitty-idle {
  0%, 100% {
    transform: translate3d(0, 0, 0) scaleX(var(--fitty-dir, 1)) scale(1);
  }
  50% {
    transform: translate3d(0, -2.8px, 0) scaleX(var(--fitty-dir, 1)) scale(1.018);
  }
}

.studio-chatbot__message-meta {
  padding: 0 4px;
  font-size: 11px;
  line-height: 1.2;
  color: #6E6E73;
}

.studio-chatbot__message-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-chatbot__message-meta-row--assistant {
  width: 100%;
  justify-content: flex-start;
}

.studio-chatbot__message-meta-row--user {
  align-self: flex-end;
  justify-content: flex-end;
}

.studio-chatbot__message-meta--hidden {
  display: none;
}

.studio-chatbot__message-copy {
  position: relative;
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  height: 24px;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  background: #FFFFFF;
  color: #6E6E73;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease, transform 0.15s ease;
}

.studio-chatbot__message-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.studio-chatbot__message--bot:hover .studio-chatbot__message-copy,
.studio-chatbot__message--bot:focus-within .studio-chatbot__message-copy,
.studio-chatbot__message-copy:hover,
.studio-chatbot__message-copy:focus-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  border-color: #D1D5DB;
  color: #1D1D1F;
}

.studio-chatbot__message-copy-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(2px);
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  background: #FFFFFF;
  color: #1D1D1F;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  padding: 4px 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.studio-chatbot__message-copy[data-copied="true"] .studio-chatbot__message-copy-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.studio-chatbot__message-copy[data-copied="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.studio-chatbot__message-text strong {
  font-weight: 600;
}

.studio-chatbot__link-row {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.studio-chatbot__link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--studio-chatbot-accent);
  background-color: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.studio-chatbot__link-btn:hover {
  background-color: #F9FAFB;
  border-color: #D1D5DB;
}

.studio-chatbot__message-text a {
  color: var(--studio-chatbot-accent);
  text-decoration: underline;
}

.studio-chatbot__message-text a:hover {
  opacity: 0.8;
}

.studio-chatbot__message-text a.studio-chatbot__link-btn,
.studio-chatbot__message-text a.studio-chatbot__link-btn:hover {
  color: var(--studio-chatbot-accent);
  text-decoration: none;
  opacity: 1;
}

.studio-chatbot__message-text ul {
  margin: 4px 0;
  padding-left: 16px;
  list-style: disc;
}

.studio-chatbot__message-text li {
  margin: 2px 0;
}

.studio-chatbot__message-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px 0 4px;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  background: #F8FAFC;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  object-fit: cover;
}

.studio-chatbot__followup-pills {
  position: relative;
  width: 100%;
  max-width: none;
  margin-top: 10px;
}

.studio-chatbot__followup-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: 12px;
  padding-bottom: 4px;
}

.studio-chatbot__followup-scroll::-webkit-scrollbar {
  display: none;
}

.studio-chatbot__followup-fade {
  display: none;
}

.studio-chatbot__followup-fade--hidden {
  opacity: 0 !important;
}

.studio-chatbot__followup-pill {
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid #D1D1D6;
  border-radius: 9999px;
  background: #FFFFFF;
  color: #6E6E73;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.studio-chatbot__followup-pill:hover {
  border-color: var(--studio-chatbot-accent-hover-border);
  color: var(--studio-chatbot-accent);
  background-color: var(--studio-chatbot-accent-hover-soft);
}

.studio-chatbot__retry-bubble {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.studio-chatbot__retry-bubble:hover {
  background: #FEE2E2;
}

.studio-chatbot__retry-bubble:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent);
  outline-offset: 1px;
}

/* ── Typing Indicator ── */

.studio-chatbot__typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.studio-chatbot__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6E6E73;
  animation: studio-chatbot-typing 1.4s infinite ease-in-out both;
}

.studio-chatbot__typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.studio-chatbot__typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.studio-chatbot__typing-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes studio-chatbot-typing {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Suggested Question Chips ── */

.studio-chatbot__suggested-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.studio-chatbot__suggested-chip {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #D1D1D6;
  border-radius: 18px;
  background: #FFFFFF;
  color: #6E6E73;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.studio-chatbot__suggested-chip:hover {
  background: #F5F5F7;
  color: #1D1D1F;
  border-color: #1D1D1F;
}

.studio-chatbot__suggested-chip:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent);
  outline-offset: 1px;
}

/* ── External Links ── */

.studio-chatbot__external-links {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  border-top: 1px solid #E5E7EB;
  background: #FFFFFF;
  flex-shrink: 0;
  overflow: hidden;
}

.studio-chatbot__external-links-label {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 11px;
  color: #6E6E73;
  margin: 0;
  white-space: nowrap;
}

.studio-chatbot__external-links-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.studio-chatbot__external-links-buttons::-webkit-scrollbar {
  display: none;
}

.studio-chatbot__external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid #6E6E73;
  border-radius: 14px;
  font-size: 12px;
  color: #6E6E73;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  line-height: 1.3;
}

.studio-chatbot__external-link:hover {
  background: #F5F5F7;
  color: #1D1D1F;
  border-color: #1D1D1F;
}

.studio-chatbot__external-link:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent);
  outline-offset: 1px;
}

.studio-chatbot__external-link svg {
  flex-shrink: 0;
}

/* ── Input Area ── */

.studio-chatbot__input-area {
  position: sticky;
  bottom: var(--studio-chatbot-keyboard-offset, 0px);
  z-index: 20;
  display: block;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  border-top: 1px solid #E5E7EB;
  background: #FFFFFF;
  flex-shrink: 0;
  transition: bottom 220ms ease, padding-bottom 220ms ease;
}

.studio-chatbot__input-area--hidden {
  display: none;
}

.studio-chatbot__composer {
  max-width: var(--studio-chatbot-content-max-width);
  margin: 0 auto;
  position: relative;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 4px 18px rgba(17, 24, 39, 0.08);
  display: block;
  overflow: hidden;
  min-height: 56px;
}

.studio-chatbot__input {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 16px;
  padding: 15px 58px 15px 16px;
  font-size: 17px;
  font-family: inherit;
  color: #1D1D1F;
  background: transparent;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-height: 56px;
  max-height: 56px;
  line-height: 1.45;
  resize: none;
  overflow-y: hidden;
  touch-action: manipulation;
  box-sizing: border-box;
  z-index: 1;
}

.studio-chatbot__input::placeholder {
  color: #6E6E73;
}

.studio-chatbot__input:focus-visible {
  outline: none;
}

.studio-chatbot__composer-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 2;
}

.studio-chatbot__send-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  pointer-events: auto;
  border: none;
  background: var(--studio-chatbot-accent, #FF7000);
  color: #FFFFFF;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  pointer-events: auto;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.studio-chatbot__send-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.studio-chatbot__send-btn:hover:not(:disabled) {
  background: var(--studio-chatbot-accent-hover, #E66500);
  transform: translateY(-1px);
}

.studio-chatbot__send-btn--stop {
  background: #111827;
}

.studio-chatbot__send-btn--stop:hover:not(:disabled) {
  background: #1F2937;
}

.studio-chatbot__send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.studio-chatbot__send-btn:focus-visible {
  outline: 2px solid var(--studio-chatbot-accent, #FF7000);
  outline-offset: 2px;
}

/* ── Send Button Spinner ── */

.studio-chatbot__spinner {
  animation: studio-chatbot-spin 0.8s linear infinite;
}

@keyframes studio-chatbot-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Powered By Footer (embed only) ── */

.studio-chatbot__powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: #FAFAFA;
  border-top: 1px solid #E5E5E7;
  flex-shrink: 0;
}

.studio-chatbot__powered-by-link {
  font-size: 11px;
  color: #6E6E73;
  text-decoration: none;
  transition: color 0.15s ease;
}

.studio-chatbot__powered-by-link:hover {
  color: #1D1D1F;
}

.studio-chatbot__jump-btn {
  position: absolute;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #E5E7EB;
  background: rgba(255, 255, 255, 0.95);
  color: #1D1D1F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.12);
  cursor: pointer;
  z-index: 21;
  transition: opacity 180ms ease, transform 180ms ease;
}

.studio-chatbot__jump-btn--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
}

/* ── Body scroll lock (mobile overlay) ── */

.studio-chatbot-body-locked {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.chat-shell__messages {
  transition: padding-bottom 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gym-finder-shell,
.gym-finder-shell .chat-shell__messages,
.gym-finder-shell [data-message-wrapper="true"] {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
}

.gym-finder-shell .chat-shell__message-list {
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
}

.gym-finder-shell [data-message-bubble="true"],
.gym-finder-shell [data-message-text="true"] {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.chat-shell__welcome-collapse {
  transition: max-height 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1), margin 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: max-height, opacity, transform, margin;
}

.chat-shell__welcome-frame {
  transition: max-height 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, background-color 320ms cubic-bezier(0.22, 1, 0.36, 1), border-color 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1), padding 320ms cubic-bezier(0.22, 1, 0.36, 1), margin 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: max-height, opacity, background-color, border-color, box-shadow, padding, margin;
}

.chat-shell__welcome-home {
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1), bottom 320ms cubic-bezier(0.22, 1, 0.36, 1), transform 320ms cubic-bezier(0.22, 1, 0.36, 1), margin 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
  will-change: width, bottom, transform, margin, opacity;
}

.chat-shell__jump {
  transition: opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-chat-modal__greeting--transition {
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-chat-modal__greeting--exit {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.article-chat-modal__messages--transition {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-chat-modal__messages--transition.article-chat-modal__messages--visible {
  opacity: 1;
  transform: translateY(0);
}

.gym-finder__greeting--transition-enter {
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  pointer-events: none;
}

.gym-finder__greeting--transition-enter.gym-finder__greeting--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}

.gym-finder__messages--transition-exit {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gym-finder__messages--transition-exit.gym-finder__messages--hidden {
  opacity: 0;
  transform: translateY(-10px) scale(0.996);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.chat-shell__greeting-reset-enter {
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  pointer-events: none;
}

.chat-shell__greeting-reset-enter.chat-shell__greeting-reset-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-shell__messages-reset-exit {
  opacity: 1;
  transform: translateY(0);
}

.chat-shell__messages-reset-exit.chat-shell__messages-reset-hidden {
  opacity: 0;
  transform: translateY(-10px) scale(0.996);
  pointer-events: none;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-chatbot__messages--reset-transition {
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-chatbot__messages--reset-out {
  opacity: 0;
  transform: translateY(-10px) scale(0.996);
  pointer-events: none;
}

.studio-chatbot__messages--reset-in {
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  pointer-events: none;
}

.gym-finder__sales-banner,
.studio-chatbot__external-links {
  transition: opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1023px) {
  .chat-shell--input-focus.chat-shell--keyboard-open .chat-shell__messages {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
  }

  .chat-shell--compact.chat-shell--input-focus.chat-shell--keyboard-open .chat-shell__jump {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
  }

  .chat-shell--compact.chat-shell--input-focus.chat-shell--keyboard-open .gym-finder__sales-banner,
  .chat-shell--compact.chat-shell--input-focus.chat-shell--keyboard-open .studio-chatbot__external-links {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
  }

  .studio-chatbot__messages {
    transition: padding-bottom 220ms ease, opacity 220ms ease, transform 220ms ease;
  }

  .studio-chatbot--input-focus.studio-chatbot--keyboard-open .studio-chatbot__jump-btn {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
  }
}

/* ── Mobile (< 640px) ── */

@media (max-width: 639px) {
  .article-chat-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .article-chat-modal {
    width: 100vw;
    --studio-chatbot-viewport-height: 84dvh;
    height: var(--studio-chatbot-viewport-height);
    max-height: var(--studio-chatbot-viewport-height);
    border-radius: 24px 24px 0 0;
  }

  .studio-chatbot__bubble {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: 16px;
  }

  .studio-chatbot__overlay {
    align-items: flex-end;
    padding: 0;
  }

  .studio-chatbot__window {
    position: relative;
    width: 100vw;
    --studio-chatbot-viewport-height: 84dvh;
    height: var(--studio-chatbot-viewport-height);
    max-height: var(--studio-chatbot-viewport-height);
    border-radius: 24px 24px 0 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__window {
    width: 100vw;
    --studio-chatbot-viewport-height: 84dvh;
    height: var(--studio-chatbot-viewport-height);
    max-height: var(--studio-chatbot-viewport-height);
    border-radius: 24px 24px 0 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__sheet-handle,
  .studio-chatbot[data-source="modal"] .studio-chatbot__sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 6px;
    padding-bottom: 2px;
    background: #FFFFFF;
    flex-shrink: 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__sheet-handle::before,
  .studio-chatbot[data-source="modal"] .studio-chatbot__sheet-handle::before {
    content: "";
    width: 48px;
    height: 4px;
    border-radius: 999px;
    background: #D1D5DB;
  }

  .studio-chatbot__messages {
    padding: 40px 20px calc(20px + var(--studio-chatbot-keyboard-offset));
    flex: 1;
  }

  .studio-chatbot__messages--welcome {
    padding-top: 24px;
    padding-bottom: calc(24px + var(--studio-chatbot-keyboard-offset, 0px));
  }

  .studio-chatbot--keyboard-open .studio-chatbot__overlay {
    background-color: rgba(17, 24, 39, 0.62);
  }

  .studio-chatbot__welcome-panel {
    border-radius: 16px;
    padding: 16px;
    transition: background-color 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1), padding 320ms cubic-bezier(0.22, 1, 0.36, 1), transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .studio-chatbot__welcome-avatar {
    width: 76px;
    height: 76px;
  }

  .studio-chatbot__welcome-avatar--idle {
    right: 16px;
    top: 18px;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar .studio-chatbot__welcome-eyebrow,
  .studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar .studio-chatbot__welcome-title,
  .studio-chatbot[data-source="embed"] .studio-chatbot__welcome-panel--with-avatar .studio-chatbot__welcome-text {
    padding-right: 126px;
  }

  .studio-chatbot__welcome-text {
    font-size: 17px;
  }

  .studio-chatbot__welcome-question {
    font-size: 14px;
    min-height: 40px;
  }

  .studio-chatbot__input-area {
    padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  }

  .studio-chatbot__composer {
    min-height: 56px;
  }

  .studio-chatbot__input {
    font-size: 17px;
    min-height: 56px;
    max-height: 56px;
  }

  .studio-chatbot__composer--with-avatar {
    min-height: 60px;
  }

  .studio-chatbot__composer--with-avatar .studio-chatbot__input {
    min-height: 60px;
    max-height: 60px;
    padding-top: 18px;
    padding-bottom: 18px;
    padding-left: 60px;
    padding-right: 68px;
  }

  .studio-chatbot__composer-avatar {
    left: 12px;
    width: 44px;
    height: 44px;
  }

  .studio-chatbot__message-body--assistant {
    gap: 12px;
  }

  .studio-chatbot__message-avatar {
    width: 72px;
    height: 72px;
  }

  .studio-chatbot__message-avatar--inline {
    width: 48px;
    height: 48px;
  }

  .studio-chatbot__welcome-panel > * {
    transition: max-height 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1), margin 320ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  .studio-chatbot__messages {
    padding-left: 24px;
    padding-right: 24px;
    gap: 12px;
  }

  .studio-chatbot__stream-dock {
    gap: 12px;
  }

  .studio-chatbot__input-area {
    padding: 8px 24px calc(env(safe-area-inset-bottom) + 24px);
  }

  .article-chat-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .article-chat-modal {
    width: 100vw;
    --studio-chatbot-viewport-height: 84dvh;
    height: var(--studio-chatbot-viewport-height);
    max-height: var(--studio-chatbot-viewport-height);
    border-radius: 24px 24px 0 0;
  }

  .studio-chatbot__overlay {
    align-items: flex-end;
    padding: 0;
  }

  .studio-chatbot__window {
    width: 100vw;
    --studio-chatbot-viewport-height: 84dvh;
    height: var(--studio-chatbot-viewport-height);
    max-height: var(--studio-chatbot-viewport-height);
    border-radius: 24px 24px 0 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__overlay {
    align-items: flex-end;
    padding: 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__window {
    width: 100vw;
    --studio-chatbot-viewport-height: 84dvh;
    height: var(--studio-chatbot-viewport-height);
    max-height: var(--studio-chatbot-viewport-height);
    border-radius: 24px 24px 0 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__sheet-handle,
  .studio-chatbot[data-source="modal"] .studio-chatbot__sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    padding-bottom: 4px;
    background: #FFFFFF;
    flex-shrink: 0;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__sheet-handle::before,
  .studio-chatbot[data-source="modal"] .studio-chatbot__sheet-handle::before {
    content: "";
    width: 48px;
    height: 4px;
    border-radius: 999px;
    background: #D1D5DB;
  }
}

@media (min-width: 768px) {
  .article-chat-modal-overlay {
    align-items: center;
    padding: 24px;
  }

  .studio-chatbot__overlay {
    align-items: center;
    padding: 24px;
  }

  .studio-chatbot__header {
    padding: 12px 24px;
  }

  .studio-chatbot[data-source="embed"] .studio-chatbot__header,
  .studio-chatbot[data-source="modal"] .studio-chatbot__header {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .studio-chatbot__messages {
    padding: 40px 24px calc(16px + var(--studio-chatbot-keyboard-offset, 0px));
    gap: 12px;
  }

  .studio-chatbot__stream-dock {
    gap: 12px;
  }

  .studio-chatbot__messages--welcome {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .studio-chatbot__welcome-panel {
    padding: 28px;
  }

  .studio-chatbot__welcome-title {
    margin-top: 12px;
    font-size: clamp(3rem, 6vw, 3.5rem);
  }

  .studio-chatbot__welcome-text {
    margin-top: 12px;
    font-size: 21px;
  }

  .studio-chatbot__welcome-quickstart {
    margin-top: 18px;
  }

  .studio-chatbot__welcome-question {
    font-size: 17px;
  }

  .studio-chatbot__message-bubble {
    max-width: 85%;
  }

  .studio-chatbot__message-text {
    font-size: 16px;
  }

  .studio-chatbot__link-btn {
    width: auto;
  }

  .studio-chatbot__followup-fade {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 56px;
    background: linear-gradient(to left, #FFFFFF, rgba(255, 255, 255, 0.7), transparent);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s ease;
  }

  .studio-chatbot__external-links {
    padding: 8px 24px;
  }

  .studio-chatbot__input-area {
    padding: 8px 24px calc(env(safe-area-inset-bottom) + 24px);
  }
}

@media (min-width: 1024px) {
  .studio-chatbot__messages {
    padding-left: 32px;
    padding-right: 32px;
  }

  .studio-chatbot__input-area {
    padding-left: 32px;
    padding-right: 32px;
  }

  .studio-chatbot__welcome-title {
    font-size: clamp(3.5rem, 5vw, 4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-chatbot__bubble {
    animation: none;
  }

  .studio-chatbot__bubble::after,
  .studio-chatbot__bubble-text,
  .studio-chatbot__bubble-badge {
    animation: none;
  }

  .studio-chatbot__typing-dot {
    animation: none;
    opacity: 0.7;
  }

  .studio-chatbot__bubble-avatar--idle,
  .studio-chatbot__bubble-avatar.fitty-bob,
  .studio-chatbot__welcome-avatar--idle,
  .studio-chatbot__message-avatar.fitty-idle,
  .studio-chatbot__message-avatar.fitty-bob {
    animation: none;
  }

  .studio-chatbot__spinner {
    animation-duration: 2.4s;
  }

  .studio-chatbot *,
  .studio-chatbot *::before,
  .studio-chatbot *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ── Toast ── */

.studio-chatbot__toast {
  position: fixed;
  bottom: 90px;
  right: 24px;
  background: #1D1D1F;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.studio-chatbot__toast--visible {
  opacity: 1;
  transform: translateY(0);
}
