/*
 * Weavelinx Chatbot — client widget (v1.3 redesign)
 * Self-contained: no Tailwind, no external dependencies.
 *
 * Three themes (dark / light / warm) are plain variable sets on the root.
 * The accent colour is set at runtime by chatbot.js from the Appearance tab,
 * so every theme picks it up without a rebuild.
 *
 * Every selector is anchored on #wlx-chat-root: WordPress themes style bare
 * button, a, img and ul elements aggressively, and an id outranks all of it.
 */

/* ── Theme tokens ───────────────────────────────────────────────────────── */
#wlx-chat-root {
  --wlx-accent:        #3b82f6;
  --wlx-accent-dark:   #2563eb;
  --wlx-accent-light:  rgba(59,130,246,0.14);
  --wlx-accent-border: rgba(59,130,246,0.32);
  --wlx-on-accent:     #ffffff;
  --wlx-ok:            #10b981;
  --wlx-warn:          #f59e0b;

  /* dark (default) — the "exact reference" design */
  --wlx-bg:          #0b0f19;
  --wlx-surface:     #121926;
  --wlx-inner:       #0e1420;
  --wlx-raised:      #182338;
  --wlx-line:        #1e2a3c;
  --wlx-line-2:      #2a3850;
  --wlx-head:        #ffffff;
  --wlx-text:        #e2e8f0;
  --wlx-muted:       #94a3b8;
  --wlx-faint:       #64748b;
  --wlx-user-bg:     #1f2b3e;
  --wlx-user-text:   #e2e8f0;
  --wlx-input-bg:    #111827;
  --wlx-shadow:      0 24px 64px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.35);
  --wlx-img-bg:      #0f172a;
  --wlx-scrollbar:   #1e293b;

  --wlx-radius:      20px;
  --wlx-z:           2147483000;
  --wlx-offset-x:    24px;
  --wlx-offset-y:    24px;
  --wlx-font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* light — "clean crisp SaaS" */
#wlx-chat-root.wlx-theme-light {
  --wlx-bg:          #ffffff;
  --wlx-surface:     #f8fafc;
  --wlx-inner:       #ffffff;
  --wlx-raised:      #f1f5f9;
  --wlx-line:        #e2e8f0;
  --wlx-line-2:      #cbd5e1;
  --wlx-head:        #0f172a;
  --wlx-text:        #334155;
  --wlx-muted:       #64748b;
  --wlx-faint:       #94a3b8;
  --wlx-user-bg:     var(--wlx-accent);
  --wlx-user-text:   var(--wlx-on-accent);
  --wlx-input-bg:    #f8fafc;
  --wlx-shadow:      0 24px 60px rgba(15,23,42,0.16), 0 2px 8px rgba(15,23,42,0.06);
  --wlx-img-bg:      #e2e8f0;
  --wlx-scrollbar:   #cbd5e1;
}

/* warm — "warm editorial light" */
#wlx-chat-root.wlx-theme-warm {
  --wlx-bg:          #fdfcfa;
  --wlx-surface:     #faf8f5;
  --wlx-inner:       #ffffff;
  --wlx-raised:      #f3efe8;
  --wlx-line:        #ebe5dc;
  --wlx-line-2:      #d9d0c3;
  --wlx-head:        #1c1917;
  --wlx-text:        #3f3a36;
  --wlx-muted:       #78716c;
  --wlx-faint:       #a8a29e;
  --wlx-user-bg:     #292524;
  --wlx-user-text:   #fafaf9;
  --wlx-input-bg:    #f6f3ee;
  --wlx-shadow:      0 24px 60px rgba(41,37,36,0.16), 0 2px 8px rgba(41,37,36,0.06);
  --wlx-img-bg:      #ebe5dc;
  --wlx-scrollbar:   #d9d0c3;
}

