/* LumoraMedia — Luna marketing agent */
#lm-agent-root {
  --lm-accent: #ef4444;
  --lm-accent-hover: #dc2626;
  --lm-bg: #F9F8F5;
  --lm-surface: #fff;
  --lm-text: #181716;
  --lm-muted: #6E6B63;
  --lm-border: rgba(24, 23, 22, 0.1);
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 250;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

#lm-agent-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem;
  border: none;
  border-radius: 100px;
  background: var(--lm-text);
  color: var(--lm-bg);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(24, 23, 22, 0.22);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

#lm-agent-toggle:hover {
  background: var(--lm-accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.35);
}

#lm-agent-toggle .lm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: lm-pulse 2s ease-in-out infinite;
}

@keyframes lm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

#lm-agent-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(560px, calc(100dvh - 6rem));
  background: var(--lm-surface);
  border: 1px solid var(--lm-border);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

#lm-agent-root.open #lm-agent-panel {
  display: flex;
}

#lm-agent-root.open #lm-agent-toggle {
  background: var(--lm-accent);
}

.lm-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--lm-border);
  background: var(--lm-bg);
}

.lm-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.lm-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 0.2rem;
  color: var(--lm-text);
}

.lm-header p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--lm-muted);
}

#lm-agent-close {
  background: none;
  border: none;
  color: var(--lm-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

#lm-agent-close:hover {
  color: var(--lm-text);
  background: var(--lm-border);
}

.lm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 200px;
  max-height: 320px;
}

.lm-msg {
  max-width: 92%;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.65;
  animation: lm-fade-in 0.25s ease;
}

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

.lm-msg.bot {
  align-self: flex-start;
  background: var(--lm-bg);
  color: var(--lm-text);
  border-bottom-left-radius: 4px;
}

.lm-msg.user {
  align-self: flex-end;
  background: var(--lm-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.lm-msg.bot strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.lm-msg.typing {
  color: var(--lm-muted);
  font-style: italic;
}

.lm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.25rem 0.75rem;
}

.lm-chip {
  background: var(--lm-bg);
  border: 1px solid var(--lm-border);
  border-radius: 100px;
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: 0.76rem;
  color: var(--lm-text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lm-chip:hover {
  border-color: var(--lm-accent);
  color: var(--lm-accent);
  background: rgba(239, 68, 68, 0.06);
}

.lm-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1.1rem;
  border-top: 1px solid var(--lm-border);
  background: var(--lm-surface);
}

#lm-agent-input {
  flex: 1;
  border: 1px solid var(--lm-border);
  border-radius: 100px;
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s;
}

#lm-agent-input:focus {
  border-color: var(--lm-accent);
}

#lm-agent-send {
  border: none;
  border-radius: 100px;
  background: var(--lm-accent);
  color: #fff;
  padding: 0.6rem 1.1rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

#lm-agent-send:hover {
  background: var(--lm-accent-hover);
}

#lm-agent-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lm-cta-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--lm-accent);
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.lm-cta-link:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  #lm-agent-root {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  #lm-agent-panel {
    width: 100%;
    right: 0;
  }

  #lm-agent-toggle {
    width: 100%;
    justify-content: center;
  }
}
