/* ============================================================
   FMI Gallery Chatbot Widget — Sophie
   Version: 1.0.1
   Integrates with FMI Masonry Gallery plugin v2.1.105+
   ============================================================ */

/* ── Variables ── */
:root {
  --fmi-chat-dark:       #111111;
  --fmi-chat-panel:      #1a1a1a;
  --fmi-chat-surface:    #222222;
  --fmi-chat-border:     #2e2e2e;
  --fmi-chat-accent:     #71559c;           /* #6 active purple */
  --fmi-chat-accent-soft:rgba(113,85,156,0.12);
  --fmi-chat-text:       #f0ede8;
  --fmi-chat-muted:      #808181;           /* #6B / #7 / inactive grey */
  --fmi-chat-dim:        #555;
  --fmi-chat-green:      #4caf7d;
  --fmi-chat-radius:     16px;
  --fmi-chat-radius-sm:  10px;
  --fmi-chat-shadow:     0 32px 80px rgba(0,0,0,0.75), 0 8px 24px rgba(0,0,0,0.5);
}

/* ── Bubble ── */
#fmi-chat-bubble {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  background: var(--fmi-chat-dark);
  border: 1px solid var(--fmi-chat-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 99990;
}
#fmi-chat-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 40px rgba(0,0,0,0.75);
  border-color: var(--fmi-chat-accent);
}
#fmi-chat-bubble svg {
  width: 22px;
  height: 22px;
  stroke: #71559c;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fmi-chat-notif-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  background: var(--fmi-chat-accent);
  border-radius: 50%;
  border: 2px solid var(--fmi-chat-dark);
  animation: fmi-chat-pulse 2s ease-in-out infinite;
}
@keyframes fmi-chat-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.82); }
}

/* ── Panel ── */
#fmi-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 380px;
  max-height: 640px;
  background: var(--fmi-chat-panel);
  border: 1px solid var(--fmi-chat-border);
  border-radius: var(--fmi-chat-radius);
  box-shadow: var(--fmi-chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99989;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: 'Poppins', sans-serif;
}
#fmi-chat-panel.fmi-chat-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
.fmi-chat-header {
  background: var(--fmi-chat-dark);
  border-bottom: 1px solid var(--fmi-chat-border);
  padding: 0 16px;
  flex-shrink: 0;
}
.fmi-chat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 11px;
}
.fmi-chat-agent-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fmi-chat-agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--fmi-chat-accent);
  background: var(--fmi-chat-surface);
}
.fmi-chat-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fmi-chat-agent-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fmi-chat-text);
  line-height: 1.2;
}
.fmi-chat-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fmi-chat-muted);
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.fmi-chat-close-btn:hover {
  color: var(--fmi-chat-text);
  background: var(--fmi-chat-surface);
}
.fmi-chat-close-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.fmi-chat-status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 0 11px;
  font-size: 11px;
  color: var(--fmi-chat-muted);
  border-top: 1px solid var(--fmi-chat-border);
}
.fmi-chat-status-dot {
  width: 7px;
  height: 7px;
  background: var(--fmi-chat-green);
  border-radius: 50%;
  flex-shrink: 0;
}
.fmi-chat-status-text { color: var(--fmi-chat-green); font-weight: 500; }
.fmi-chat-agent-role {
  font-size: 11px;
  color: #848484;
  margin-top: 1px;
}

/* ── Tabs ── */
.fmi-chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--fmi-chat-border);
  background: var(--fmi-chat-dark);
  flex-shrink: 0;
}
.fmi-chat-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 11px;
  font-weight: 500;
  color: #808181;                          /* 6B inactive */
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.06em;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
}
.fmi-chat-tab.active {
  color: #71559c;                          /* 6A active */
  border-bottom-color: #71559c;
}
.fmi-chat-tab:hover:not(.active) { color: #8a8a8a; }
.fmi-chat-tab svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vertical-align: -2px;
  margin-right: 4px;
}