/* ── Reset (scoped) ─────────────────────────────────────────────────────── */
#wlx-chat-root,
#wlx-chat-root *,
#wlx-chat-root *::before,
#wlx-chat-root *::after {
  box-sizing: border-box;
}
#wlx-chat-root * {
  margin: 0;
  padding: 0;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
}
#wlx-chat-root button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  box-shadow: none;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
#wlx-chat-root a { text-decoration: none; color: inherit; box-shadow: none; border: 0; }
#wlx-chat-root img { max-width: none; border: 0; border-radius: 0; box-shadow: none; display: block; }
#wlx-chat-root ul, #wlx-chat-root ol { list-style: none; }
#wlx-chat-root svg { display: block; flex-shrink: 0; }
#wlx-chat-root :focus { outline: none; }
#wlx-chat-root :focus-visible { outline: 2px solid var(--wlx-accent); outline-offset: 2px; }

/* ── Root ───────────────────────────────────────────────────────────────── */
#wlx-chat-root {
  position: fixed;
  bottom: var(--wlx-offset-y);
  right: var(--wlx-offset-x);
  z-index: var(--wlx-z);
  font-family: var(--wlx-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--wlx-text);
  -webkit-font-smoothing: antialiased;
}
#wlx-chat-root.wlx-pos-left { right: auto; left: var(--wlx-offset-x); }

/* ── Launcher ───────────────────────────────────────────────────────────── */
#wlx-chat-root #wlx-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wlx-accent);
  color: var(--wlx-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px var(--wlx-accent-border), 0 2px 6px rgba(0,0,0,0.18);
  transition: transform .2s ease, background .2s ease;
  position: relative;
}
#wlx-chat-root #wlx-bubble:hover { transform: translateY(-2px) scale(1.04); background: var(--wlx-accent-dark); }
#wlx-chat-root #wlx-bubble svg { width: 26px; height: 26px; }
#wlx-chat-root #wlx-bubble .wlx-icon-close { display: none; }
#wlx-chat-root #wlx-bubble.wlx-open .wlx-icon-open  { display: none; }
#wlx-chat-root #wlx-bubble.wlx-open .wlx-icon-close { display: block; }
#wlx-chat-root #wlx-bubble .wlx-bubble-dot {
  position: absolute; top: 2px; right: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--wlx-ok); border: 2px solid #fff;
}
#wlx-chat-root #wlx-bubble.wlx-open .wlx-bubble-dot { display: none; }
@keyframes wlx-pulse {
  0%, 100% { box-shadow: 0 10px 30px var(--wlx-accent-border), 0 0 0 0 var(--wlx-accent-border); }
  50%      { box-shadow: 0 10px 30px var(--wlx-accent-border), 0 0 0 12px rgba(0,0,0,0); }
}
#wlx-chat-root #wlx-bubble.wlx-pulse { animation: wlx-pulse 1.8s ease-out 3; }

/* ── Window ─────────────────────────────────────────────────────────────── */
#wlx-chat-root #wlx-window {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: min(410px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 120px));
  background: var(--wlx-bg);
  border: 1px solid var(--wlx-line);
  border-radius: var(--wlx-radius);
  box-shadow: var(--wlx-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
#wlx-chat-root.wlx-pos-left #wlx-window { right: auto; left: 0; transform-origin: bottom left; }
#wlx-chat-root #wlx-window.wlx-visible { opacity: 1; pointer-events: auto; transform: none; }

/* ── Header ─────────────────────────────────────────────────────────────── */
#wlx-chat-root .wlx-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--wlx-line);
  background: var(--wlx-bg);
  position: relative;
  flex-shrink: 0;
}
#wlx-chat-root .wlx-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--wlx-accent-light);
  border: 1px solid var(--wlx-accent-border);
  color: var(--wlx-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  overflow: hidden; flex-shrink: 0;
}
#wlx-chat-root .wlx-avatar img { width: 100%; height: 100%; object-fit: cover; }
#wlx-chat-root .wlx-avatar--sm { width: 32px; height: 32px; font-size: 13px; margin-top: 2px; }
#wlx-chat-root .wlx-head-info { flex: 1; min-width: 0; }
#wlx-chat-root .wlx-head-name {
  font-size: 15.5px; font-weight: 600; color: var(--wlx-head);
  line-height: 1.25; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#wlx-chat-root .wlx-head-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--wlx-muted); margin-top: 2px;
}
#wlx-chat-root .wlx-head-status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--wlx-ok);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
#wlx-chat-root .wlx-head-btn {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--wlx-muted);
  transition: background .15s, color .15s;
}
#wlx-chat-root .wlx-head-btn:hover { background: var(--wlx-raised); color: var(--wlx-head); }
#wlx-chat-root .wlx-head-btn svg { width: 20px; height: 20px; }

