/* ── Open Aura Widget ── */
:root {
  --lac-primary: #3b82f6;
  --lac-primary-end: #8b5cf6;
  --lac-bg: #1e2235;
  --lac-header-bg: #252a40;
  --lac-msg-bg: rgba(255,255,255,0.08);
  --lac-input-bg: rgba(255,255,255,0.06);
  --lac-border: rgba(255,255,255,0.1);
  --lac-text: #ffffff;
  --lac-text-muted: rgba(255,255,255,0.5);
  --lac-radius: 20px;
  --lac-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ── Floating ── */
.lac-floating { position: fixed; z-index: 99999; }
.lac-pos-bottom-right { bottom: 24px; right: 24px; }
.lac-pos-bottom-left  { bottom: 24px; left:  24px; }

/* ── Toggle button ── */
.lac-toggle-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lac-primary), var(--lac-primary-end));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(59,130,246,0.5);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.lac-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(59,130,246,0.6); }

.lac-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #ef4444; color: white; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ── Window ── */
.lac-window {
  width: 360px;
  background: var(--lac-bg);
  border-radius: var(--lac-radius);
  box-shadow: var(--lac-shadow);
  border: 1px solid var(--lac-border);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.lac-floating .lac-window {
  position: absolute;
  bottom: 68px;
  right: 0;
  transform-origin: bottom right;
  transition: transform .25s ease, opacity .25s ease;
}
.lac-pos-bottom-left .lac-window { right: auto; left: 0; transform-origin: bottom left; }
.lac-closed { transform: scale(0.85); opacity: 0; pointer-events: none; }

.lac-inline .lac-window { position: relative; width: 100%; max-width: 360px; margin: 0 auto; }

/* ── Header ── */
.lac-header {
  background: var(--lac-header-bg);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--lac-border);
}
.lac-header-info { flex: 1; }
.lac-header-info strong { display: block; color: var(--lac-text); font-size: 14px; }
.lac-status { display: flex; align-items: center; gap: 5px; color: var(--lac-text-muted); font-size: 12px; margin-top: 2px; }
.lac-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: lac-pulse 2s infinite; }
@keyframes lac-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.lac-close-btn {
  background: none; border: none; color: var(--lac-text-muted);
  cursor: pointer; font-size: 16px; padding: 4px;
  line-height: 1; transition: color .15s;
}
.lac-close-btn:hover { color: var(--lac-text); }

/* ── Avatar ── */
.lac-avatar { flex-shrink: 0 !important; }
.lac-avatar-letter {
  width: 36px !important; height: 36px !important; border-radius: 50% !important;
  background: linear-gradient(135deg, var(--lac-primary), var(--lac-primary-end));
  color: white !important; font-weight: 700; font-size: 16px;
  display: flex !important; align-items: center !important; justify-content: center !important;
}
.lac-avatar-img {
  width: 36px !important; height: 36px !important; border-radius: 50% !important;
  object-fit: contain !important; background: white !important; padding: 4px !important;
  display: block !important; box-sizing: border-box !important;
}
.lac-msg .lac-avatar-letter,
.lac-msg .lac-avatar-img { width: 26px !important; height: 26px !important; font-size: 12px; }
.lac-msg .lac-avatar-img { padding: 3px !important; }

/* ── Messages ── */
.lac-messages {
  height: 180px; overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.lac-messages::-webkit-scrollbar { width: 4px; }
.lac-messages::-webkit-scrollbar-track { background: transparent; }
.lac-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.lac-msg { display: flex; gap: 8px; align-items: flex-end; }
.lac-msg-user { flex-direction: row-reverse; }

.lac-bubble {
  padding: 9px 13px; border-radius: 16px; max-width: 80%;
  font-size: 14px; line-height: 1.55; color: var(--lac-text);
  white-space: pre-wrap; word-break: break-word;
}
.lac-msg-bot  .lac-bubble { background: var(--lac-msg-bg); border-radius: 16px 16px 16px 4px; }
.lac-msg-user .lac-bubble { background: linear-gradient(135deg, var(--lac-primary), var(--lac-primary-end)); border-radius: 16px 16px 4px 16px; }

/* Typing dots */
.lac-typing-bubble { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.lac-typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: lac-typing 1.2s infinite ease-in-out;
}
.lac-typing-dot:nth-child(2) { animation-delay: .15s; }
.lac-typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes lac-typing { 0%,80%,100%{transform:scale(0);opacity:.4} 40%{transform:scale(1);opacity:1} }

/* ── Input area ── */
.lac-input-area {
  padding: 8px 10px;
  border-top: 1px solid var(--lac-border);
  display: flex; gap: 6px; align-items: flex-end;
}
.lac-input {
  flex: 1; background: var(--lac-input-bg);
  border: 1px solid var(--lac-border); border-radius: 12px;
  padding: 9px 12px; color: var(--lac-text); font-size: 14px;
  resize: none; outline: none; line-height: 1.4;
  min-height: 40px; max-height: 100px;
  font-family: inherit; transition: border-color .2s;
}
.lac-input:focus { border-color: rgba(255,255,255,0.3); }
.lac-input::placeholder { color: var(--lac-text-muted); }

.lac-send-btn, .lac-mic-btn {
  width: 40px !important; height: 40px !important;
  min-width: 40px !important; min-height: 40px !important;
  max-width: 40px !important; max-height: 40px !important;
  border-radius: 50% !important;
  border: none !important; cursor: pointer; flex-shrink: 0 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  padding: 0 !important; margin: 0 !important; line-height: 1 !important;
  transition: all .2s;
}
.lac-send-btn {
  background: linear-gradient(135deg, var(--lac-primary), var(--lac-primary-end)) !important;
  color: white !important; box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
.lac-send-btn svg, .lac-mic-btn svg { display: block !important; flex-shrink: 0 !important; }
.lac-send-btn:hover { transform: scale(1.05); }
.lac-send-btn:disabled { opacity: 0.5; transform: none; }
.lac-mic-btn {
  background: var(--lac-input-bg) !important; border: 1px solid var(--lac-border) !important;
  color: var(--lac-text-muted) !important;
}
.lac-mic-btn:hover { background: rgba(255,255,255,0.12) !important; color: var(--lac-text) !important; }
.lac-mic-btn.listening { background: rgba(239,68,68,0.25) !important; border-color: rgba(239,68,68,0.5) !important; color: #ef4444 !important; animation: lac-pulse 1s infinite; }

/* ── Branding ── */
.lac-branding {
  text-align: center;
  padding: 6px 0 8px;
  border-top: 1px solid var(--lac-border);
}
.lac-branding a {
  font-size: 11px;
  color: var(--lac-text-muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color .15s;
}
.lac-branding a:hover { color: var(--lac-text); }

/* ── Responsive ── */
@media (max-width: 400px) {
  .lac-window { width: calc(100vw - 32px); }
}

