/* =========================================================
   Elecam Chatbot Widget — Production CSS
   Self-contained styles, no external CSS dependencies.
   All selectors namespaced under .ec-widget to avoid collisions.
   ========================================================= */

/* ── Fonts (from Google Fonts) ── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ── Local design tokens, scoped to widget ── */
.ec-widget {
  /* Brand */
  --ecw-primary:        #F36F21;
  --ecw-primary-light:  #FFD8BD;
  --ecw-primary-dark:   #C25412;
  --ecw-primary-dim:    rgba(243, 111, 33, 0.12);
  --ecw-primary-grad:   linear-gradient(135deg, #FF8A3C 0%, #F36F21 50%, #D85A0B 100%);
  --ecw-secondary:      #244C74;

  /* Neutral */
  --ecw-neutral-50:  #F9FAFB;
  --ecw-neutral-100: #F3F4F6;
  --ecw-neutral-200: #E5E7EB;
  --ecw-neutral-300: #D1D5DB;
  --ecw-neutral-400: #9CA3AF;
  --ecw-neutral-500: #6B7280;
  --ecw-neutral-600: #4B5563;

  /* Semantic */
  --ecw-success:     #1FB47E;
  --ecw-success-bg:  #D5F5E7;
  --ecw-success-dark:#0E8F5F;
  --ecw-error:       #E0443E;
  --ecw-error-bg:    #FBD3D1;
  --ecw-error-dark:  #B8211C;

  /* Surface / text */
  --ecw-bg:           #F6F7FB;
  --ecw-surface:      #FFFFFF;
  --ecw-text:         #2C2E3A;
  --ecw-text-secondary: #4A4C59;
  --ecw-text-muted:   #6E7282;
  --ecw-text-disabled:#B9BDCA;
  --ecw-border:       #E2E6EF;
  --ecw-border-light: #EEF1F8;

  /* Radius / shadow */
  --ecw-radius-sm:    8px;
  --ecw-radius-md:    12px;
  --ecw-radius-lg:    20px;
  --ecw-shadow-sm:    0px 2px 4px rgba(17, 24, 39, 0.04);
  --ecw-shadow-md:    0px 6px 16px rgba(17, 37, 64, 0.12);
  --ecw-shadow-soft:  0px 10px 30px rgba(17, 24, 39, 0.08);

  /* Easing */
  --ecw-ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --ecw-ease-spring:  cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Type */
  --ecw-font-sans:    "Inter", system-ui, -apple-system, sans-serif;
  --ecw-font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --ecw-font-mono:    "JetBrains Mono", "Menlo", "Monaco", monospace;

  /* Position offsets — overridable via JS config */
  --ecw-offset-bottom: 24px;
  --ecw-offset-side:   24px;

  /* Z-index */
  --ecw-z: 2147483000;

  font-family: var(--ecw-font-sans);
  color: var(--ecw-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ec-widget *, .ec-widget *::before, .ec-widget *::after {
  box-sizing: border-box;
}

/* ── Anchor (positions the FAB + panel) ─────────────────── */
.ec-widget {
  position: fixed;
  bottom: var(--ecw-offset-bottom);
  z-index: var(--ecw-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
.ec-widget[data-position="right"] { right: var(--ecw-offset-side); align-items: flex-end; }
.ec-widget[data-position="left"]  { left: var(--ecw-offset-side); align-items: flex-start; }

.ec-widget > * { pointer-events: auto; }

/* ── FAB ─────────────────────────────────────────────────── */
.ec-widget .ecw-fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ecw-primary-grad);
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(243,111,33,.4), 0 2px 6px rgba(243,111,33,.2);
  position: relative;
  transition: transform 200ms var(--ecw-ease-spring), box-shadow 200ms var(--ecw-ease);
  padding: 0;
}
.ec-widget .ecw-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 18px 40px rgba(243,111,33,.5);
}
.ec-widget .ecw-fab:focus-visible {
  outline: 3px solid rgba(255,216,189,.5);
  outline-offset: 2px;
}
.ec-widget .ecw-fab svg.icon {
  width: 26px; height: 26px;
  color: #fff;
  transition: transform 250ms var(--ecw-ease);
}
.ec-widget[data-open="true"] .ecw-fab svg.icon {
  transform: rotate(90deg) scale(.85);
}
.ec-widget .ecw-fab .badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--ecw-error); color: #fff;
  border-radius: 9px; border: 2px solid var(--ecw-bg);
  font: 700 10px/14px var(--ecw-font-sans);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Panel ───────────────────────────────────────────────── */
.ec-widget .ecw-panel {
  width: 460px;
  height: min(680px, calc(100vh - 120px));
  margin-bottom: 12px;
  background: var(--ecw-surface);
  border: 1px solid var(--ecw-border);
  border-radius: var(--ecw-radius-lg);
  box-shadow: var(--ecw-shadow-soft);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: ecwPop .25s var(--ecw-ease-spring);
}
.ec-widget[data-position="left"] .ecw-panel { transform-origin: bottom left; }

@media (max-width: 480px) {
  .ec-widget .ecw-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
}

/* ── Header ──────────────────────────────────────────────── */
.ec-widget .ecw-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ecw-border-light);
  background: var(--ecw-surface);
  flex-shrink: 0;
}
.ec-widget .ecw-head-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ecw-primary-grad);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset, 0 2px 6px rgba(243,111,33,.25);
  position: relative;
}
.ec-widget .ecw-head-avatar svg { width: 22px; height: 22px; color: #fff; }
.ec-widget .ecw-head-avatar img.ecw-agent-icon { width: 24px; height: 24px; display: block; user-select: none; -webkit-user-drag: none; }
.ec-widget .ecw-head-avatar::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ecw-success); border: 2px solid var(--ecw-surface);
}
.ec-widget .ecw-head-titles { flex: 1; min-width: 0; line-height: 1.2; }
.ec-widget .ecw-head-name { font: 600 14px/1.2 var(--ecw-font-display); letter-spacing: -.01em; color: var(--ecw-text); }
.ec-widget .ecw-head-status { font: 500 11px/1.3 var(--ecw-font-sans); color: var(--ecw-text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.ec-widget .ecw-head-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ecw-success); }
.ec-widget .ecw-head-actions { display: flex; align-items: center; gap: 4px; }
.ec-widget .ecw-icon-btn {
  width: 32px; height: 32px;
  background: transparent; border: 0; border-radius: var(--ecw-radius-sm);
  color: var(--ecw-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 150ms var(--ecw-ease);
  cursor: pointer; padding: 0;
}
.ec-widget .ecw-icon-btn:hover { background: var(--ecw-neutral-100); color: var(--ecw-text); }
.ec-widget .ecw-icon-btn.is-close:hover { color: var(--ecw-error); }
.ec-widget .ecw-icon-btn svg { width: 16px; height: 16px; }

/* ── Body ────────────────────────────────────────────────── */
.ec-widget .ecw-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.ec-widget .ecw-body::-webkit-scrollbar { width: 6px; }
.ec-widget .ecw-body::-webkit-scrollbar-thumb { background: var(--ecw-neutral-200); border-radius: 3px; }

.ec-widget .ecw-day {
  display: flex; align-items: center; gap: 10px;
  font: 900 9px/1 var(--ecw-font-sans);
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ecw-neutral-500);
  margin: 4px 0 2px;
}
.ec-widget .ecw-day::before, .ec-widget .ecw-day::after { content: ""; flex: 1; height: 1px; background: var(--ecw-border-light); }