#wlx-chat-root .wlx-menu {
  position: absolute; top: 56px; right: 52px;
  min-width: 190px;
  background: var(--wlx-inner);
  border: 1px solid var(--wlx-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  padding: 6px;
  display: none;
  z-index: 5;
}
#wlx-chat-root .wlx-menu.wlx-open { display: block; }
#wlx-chat-root .wlx-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--wlx-text); text-align: left;
}
#wlx-chat-root .wlx-menu-item:hover { background: var(--wlx-raised); color: var(--wlx-head); }
#wlx-chat-root .wlx-menu-item svg { width: 16px; height: 16px; color: var(--wlx-muted); }

/* ── Message list ───────────────────────────────────────────────────────── */
#wlx-chat-root #wlx-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
#wlx-chat-root #wlx-messages::-webkit-scrollbar { width: 6px; }
#wlx-chat-root #wlx-messages::-webkit-scrollbar-thumb { background: var(--wlx-scrollbar); border-radius: 99px; }
#wlx-chat-root #wlx-messages { scrollbar-width: thin; scrollbar-color: var(--wlx-scrollbar) transparent; }

@keyframes wlx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* User */
#wlx-chat-root .wlx-row--user {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  animation: wlx-in .22s ease both;
}
#wlx-chat-root .wlx-ububble {
  max-width: 85%;
  background: var(--wlx-user-bg);
  color: var(--wlx-user-text);
  padding: 10px 15px;
  border-radius: 18px 18px 6px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
#wlx-chat-root .wlx-meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--wlx-faint); padding: 0 4px;
}
#wlx-chat-root .wlx-meta svg { width: 13px; height: 13px; color: var(--wlx-accent); }

/* Bot */
#wlx-chat-root .wlx-row--bot {
  display: flex; align-items: flex-start; gap: 10px;
  animation: wlx-in .25s ease both;
}
#wlx-chat-root .wlx-bcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#wlx-chat-root .wlx-bcard {
  background: var(--wlx-surface);
  border: 1px solid var(--wlx-line);
  border-radius: 6px 18px 18px 18px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
}
#wlx-chat-root .wlx-row--bot .wlx-meta { justify-content: flex-end; }

/* Rich text */
#wlx-chat-root .wlx-text { font-size: 13.5px; line-height: 1.65; color: var(--wlx-text); overflow-wrap: anywhere; }
#wlx-chat-root .wlx-text p + p,
#wlx-chat-root .wlx-text p + ul,
#wlx-chat-root .wlx-text ul + p,
#wlx-chat-root .wlx-text p + ol,
#wlx-chat-root .wlx-text ol + p { margin-top: 10px; }
#wlx-chat-root .wlx-text strong { color: var(--wlx-head); font-weight: 600; }
#wlx-chat-root .wlx-text em { font-style: italic; }
#wlx-chat-root .wlx-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--wlx-raised); padding: 1px 5px; border-radius: 4px;
}
#wlx-chat-root .wlx-text ul { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
#wlx-chat-root .wlx-text ul li { position: relative; padding-left: 18px; }
#wlx-chat-root .wlx-text ul li::before {
  content: ''; position: absolute; left: 3px; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--wlx-accent);
}
#wlx-chat-root .wlx-text ol { margin-top: 6px; counter-reset: wlx-ol; display: flex; flex-direction: column; gap: 5px; }
#wlx-chat-root .wlx-text ol li { position: relative; padding-left: 22px; counter-increment: wlx-ol; }
#wlx-chat-root .wlx-text ol li::before {
  content: counter(wlx-ol) '.'; position: absolute; left: 0; top: 0;
  font-weight: 600; color: var(--wlx-accent); font-size: 12.5px;
}
#wlx-chat-root .wlx-text a { color: var(--wlx-accent); text-decoration: underline; text-underline-offset: 2px; }