/* ── Tab Content ── */
.fmi-chat-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
}
.fmi-chat-tab-content.active { display: flex; }
.fmi-chat-tab-content::-webkit-scrollbar { width: 4px; }
.fmi-chat-tab-content::-webkit-scrollbar-track { background: transparent; }
.fmi-chat-tab-content::-webkit-scrollbar-thumb { background: var(--fmi-chat-border); border-radius: 2px; }

/* ── HOME TAB ── */
.fmi-chat-home-hero {
  position: relative;
  overflow: hidden;
  height: 118px;
  flex-shrink: 0;
}
.fmi-chat-home-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fmi-chat-home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.72) 0%, rgba(64,0,159,0.25) 100%);
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
}
.fmi-chat-home-greeting {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.fmi-chat-home-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.68);
  margin-top: 2px;
}
.fmi-chat-home-section { padding: 14px 16px 0; }
.fmi-chat-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--fmi-chat-dim);
  text-transform: uppercase;
  margin-bottom: 9px;
}
.fmi-chat-quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: rgba(34,34,34,0.75);        /* item 9 */
  backdrop-filter: blur(4px);
  border: 1px solid var(--fmi-chat-border);
  border-radius: var(--fmi-chat-radius-sm);
  cursor: pointer;
  margin-bottom: 7px;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  font-family: 'Poppins', sans-serif;
}
.fmi-chat-quick-action:hover {
  border-color: var(--fmi-chat-accent);
  background: var(--fmi-chat-accent-soft);
}
.fmi-chat-qa-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #4c3e63;                    /* item 5 */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fmi-chat-qa-icon svg {
  width: 14px;
  height: 14px;
  stroke: #866eab;                        /* 15% brighter than accent */
  fill: none;
  stroke-width: 1.8;
}
.fmi-chat-qa-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fmi-chat-text);
  line-height: 1.2;
}
.fmi-chat-qa-sub {
  font-size: 11px;
  color: var(--fmi-chat-muted);
  margin-top: 1px;
}
.fmi-chat-qa-arrow { margin-left: auto; color: var(--fmi-chat-dim); }
.fmi-chat-qa-arrow svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.fmi-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 16px;
}
.fmi-chat-chip {
  padding: 5px 11px;
  background: var(--fmi-chat-surface);
  border: 1px solid var(--fmi-chat-border);
  border-radius: 18px;
  font-size: 11.5px;
  color: var(--fmi-chat-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Poppins', sans-serif;
}
.fmi-chat-chip:hover {
  border-color: var(--fmi-chat-accent);
  color: var(--fmi-chat-accent);
  background: var(--fmi-chat-accent-soft);
}

/* ── MESSAGES TAB ── */
.fmi-chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  scroll-behavior: smooth;
}
.fmi-chat-messages-area::-webkit-scrollbar { width: 4px; }
.fmi-chat-messages-area::-webkit-scrollbar-track { background: transparent; }
.fmi-chat-messages-area::-webkit-scrollbar-thumb { background: var(--fmi-chat-border); border-radius: 2px; }

