/* ==========================================================================
   Niwa Chatbot – Layout
   ========================================================================== */

/* ── Widget Root ────────────────────────────────────────────────────────── */
.niwa-widget {
  font-family: var(--niwa-font-family);
  font-size: var(--niwa-font-size-md);
  line-height: var(--niwa-line-height-normal);
  color: var(--niwa-color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Inline Widget (Shortcode) ──────────────────────────────────────────── */
.niwa-widget--inline {
  position: relative;
  width: 100%;
}

.niwa-shortcode {
  display: flex;
  flex-direction: column;
  background: var(--niwa-color-surface-base);
  border: 1px solid var(--niwa-color-border-default);
  border-radius: var(--niwa-radius-xl);
  overflow: hidden;
  min-height: 400px;
  max-height: 600px;
}

.niwa-shortcode__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* Flex column layout — messages are appended here directly by JS. */
  display: flex;
  flex-direction: column;
  padding: var(--niwa-space-sm) 0;
  gap: var(--niwa-space-xs);
}

.niwa-shortcode__input {
  display: flex;
  align-items: flex-end;
  gap: var(--niwa-space-sm);
  padding: var(--niwa-space-sm) var(--niwa-space-md);
  border-top: 1px solid var(--niwa-color-border-subtle);
  background: var(--niwa-color-surface-raised);
}

.niwa-shortcode__input .niwa-morph__textarea {
  flex: 1;
}

/* ── Reduced Motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .niwa-widget *,
  .niwa-widget *::before,
  .niwa-widget *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