/* Typing */
#wlx-chat-root .wlx-typing { flex-direction: row; align-items: center; gap: 5px; padding: 15px 18px; width: max-content; }
#wlx-chat-root .wlx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wlx-muted); animation: wlx-bounce 1.2s infinite ease-in-out; }
#wlx-chat-root .wlx-dot:nth-child(2) { animation-delay: .15s; }
#wlx-chat-root .wlx-dot:nth-child(3) { animation-delay: .3s; }
@keyframes wlx-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Section label inside a card ("Related tools you might like") */
#wlx-chat-root .wlx-label { font-size: 12.5px; font-weight: 600; color: var(--wlx-head); }

/* ── Shared widget bits ─────────────────────────────────────────────────── */
#wlx-chat-root .wlx-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.3;
  background: var(--wlx-accent); color: var(--wlx-on-accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
#wlx-chat-root .wlx-tag svg { width: 11px; height: 11px; }
#wlx-chat-root .wlx-tag--ok   { background: rgba(16,185,129,0.92); color: #fff; }
#wlx-chat-root .wlx-tag--rent { background: #059669; color: #fff; }
#wlx-chat-root .wlx-tag--warn { background: #f59e0b; color: #1c1917; }
#wlx-chat-root .wlx-tag--mute { background: rgba(15,23,42,0.75); color: #fff; }
#wlx-chat-root .wlx-tag--sm   { padding: 2px 6px; font-size: 9.5px; border-radius: 5px; }

#wlx-chat-root .wlx-noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--wlx-faint); background: var(--wlx-img-bg);
}
#wlx-chat-root .wlx-noimg svg { width: 28px; height: 28px; opacity: .7; }

#wlx-chat-root .wlx-pin { display: flex; align-items: center; gap: 4px; color: var(--wlx-muted); font-size: 12px; min-width: 0; }
#wlx-chat-root .wlx-pin svg { width: 13px; height: 13px; color: var(--wlx-accent); }
#wlx-chat-root .wlx-pin span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#wlx-chat-root .wlx-chev { color: var(--wlx-faint); transition: transform .15s, color .15s; }
#wlx-chat-root .wlx-chev svg { width: 16px; height: 16px; }

#wlx-chat-root .wlx-note {
  font-size: 11.5px; color: var(--wlx-muted); font-style: italic;
  display: flex; gap: 5px; align-items: flex-start;
}
#wlx-chat-root .wlx-note svg { width: 12px; height: 12px; margin-top: 2px; color: var(--wlx-accent); }

#wlx-chat-root .wlx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap; text-align: center;
}
#wlx-chat-root .wlx-btn:active { transform: translateY(1px); }
#wlx-chat-root .wlx-btn svg { width: 13px; height: 13px; }
#wlx-chat-root .wlx-btn--primary { background: var(--wlx-accent); color: var(--wlx-on-accent); flex: 1; }
#wlx-chat-root .wlx-btn--primary:hover { background: var(--wlx-accent-dark); }
#wlx-chat-root .wlx-btn--ghost { background: var(--wlx-raised); color: var(--wlx-head); border: 1px solid var(--wlx-line-2); }
#wlx-chat-root .wlx-btn--ghost:hover { border-color: var(--wlx-accent-border); color: var(--wlx-accent); }
#wlx-chat-root .wlx-btn--ghost svg { color: var(--wlx-muted); }