/* ── Empty state ─────────────────────────────────────────── */
.ec-widget .ecw-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 16px; gap: 8px;
}
.ec-widget .ecw-empty-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ecw-primary-grad);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset, 0 8px 24px rgba(243,111,33,.28);
  animation: ecwFadeIn .5s var(--ecw-ease-spring) both;
}
.ec-widget .ecw-empty-mark svg { width: 32px; height: 32px; color: #fff; }
.ec-widget .ecw-empty-mark img.ecw-agent-icon { width: 36px; height: 36px; display: block; user-select: none; -webkit-user-drag: none; }
.ec-widget .ecw-empty h3 { font: 600 18px/1.2 var(--ecw-font-display); letter-spacing: -.015em; color: var(--ecw-text); margin: 0; }
.ec-widget .ecw-empty p { font: 400 13.5px/1.5 var(--ecw-font-sans); color: var(--ecw-text-muted); max-width: 320px; margin: 0; }

.ec-widget .ecw-suggestions {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
}
.ec-widget .ecw-suggestion {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px;
  background: var(--ecw-surface);
  border: 1px solid var(--ecw-border);
  border-radius: var(--ecw-radius-md);
  font: 500 13px/1.4 var(--ecw-font-sans);
  color: var(--ecw-text);
  text-align: left;
  cursor: pointer;
  transition: all 150ms var(--ecw-ease);
  animation: ecwFadeIn .4s var(--ecw-ease) both;
  font-family: inherit;
}
.ec-widget .ecw-suggestion:nth-child(1) { animation-delay: .05s; }
.ec-widget .ecw-suggestion:nth-child(2) { animation-delay: .12s; }
.ec-widget .ecw-suggestion:nth-child(3) { animation-delay: .19s; }
.ec-widget .ecw-suggestion:nth-child(4) { animation-delay: .26s; }
.ec-widget .ecw-suggestion:hover {
  border-color: var(--ecw-primary);
  background: var(--ecw-primary-dim);
  transform: translateY(-1px);
}
.ec-widget .ecw-suggestion svg { width: 15px; height: 15px; color: var(--ecw-primary); flex-shrink: 0; margin-top: 2px; }
.ec-widget .ecw-suggestion .label { display: block; }
.ec-widget .ecw-suggestion .hint { font: 500 11px/1.3 var(--ecw-font-sans); color: var(--ecw-text-muted); margin-top: 2px; display: block; }

/* ── Messages ────────────────────────────────────────────── */
.ec-widget .ecw-msg { display: flex; gap: 10px; max-width: 100%; animation: ecwFadeIn .35s var(--ecw-ease) both; }
.ec-widget .ecw-msg.is-user { justify-content: flex-end; }
.ec-widget .ecw-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ecw-primary-grad);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset;
  margin-top: 2px;
}
.ec-widget .ecw-msg-avatar svg { width: 16px; height: 16px; color: #fff; }
.ec-widget .ecw-msg-avatar img.ecw-agent-icon { width: 18px; height: 18px; display: block; user-select: none; -webkit-user-drag: none; }
.ec-widget[data-show-avatar="false"] .ecw-msg-avatar { display: none; }

.ec-widget .ecw-bubble {
  max-width: 78%;
  padding: 11px 14px;
  border-radius: 16px;
  font: 400 14px/1.55 var(--ecw-font-sans);
  word-wrap: break-word;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble {
  background: var(--ecw-neutral-100);
  color: var(--ecw-text);
  border-top-left-radius: 6px;
}
.ec-widget .ecw-msg.is-user .ecw-bubble {
  background: var(--ecw-secondary);
  color: #fff;
  border-top-right-radius: 6px;
}
.ec-widget .ecw-bubble strong { font-weight: 600; }
.ec-widget .ecw-bubble code { font-family: var(--ecw-font-mono); font-size: 12.5px; background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.ec-widget .ecw-msg.is-user .ecw-bubble code { background: rgba(255,255,255,.16); }

.ec-widget .ecw-msg-stack { display: flex; flex-direction: column; max-width: 78%; min-width: 0; }
.ec-widget .ecw-msg-stack .ecw-bubble { max-width: 100%; }

.ec-widget .ecw-caret {
  display: inline-block; width: 7px; height: 14px;
  background: var(--ecw-primary);
  margin-left: 2px; vertical-align: -2px;
  border-radius: 1px;
  animation: ecwBlink 1s steps(2, start) infinite;
}

.ec-widget .ecw-typing {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 12px 14px;
}
.ec-widget .ecw-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ecw-neutral-400);
  animation: ecwBounce 1.2s var(--ecw-ease) infinite;
}
.ec-widget .ecw-typing span:nth-child(2) { animation-delay: .15s; }
.ec-widget .ecw-typing span:nth-child(3) { animation-delay: .3s; }

/* Sources */
.ec-widget .ecw-sources { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.ec-widget .ecw-sources-caps { font: 900 9px/1 var(--ecw-font-sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ecw-neutral-500); margin-bottom: 4px; }
.ec-widget .ecw-source {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--ecw-surface);
  border: 1px solid var(--ecw-border-light);
  border-radius: var(--ecw-radius-sm);
  font: 500 12px/1.3 var(--ecw-font-sans);
  color: var(--ecw-text-secondary);
  cursor: pointer;
  transition: all 150ms var(--ecw-ease);
  text-decoration: none;
}
.ec-widget .ecw-source:hover { border-color: var(--ecw-primary); color: var(--ecw-primary-dark); background: var(--ecw-primary-dim); }
.ec-widget .ecw-source .num {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ecw-primary-dim); color: var(--ecw-primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 10px/1 var(--ecw-font-mono); flex-shrink: 0;
}
.ec-widget .ecw-source .meta { color: var(--ecw-text-muted); font-size: 11px; margin-left: auto; }

/* Quick actions */
.ec-widget .ecw-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ec-widget .ecw-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  background: var(--ecw-surface);
  border: 1px solid var(--ecw-border);
  border-radius: 9999px;
  font: 600 12px/1 var(--ecw-font-sans);
  color: var(--ecw-text-secondary);
  cursor: pointer;
  transition: all 150ms var(--ecw-ease);
  font-family: inherit;
}
.ec-widget .ecw-action:hover { border-color: var(--ecw-primary); color: var(--ecw-primary-dark); background: var(--ecw-primary-dim); }
.ec-widget .ecw-action svg { width: 12px; height: 12px; }

