.lc-ai-widget {
  --lc-mobile-width: clamp(280px, 82vw, 420px);
  --lc-mobile-height: clamp(56px, 12vh, 96px);
  --lc-mobile-offset: clamp(16px, 5vw, 48px);
  --lc-mobile-radius: clamp(18px, 6vw, 32px);
  --lc-mobile-icon: clamp(20px, 5vh, 36px);

  width: var(--lc-mobile-width);
  height: var(--lc-mobile-height);
  right: var(--lc-mobile-offset) !important;
  bottom: var(--lc-mobile-offset) !important;
  border-radius: var(--lc-mobile-radius) !important;
  --lc-trigger-radius: var(--lc-mobile-radius);
  --lc-widget-radius: var(--lc-mobile-radius);
  --lc-panel-radius: var(--lc-mobile-radius);
  --lc-trigger-icon-size: var(--lc-mobile-icon);
}

.lc-ai-panel {
  /* Mobile: use true fullscreen for consistent UX */
  position: fixed !important;
  inset: 0 !important; /* top/left/right/bottom = 0 */
  width: 100vw !important;
  height: 100dvh !important; /* modern dynamic viewport */
  z-index: 2147483647 !important; /* ensure above page UI */
  border-radius: 0 !important;
  /* Safe-area paddings for notches */
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@supports not (height: 100dvh) {
  .lc-ai-panel {
    height: calc(var(--lc-vh, 1vh) * 100) !important; /* fallback for iOS */
  }
}

.lc-ai-widget[data-state="open"] {
  /* Expand widget container to fullscreen when open */
  width: 100vw !important;
  height: 100dvh !important;
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  border-radius: 0 !important;
}

@supports not (height: 100dvh) {
  .lc-ai-widget[data-state="open"] {
    height: calc(var(--lc-vh, 1vh) * 100) !important;
  }
}

.lc-ai-inputbar {
  border-top: 0px solid var(--lc-inputbar-border, rgba(10, 0, 77, 0.08));
  padding: 0.25rem;
  display: flex;
  align-items: flex-end;
  border-radius: var(--lc-inputbar-radius, 10px) !important;
  gap: 0.1rem;
  position: relative;
  background: var(--lc-inputbar-bg, transparent);
  padding-bottom: max(0.25rem, env(safe-area-inset-bottom, 0));
}

/* Prevent iOS auto-zoom on focus: inputs <16px trigger zoom */
.lc-ai-inputbar .lc-ai-input,
.lc-ai-inputbar input,
.lc-ai-inputbar textarea,
.lc-ai-inputbar select {
  font-size: 16px !important;
  line-height: 1.35 !important;
}

/* Avoid unexpected text scaling on iOS */
.lc-ai-widget {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.lc-ai-attach .lc-ai-icon,
.lc-ai-audio .lc-ai-icon {
  width: 2rem;
  height: 2.6rem;
  display: block;
}

/* Lock page scroll when the chat is open fullscreen */
body.lc-ai-modal-open {
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: contain;
}

/* Slight top padding for header to avoid notch overlap */
.lc-ai-header {
  padding-top: max(0.5rem, env(safe-area-inset-top, 0));
}