/* ── Property: featured card ────────────────────────────────────────────── */
#wlx-chat-root .wlx-props { display: flex; flex-direction: column; gap: 10px; }
#wlx-chat-root .wlx-pfeat {
  background: var(--wlx-inner);
  border: 1px solid var(--wlx-accent-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
#wlx-chat-root .wlx-pfeat:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
#wlx-chat-root .wlx-pfeat[data-unavailable] { opacity: .75; }
#wlx-chat-root .wlx-gal {
  position: relative; height: 158px; background: var(--wlx-img-bg); overflow: hidden;
}
#wlx-chat-root .wlx-gal img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .3s ease;
}
#wlx-chat-root .wlx-gal img.wlx-on { opacity: 1; }
#wlx-chat-root .wlx-gal::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(2,6,23,0.85) 0%, rgba(2,6,23,0.15) 45%, rgba(2,6,23,0.25) 100%);
}
#wlx-chat-root .wlx-gal-tags { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; }
#wlx-chat-root .wlx-gal-count {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; align-items: center; gap: 5px;
  background: rgba(2,6,23,0.6); color: #fff; backdrop-filter: blur(4px);
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
#wlx-chat-root .wlx-gal-nav {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(2,6,23,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
#wlx-chat-root .wlx-gal-nav svg { width: 14px; height: 14px; }
#wlx-chat-root .wlx-gal-nav--prev { left: 8px; }
#wlx-chat-root .wlx-gal-nav--next { right: 8px; }
#wlx-chat-root .wlx-gal:hover .wlx-gal-nav,
#wlx-chat-root .wlx-gal:focus-within .wlx-gal-nav { opacity: 1; }
@media (hover: none) { #wlx-chat-root .wlx-gal-nav { opacity: .85; } }
#wlx-chat-root .wlx-gal-price {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  color: #fff; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
#wlx-chat-root .wlx-gal-price b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
#wlx-chat-root .wlx-gal-price small { font-size: 12px; color: rgba(255,255,255,0.8); }
#wlx-chat-root .wlx-pbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
#wlx-chat-root .wlx-ptitle { font-size: 14.5px; font-weight: 600; color: var(--wlx-head); line-height: 1.35; }
#wlx-chat-root .wlx-ptitle a:hover { color: var(--wlx-accent); }
#wlx-chat-root .wlx-pbody .wlx-pin { margin-top: 3px; }
#wlx-chat-root .wlx-specs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 0; border-top: 1px solid var(--wlx-line); border-bottom: 1px solid var(--wlx-line);
  font-size: 11.5px; color: var(--wlx-text);
}
#wlx-chat-root .wlx-spec { background: var(--wlx-raised); color: var(--wlx-head); padding: 2px 8px; border-radius: 6px; font-weight: 500; }
#wlx-chat-root .wlx-spec-sep { color: var(--wlx-faint); }
#wlx-chat-root .wlx-spec-hl { color: var(--wlx-accent); font-weight: 500; }
#wlx-chat-root .wlx-spec-hl .wlx-spec-sep { margin-right: 2px; }
#wlx-chat-root .wlx-pbtns { display: flex; gap: 8px; }