/* Feedback */
.ec-widget .ecw-fb {
  display: flex; align-items: center; gap: 2px;
  margin-top: 6px; margin-left: 4px;
}
.ec-widget .ecw-fb-btn {
  width: 26px; height: 26px;
  background: transparent; border: 0; border-radius: var(--ecw-radius-sm);
  color: var(--ecw-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 150ms var(--ecw-ease);
  padding: 0;
}
.ec-widget .ecw-fb-btn:hover { background: var(--ecw-neutral-100); color: var(--ecw-text); }
.ec-widget .ecw-fb-btn.is-active { color: var(--ecw-primary); background: var(--ecw-primary-dim); }
.ec-widget .ecw-fb-btn.is-active.down { color: var(--ecw-error-dark); background: var(--ecw-error-bg); }
.ec-widget .ecw-fb-btn svg { width: 13px; height: 13px; }
.ec-widget .ecw-fb-time { margin-left: auto; font: 500 10px/1 var(--ecw-font-sans); color: var(--ecw-text-muted); }

/* ── Composer ───────────────────────────────────────────── */
.ec-widget .ecw-composer-wrap {
  border-top: 1px solid var(--ecw-border-light);
  padding: 12px 16px 14px;
  background: var(--ecw-surface);
  flex-shrink: 0;
  position: relative;
}
.ec-widget .ecw-composer {
  display: flex; align-items: center; gap: 8px;
  background: var(--ecw-neutral-50);
  border: 1px solid var(--ecw-border);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: all 150ms var(--ecw-ease);
}
.ec-widget .ecw-composer:focus-within {
  border-color: var(--ecw-primary);
  box-shadow: 0 0 0 3px rgba(255,216,189,.35);
  background: var(--ecw-surface);
}
.ec-widget .ecw-composer textarea {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  resize: none;
  font: 400 14px/1.45 var(--ecw-font-sans);
  color: var(--ecw-text);
  min-height: 24px;
  max-height: 140px;
  padding: 4px 0;
  align-self: center;
  /* Scroll funciona con teclado/wheel pero la barra no se pinta. */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}
.ec-widget .ecw-composer textarea::-webkit-scrollbar { display: none; }  /* WebKit (Chrome, Safari, Edge moderno) */
.ec-widget .ecw-composer textarea::placeholder { color: var(--ecw-text-muted); }
.ec-widget .ecw-composer-actions { display: flex; align-items: center; gap: 2px; }
.ec-widget .ecw-send {
  width: 34px; height: 34px;
  background: var(--ecw-primary);
  color: #fff;
  border: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 150ms var(--ecw-ease);
  flex-shrink: 0; padding: 0;
}
.ec-widget .ecw-send:hover:not(:disabled) { background: var(--ecw-primary-dark); transform: translateY(-1px); }
.ec-widget .ecw-send:disabled { background: var(--ecw-neutral-200); color: var(--ecw-text-disabled); cursor: not-allowed; }
.ec-widget .ecw-send svg { width: 16px; height: 16px; }
.ec-widget .ecw-icon-btn.composer { width: 34px; height: 34px; }

.ec-widget .ecw-composer-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  font: 500 11px/1 var(--ecw-font-sans);
  color: var(--ecw-text-muted);
}
.ec-widget .ecw-composer-foot .left { display: flex; align-items: center; gap: 14px; }
.ec-widget .ecw-composer-foot .right { font-family: var(--ecw-font-mono); }
.ec-widget .ecw-composer-foot .pill { display: inline-flex; align-items: center; gap: 4px; }
.ec-widget .ecw-composer-foot .pill svg { width: 11px; height: 11px; color: var(--ecw-primary); }