.fmi-chat-msg-row { display: flex; gap: 8px; align-items: flex-end; }
.fmi-chat-msg-row.fmi-chat-user { flex-direction: row-reverse; }
.fmi-chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--fmi-chat-surface);
  border: 1px solid var(--fmi-chat-border);
}
.fmi-chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fmi-chat-msg-avatar.fmi-chat-user-av {
  background: var(--fmi-chat-accent-soft);
  border-color: var(--fmi-chat-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--fmi-chat-accent);
}
.fmi-chat-bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fmi-chat-text);
}
.fmi-chat-msg-row.fmi-chat-agent .fmi-chat-bubble {
  background: rgba(34,34,34,0.75);        /* item 9 */
  backdrop-filter: blur(4px);
  border: 1px solid var(--fmi-chat-border);
  border-bottom-left-radius: 4px;
}
.fmi-chat-bubble p { margin: 0 0 6px; }
.fmi-chat-bubble p:last-child { margin-bottom: 0; }
.fmi-chat-bubble strong { color: #fff; font-weight: 600; }
.fmi-chat-bubble ul { padding-left: 16px; margin: 4px 0; }
.fmi-chat-bubble li { margin-bottom: 3px; }

.fmi-chat-msg-row.fmi-chat-user .fmi-chat-bubble {
  background: var(--fmi-chat-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.fmi-chat-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 11px 14px;
  background: var(--fmi-chat-surface);
  border: 1px solid var(--fmi-chat-border);
  border-radius: 13px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.fmi-chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fmi-chat-muted);
  animation: fmi-chat-typing 1.2s ease-in-out infinite;
}
.fmi-chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.fmi-chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes fmi-chat-typing {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-3px); }
}
.fmi-chat-suggestions {
  padding: 0 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fmi-chat-suggest-btn {
  padding: 5px 10px;
  background: var(--fmi-chat-surface);
  border: 1px solid var(--fmi-chat-border);
  border-radius: 14px;
  font-size: 11.5px;
  color: var(--fmi-chat-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Poppins', sans-serif;
}
.fmi-chat-suggest-btn:hover {
  border-color: var(--fmi-chat-accent);
  color: var(--fmi-chat-accent);
  background: var(--fmi-chat-accent-soft);
}
.fmi-chat-input-area {
  padding: 11px 13px;
  border-top: 1px solid var(--fmi-chat-border);
  background: var(--fmi-chat-dark);
  flex-shrink: 0;
}
.fmi-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,34,34,0.75);        /* item 9: slightly transparent */
  backdrop-filter: blur(4px);
  border: 1px solid var(--fmi-chat-border);
  border-radius: 22px;
  padding: 7px 7px 7px 14px;
  transition: border-color 0.15s;
}
.fmi-chat-input-row:focus-within { border-color: var(--fmi-chat-accent); }
#fmi-chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--fmi-chat-text);
  line-height: 1.4;
  resize: none;
  max-height: 76px;
}
#fmi-chat-input::placeholder { color: var(--fmi-chat-dim); }
.fmi-chat-send-btn {
  width: 31px;
  height: 31px;
  background: var(--fmi-chat-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.fmi-chat-send-btn:hover { opacity: 0.85; transform: scale(1.05); }
.fmi-chat-send-btn:disabled { opacity: 0.3; cursor: default; transform: none; }
.fmi-chat-send-btn svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
}
.fmi-chat-input-hint {
  font-size: 10px;
  color: #808181;                          /* item 5 */
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ── HELP TAB ── */
.fmi-chat-help-search {
  padding: 13px 16px 9px;
  position: relative;
}
.fmi-chat-help-search-icon {
  position: absolute;
  left: 27px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  stroke: var(--fmi-chat-dim);
  fill: none;
  pointer-events: none;
  stroke-width: 2;
}
.fmi-chat-help-search-input {
  width: 100%;
  padding: 8px 11px 8px 34px;
  background: rgba(34,34,34,0.75);        /* item 9 */
  backdrop-filter: blur(4px);
  border: 1px solid var(--fmi-chat-border);
  border-radius: 9px;
  color: var(--fmi-chat-text);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.fmi-chat-help-search-input:focus { border-color: var(--fmi-chat-accent); }
.fmi-chat-help-search-input::placeholder { color: var(--fmi-chat-dim); }
.fmi-chat-help-articles { padding: 0 16px 14px; }
.fmi-chat-help-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #808181;                          /* item 7 */
  text-transform: uppercase;
  margin: 10px 0 7px;
}
.fmi-chat-help-article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  background: rgba(34,34,34,0.75);        /* item 9 */
  backdrop-filter: blur(4px);
  border: 1px solid var(--fmi-chat-border);
  border-radius: var(--fmi-chat-radius-sm);
  cursor: pointer;
  margin-bottom: 5px;
  transition: border-color 0.15s, background 0.15s;
}
.fmi-chat-help-article:hover {
  border-color: var(--fmi-chat-accent);
  background: var(--fmi-chat-accent-soft);
}
.fmi-chat-article-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fmi-chat-text);
}
.fmi-chat-article-cat {
  font-size: 10.5px;
  color: var(--fmi-chat-muted);
  margin-top: 1px;
}
.fmi-chat-article-arrow { color: var(--fmi-chat-dim); flex-shrink: 0; }
.fmi-chat-article-arrow svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.fmi-chat-no-results {
  text-align: center;
  padding: 28px 16px;
  color: var(--fmi-chat-muted);
  font-size: 13px;
}
.fmi-chat-no-results svg {
  width: 28px;
  height: 28px;
  stroke: var(--fmi-chat-dim);
  fill: none;
  margin-bottom: 8px;
}