/* ── Property / link: compact row ───────────────────────────────────────── */
#wlx-chat-root .wlx-crow {
  display: flex; align-items: center; gap: 12px;
  background: var(--wlx-inner);
  border: 1px solid var(--wlx-line);
  border-radius: 14px;
  padding: 10px;
  transition: border-color .15s, background .15s;
  min-width: 0;
}
#wlx-chat-root a.wlx-crow:hover { border-color: var(--wlx-line-2); }
#wlx-chat-root a.wlx-crow:hover .wlx-chev { color: var(--wlx-head); transform: translateX(2px); }
#wlx-chat-root a.wlx-crow:hover .wlx-ctitle { color: var(--wlx-accent); }
#wlx-chat-root .wlx-cthumb {
  width: 104px; height: 78px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  position: relative; background: var(--wlx-img-bg); border: 1px solid var(--wlx-line);
}
#wlx-chat-root .wlx-cthumb img { width: 100%; height: 100%; object-fit: cover; }
#wlx-chat-root .wlx-cthumb .wlx-tag { position: absolute; top: 5px; left: 5px; }
#wlx-chat-root .wlx-cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#wlx-chat-root .wlx-cprice { font-size: 13.5px; font-weight: 700; color: var(--wlx-head); }
#wlx-chat-root .wlx-cprice small { font-size: 11px; font-weight: 400; color: var(--wlx-muted); }
#wlx-chat-root .wlx-ctitle {
  font-size: 13px; font-weight: 600; color: var(--wlx-head); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s;
}
#wlx-chat-root .wlx-cdesc {
  font-size: 11.5px; color: var(--wlx-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#wlx-chat-root .wlx-cspecs { font-size: 11px; color: var(--wlx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#wlx-chat-root .wlx-cbody .wlx-pin { font-size: 11px; }
#wlx-chat-root .wlx-cbody .wlx-pin svg { width: 12px; height: 12px; }
#wlx-chat-root .wlx-site { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--wlx-muted); margin-top: 4px; min-width: 0; }
#wlx-chat-root .wlx-site span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wlx-chat-root .wlx-fav {
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  background: var(--wlx-accent); color: var(--wlx-on-accent);
  font-size: 8.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Browser-window placeholder for a page with no featured image */
#wlx-chat-root .wlx-mock { width: 100%; height: 100%; padding: 7px; display: flex; flex-direction: column; gap: 5px; background: var(--wlx-raised); }
#wlx-chat-root .wlx-mock-dots { display: flex; gap: 3px; }
#wlx-chat-root .wlx-mock-dots i { width: 5px; height: 5px; border-radius: 50%; background: #ef4444; }
#wlx-chat-root .wlx-mock-dots i:nth-child(2) { background: #f59e0b; }
#wlx-chat-root .wlx-mock-dots i:nth-child(3) { background: #10b981; }
#wlx-chat-root .wlx-mock-hero { flex: 1; border-radius: 4px; background: linear-gradient(135deg, var(--wlx-line-2), var(--wlx-line)); }
#wlx-chat-root .wlx-mock-bars { display: flex; gap: 4px; }
#wlx-chat-root .wlx-mock-bars i { height: 5px; border-radius: 3px; background: var(--wlx-line-2); flex: 1; }
#wlx-chat-root .wlx-mock-bars i:last-child { background: var(--wlx-accent); }

/* ── Products: carousel ─────────────────────────────────────────────────── */
#wlx-chat-root .wlx-carousel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
#wlx-chat-root .wlx-car-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#wlx-chat-root .wlx-car-ctrl { display: flex; align-items: center; gap: 6px; }
#wlx-chat-root .wlx-car-count {
  font-size: 10.5px; color: var(--wlx-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--wlx-line); border-radius: 6px; padding: 2px 7px;
}
#wlx-chat-root .wlx-car-btn {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--wlx-line-2); color: var(--wlx-text); background: var(--wlx-inner);
}
#wlx-chat-root .wlx-car-btn:hover:not([disabled]) { background: var(--wlx-accent); border-color: var(--wlx-accent); color: var(--wlx-on-accent); }
#wlx-chat-root .wlx-car-btn[disabled] { opacity: .35; cursor: default; }
#wlx-chat-root .wlx-car-btn svg { width: 14px; height: 14px; }
#wlx-chat-root .wlx-track {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 2px; margin: 0 -2px; padding-left: 2px; padding-right: 2px;
}
#wlx-chat-root .wlx-track::-webkit-scrollbar { display: none; }
#wlx-chat-root .wlx-pcard {
  flex: 0 0 186px; scroll-snap-align: start;
  background: var(--wlx-inner); border: 1px solid var(--wlx-line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
#wlx-chat-root .wlx-pcard:hover { border-color: var(--wlx-line-2); }
#wlx-chat-root .wlx-pcard[data-unavailable] .wlx-pmedia img { filter: grayscale(.6); opacity: .8; }
#wlx-chat-root .wlx-pmedia { height: 132px; position: relative; background: var(--wlx-img-bg); display: block; }
#wlx-chat-root .wlx-pmedia img { width: 100%; height: 100%; object-fit: cover; }
#wlx-chat-root .wlx-pmedia .wlx-tag { position: absolute; top: 8px; left: 8px; }
#wlx-chat-root .wlx-pinfo { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
#wlx-chat-root .wlx-pname {
  font-size: 12.5px; font-weight: 600; color: var(--wlx-head); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
#wlx-chat-root .wlx-pname:hover { color: var(--wlx-accent); }
#wlx-chat-root .wlx-pcat { font-size: 10.5px; color: var(--wlx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wlx-chat-root .wlx-rating { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--wlx-muted); }
#wlx-chat-root .wlx-rating svg { width: 12px; height: 12px; color: #f59e0b; }
#wlx-chat-root .wlx-prices { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: auto; }
#wlx-chat-root .wlx-prices b { font-size: 14px; font-weight: 700; color: var(--wlx-head); }
#wlx-chat-root .wlx-prices s { font-size: 11px; color: var(--wlx-faint); }
#wlx-chat-root .wlx-pacts { display: flex; gap: 6px; margin-top: 6px; }
#wlx-chat-root .wlx-pacts .wlx-btn { padding: 7px 8px; font-size: 11.5px; border-radius: 8px; }
#wlx-chat-root .wlx-pacts .wlx-btn--icon { flex: 0 0 auto; width: 32px; padding: 0; }
#wlx-chat-root .wlx-pacts .wlx-btn--icon svg { width: 15px; height: 15px; }

/* One product → wide card */
#wlx-chat-root .wlx-pwide { display: flex; gap: 12px; padding: 10px; background: var(--wlx-inner); border: 1px solid var(--wlx-line); border-radius: 14px; }
#wlx-chat-root .wlx-pwide .wlx-pmedia { width: 116px; height: auto; min-height: 116px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
#wlx-chat-root .wlx-pwide .wlx-pinfo { padding: 2px 0; }
#wlx-chat-root .wlx-pwide .wlx-pname { min-height: 0; font-size: 13.5px; }
#wlx-chat-root .wlx-pwide .wlx-cdesc { -webkit-line-clamp: 2; }

/* ── Actions + quick replies ────────────────────────────────────────────── */
#wlx-chat-root .wlx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#wlx-chat-root .wlx-actions .wlx-btn { flex: 0 1 auto; }
#wlx-chat-root .wlx-actions .wlx-btn--primary { flex: 0 1 auto; }

#wlx-chat-root .wlx-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
#wlx-chat-root .wlx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--wlx-raised); border: 1px solid var(--wlx-line-2);
  font-size: 12px; color: var(--wlx-text); line-height: 1.3; text-align: left;
  transition: background .15s, border-color .15s, color .15s;
}
#wlx-chat-root .wlx-chip:hover { border-color: var(--wlx-accent-border); color: var(--wlx-accent); background: var(--wlx-accent-light); }
#wlx-chat-root .wlx-chip svg { width: 12px; height: 12px; color: var(--wlx-accent); }