/* Slash commands */
.ec-widget .ecw-slash {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 100%;
  margin-bottom: 6px;
  background: var(--ecw-surface);
  border: 1px solid var(--ecw-border);
  border-radius: var(--ecw-radius-md);
  box-shadow: var(--ecw-shadow-md);
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  animation: ecwPop .18s var(--ecw-ease-spring);
  z-index: 5;
}
.ec-widget .ecw-slash-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--ecw-radius-sm);
  background: transparent; border: 0; text-align: left;
  font: 500 13px/1.2 var(--ecw-font-sans); color: var(--ecw-text);
  cursor: pointer; font-family: inherit;
}
.ec-widget .ecw-slash-item:hover, .ec-widget .ecw-slash-item.is-active { background: var(--ecw-primary-dim); color: var(--ecw-primary-dark); }
.ec-widget .ecw-slash-item .cmd { font-family: var(--ecw-font-mono); font-weight: 700; font-size: 12px; color: var(--ecw-primary-dark); min-width: 76px; }
.ec-widget .ecw-slash-item .desc { color: var(--ecw-text-muted); font-weight: 500; font-size: 12px; }

/* Attachment preview in composer */
.ec-widget .ecw-attach-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--ecw-neutral-50);
  border: 1px solid var(--ecw-border-light);
  border-radius: var(--ecw-radius-sm);
  margin-bottom: 8px;
  font: 500 12px/1.2 var(--ecw-font-sans);
  color: var(--ecw-text-secondary);
}
.ec-widget .ecw-attach-preview svg { width: 14px; height: 14px; color: var(--ecw-primary); }
.ec-widget .ecw-attach-preview .filename { color: var(--ecw-text); font-weight: 600; }
.ec-widget .ecw-attach-preview .size { color: var(--ecw-text-muted); font-family: var(--ecw-font-mono); font-size: 11px; }
.ec-widget .ecw-attach-preview .x { margin-left: auto; cursor: pointer; color: var(--ecw-text-muted); border: 0; background: transparent; padding: 4px; border-radius: 4px; }
.ec-widget .ecw-attach-preview .x:hover { color: var(--ecw-error); background: var(--ecw-surface); }