/* Article detail overlay */
.fmi-chat-article-detail {
  position: absolute;
  inset: 0;
  background: var(--fmi-chat-panel);
  z-index: 10;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.fmi-chat-article-detail.visible {
  opacity: 1;
  pointer-events: all;
}
.fmi-chat-article-detail-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--fmi-chat-border);
  background: var(--fmi-chat-dark);
}
.fmi-chat-back-btn {
  background: none;
  border: none;
  color: var(--fmi-chat-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s;
}
.fmi-chat-back-btn:hover { color: var(--fmi-chat-text); }
.fmi-chat-back-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.fmi-chat-article-detail-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fmi-chat-text);
}
.fmi-chat-article-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.fmi-chat-article-detail-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fmi-chat-text);
  margin: 0 0 10px;
}
.fmi-chat-article-detail-body p {
  font-size: 13px;
  color: var(--fmi-chat-muted);
  line-height: 1.65;
  margin-bottom: 10px;
}
.fmi-chat-article-detail-body ul {
  padding-left: 16px;
  margin-bottom: 10px;
}
.fmi-chat-article-detail-body li {
  font-size: 13px;
  color: var(--fmi-chat-muted);
  line-height: 1.6;
  margin-bottom: 3px;
}
.fmi-chat-article-detail-body strong { color: var(--fmi-chat-text); font-weight: 600; }
.fmi-chat-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--fmi-chat-accent-soft);
  color: var(--fmi-chat-accent);
  margin-bottom: 12px;
}

/* Escalation card */
.fmi-chat-escalation-card {
  margin: 0 16px 16px;
  background: rgba(113,85,156,0.08);
  border: 1px solid rgba(113,85,156,0.2);
  border-radius: var(--fmi-chat-radius-sm);
  padding: 12px 13px;
}
.fmi-chat-escalation-title {
  font-size: 12px;
  font-weight: 600;
  color: #71559c;                          /* item 8 */
  margin-bottom: 4px;
}
.fmi-chat-escalation-body {
  font-size: 11.5px;
  color: var(--fmi-chat-muted);
  line-height: 1.55;
}
.fmi-chat-escalation-link {
  display: inline-block;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #71559c;                          /* item 8 */
  cursor: pointer;
}
.fmi-chat-escalation-link:hover { text-decoration: underline; }

/* Mobile responsive */
@media (max-width: 480px) {
  #fmi-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 88px;
  }
  #fmi-chat-bubble { right: 16px; bottom: 20px; }
}

/* ============================================================
   LIGHT THEME — toggled by adding .fmi-chat-light to #fmi-chat-panel
   and .fmi-chat-light-bubble to #fmi-chat-bubble
   ============================================================ */

#fmi-chat-panel.fmi-chat-light {
  --fmi-chat-dark:        #f5f4f8;
  --fmi-chat-panel:       #ffffff;
  --fmi-chat-surface:     #f0edf6;
  --fmi-chat-border:      #ddd8e8;
  --fmi-chat-accent:      #71559c;
  --fmi-chat-accent-soft: rgba(113,85,156,0.10);
  --fmi-chat-text:        #1a1520;
  --fmi-chat-muted:       #6b6575;
  --fmi-chat-dim:         #9990a8;
  --fmi-chat-green:       #2e9e62;
  --fmi-chat-shadow:      0 32px 80px rgba(100,80,140,0.18), 0 8px 24px rgba(100,80,140,0.10);
}