/* ── Composer ───────────────────────────────────────────────────────────── */
#wlx-chat-root .wlx-composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--wlx-line);
  background: var(--wlx-bg);
  flex-shrink: 0;
}
#wlx-chat-root .wlx-pill {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--wlx-input-bg);
  border: 1px solid var(--wlx-line);
  border-radius: 24px;
  padding: 6px 8px 6px 16px;
  transition: border-color .15s, box-shadow .15s;
}
#wlx-chat-root .wlx-pill:focus-within { border-color: var(--wlx-accent-border); box-shadow: 0 0 0 3px var(--wlx-accent-light); }
#wlx-chat-root #wlx-input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none; box-shadow: none;
  resize: none; overflow-y: auto;
  font: inherit; font-size: 13.5px; line-height: 1.45;
  color: var(--wlx-head);
  padding: 6px 0; margin: 0;
  max-height: 110px; min-height: 0; height: 32px;
  border-radius: 0;
}
#wlx-chat-root #wlx-input::placeholder { color: var(--wlx-faint); opacity: 1; }
#wlx-chat-root .wlx-counter { font-size: 10.5px; color: var(--wlx-faint); align-self: center; padding-right: 6px; display: none; }
#wlx-chat-root .wlx-counter.wlx-show { display: block; }
#wlx-chat-root #wlx-send {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--wlx-accent); color: var(--wlx-on-accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 6px 16px var(--wlx-accent-border);
  transition: background .15s, transform .1s, opacity .15s;
}
#wlx-chat-root #wlx-send:hover:not(:disabled) { background: var(--wlx-accent-dark); }
#wlx-chat-root #wlx-send:active:not(:disabled) { transform: scale(.95); }
#wlx-chat-root #wlx-send:disabled { opacity: .5; cursor: default; }
#wlx-chat-root #wlx-send svg { width: 18px; height: 18px; transform: translateX(1px); }