/* ── Markdown rendering inside bot bubbles ─────────────────
   Marked produce HTML estructurado (p, ul, ol, code, pre, table, etc.).
   Compactamos los márgenes para que encaje en una burbuja de chat. */
.ec-widget .ecw-msg.is-bot .ecw-bubble > :first-child { margin-top: 0; }
.ec-widget .ecw-msg.is-bot .ecw-bubble > :last-child  { margin-bottom: 0; }
.ec-widget .ecw-msg.is-bot .ecw-bubble p { margin: 0 0 8px; }
.ec-widget .ecw-msg.is-bot .ecw-bubble ul,
.ec-widget .ecw-msg.is-bot .ecw-bubble ol { margin: 4px 0 8px; padding-left: 22px; }
.ec-widget .ecw-msg.is-bot .ecw-bubble li { margin: 2px 0; }
.ec-widget .ecw-msg.is-bot .ecw-bubble li > p { margin: 0; } /* GFM loose lists */
.ec-widget .ecw-msg.is-bot .ecw-bubble h1,
.ec-widget .ecw-msg.is-bot .ecw-bubble h2,
.ec-widget .ecw-msg.is-bot .ecw-bubble h3,
.ec-widget .ecw-msg.is-bot .ecw-bubble h4 {
  font: 600 14px/1.3 var(--ecw-font-display);
  margin: 8px 0 4px;
  letter-spacing: -.01em;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble a {
  color: var(--ecw-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble a:hover { color: var(--ecw-primary-dark); }
.ec-widget .ecw-msg.is-bot .ecw-bubble code {
  font: 500 12.5px/1.4 var(--ecw-font-mono);
  background: rgba(36,76,116,.08);
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-word;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble pre {
  background: var(--ecw-neutral-50);
  border: 1px solid var(--ecw-border-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0 8px;
  overflow-x: auto;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble pre code {
  background: transparent; padding: 0; border-radius: 0;
  font-size: 12px;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble blockquote {
  border-left: 3px solid var(--ecw-primary);
  padding: 0 0 0 10px;
  margin: 6px 0;
  color: var(--ecw-text-muted);
}
.ec-widget .ecw-msg.is-bot .ecw-bubble hr {
  border: 0; border-top: 1px solid var(--ecw-border-light); margin: 8px 0;
}
.ec-widget .ecw-msg.is-bot .ecw-bubble strong { font-weight: 600; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes ecwFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ecwPop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ecwBlink { to { opacity: 0; } }
@keyframes ecwBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ec-widget *, .ec-widget *::before, .ec-widget *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