/* Light: bubble */
#fmi-chat-bubble.fmi-chat-light-bubble {
  background: #f5f4f8;
  border-color: #ddd8e8;
  box-shadow: 0 8px 32px rgba(100,80,140,0.18);
}
#fmi-chat-bubble.fmi-chat-light-bubble:hover {
  box-shadow: 0 12px 40px rgba(100,80,140,0.28);
  border-color: #71559c;
}

/* Light: notif dot border matches light bubble bg */
#fmi-chat-panel.fmi-chat-light ~ #fmi-chat-bubble .fmi-chat-notif-dot,
#fmi-chat-bubble.fmi-chat-light-bubble .fmi-chat-notif-dot {
  border-color: #f5f4f8;
}

/* Light: fixed hardcoded colours that don't use vars */
#fmi-chat-panel.fmi-chat-light .fmi-chat-agent-role       { color: #8a84a0; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-tab              { color: #9990a8; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-tab.active       { color: #71559c; border-bottom-color: #71559c; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-tab:hover:not(.active) { color: #71559c; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-help-section-title { color: #9990a8; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-input-hint       { color: #9990a8; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-escalation-title { color: #71559c; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-escalation-link  { color: #71559c; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-escalation-card  {
  background: rgba(113,85,156,0.07);
  border-color: rgba(113,85,156,0.18);
}

/* Light: transparent input/article boxes — lighter base */
#fmi-chat-panel.fmi-chat-light .fmi-chat-input-row        { background: rgba(240,237,246,0.85); }
#fmi-chat-panel.fmi-chat-light .fmi-chat-help-search-input { background: rgba(240,237,246,0.85); color: #1a1520; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-help-article     { background: rgba(240,237,246,0.85); }
#fmi-chat-panel.fmi-chat-light .fmi-chat-quick-action     { background: rgba(240,237,246,0.85); }

/* Light: agent message bubbles */
#fmi-chat-panel.fmi-chat-light .fmi-chat-msg-row.fmi-chat-agent .fmi-chat-bubble {
  background: rgba(240,237,246,0.85);
  border-color: #ddd8e8;
}
#fmi-chat-panel.fmi-chat-light .fmi-chat-bubble strong { color: #1a1520; }

/* Light: icon box slightly lighter */
#fmi-chat-panel.fmi-chat-light .fmi-chat-qa-icon { background: #e2dbee; }

/* Light: hero overlay stays dark enough to read white text */
#fmi-chat-panel.fmi-chat-light .fmi-chat-home-hero-overlay {
  background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(113,85,156,0.22) 100%);
}

/* Light: user message bubble stays purple */
#fmi-chat-panel.fmi-chat-light .fmi-chat-msg-row.fmi-chat-user .fmi-chat-bubble {
  background: #71559c;
  color: #fff;
}

/* Light: typing indicator */
#fmi-chat-panel.fmi-chat-light .fmi-chat-typing-indicator {
  background: rgba(240,237,246,0.85);
  border-color: #ddd8e8;
}

/* Light: suggest chips */
#fmi-chat-panel.fmi-chat-light .fmi-chat-chip          { background: #f0edf6; border-color: #ddd8e8; color: #6b6575; }
#fmi-chat-panel.fmi-chat-light .fmi-chat-suggest-btn   { background: #f0edf6; border-color: #ddd8e8; }

/* Light: theme toggle button */
.fmi-chat-theme-btn.fmi-chat-light-btn { color: #71559c; }

/* ── Theme toggle button ── */
.fmi-chat-theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fmi-chat-muted);
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  margin-right: 4px;
  font-size: 14px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.fmi-chat-theme-btn:hover { color: var(--fmi-chat-accent); }