#wlx-chat-root .wlx-powered {
  text-align: center; font-size: 10.5px; color: var(--wlx-faint);
  padding: 0 0 10px; background: var(--wlx-bg); flex-shrink: 0;
}
#wlx-chat-root .wlx-powered a { color: var(--wlx-muted); font-weight: 600; }
#wlx-chat-root .wlx-powered a:hover { color: var(--wlx-accent); }

/* ── Editorial accents for the warm theme ───────────────────────────────── */
#wlx-chat-root.wlx-theme-warm .wlx-head-name,
#wlx-chat-root.wlx-theme-warm .wlx-ptitle,
#wlx-chat-root.wlx-theme-warm .wlx-gal-price b,
#wlx-chat-root.wlx-theme-warm .wlx-cprice {
  font-family: Georgia, 'Times New Roman', serif; letter-spacing: -0.01em;
}
#wlx-chat-root.wlx-theme-warm .wlx-avatar { background: #1c1917; color: #fafaf9; border-color: #1c1917; }
#wlx-chat-root.wlx-theme-warm .wlx-spec { background: #f6efe4; color: #6b4f2a; border: 1px solid #ebe0cf; }
#wlx-chat-root.wlx-theme-warm .wlx-btn--primary { background: #1c1917; color: #fafaf9; }
#wlx-chat-root.wlx-theme-warm .wlx-btn--primary:hover { background: #44403c; }
#wlx-chat-root.wlx-theme-light .wlx-pfeat,
#wlx-chat-root.wlx-theme-warm .wlx-pfeat { border-color: var(--wlx-line); box-shadow: 0 1px 3px rgba(15,23,42,0.05); }

/* ── Mobile: full-screen sheet ──────────────────────────────────────────── */
@media (max-width: 480px) {
  #wlx-chat-root { --wlx-offset-x: 16px; --wlx-offset-y: 16px; }
  #wlx-chat-root #wlx-window {
    position: fixed; inset: 0; width: 100%; height: 100%;
    max-height: none; border-radius: 0; border: 0;
    bottom: auto; right: auto;
  }
  #wlx-chat-root.wlx-pos-left #wlx-window { left: 0; }
  #wlx-chat-root.wlx-is-open #wlx-bubble { display: none; }
  #wlx-chat-root #wlx-messages { padding: 16px 12px 10px; }
  #wlx-chat-root .wlx-avatar--sm { display: none; }
  #wlx-chat-root #wlx-input { font-size: 16px; } /* stops iOS zooming on focus */
}

@media (prefers-reduced-motion: reduce) {
  #wlx-chat-root *, #wlx-chat-root *::before, #wlx-chat-root *::after { animation: none !important; transition: none !important; }
  #wlx-chat-root #wlx-messages { scroll-behavior: auto; }
}
