/* ───────────────────────────────────────────────
   LARAUNA — sell-side chat widget
   Uses the shared design tokens from main.css (:root).
─────────────────────────────────────────────── */

.lar-chat-launch {
  position: fixed; right: 22px; bottom: 22px;
  width: 60px; height: 60px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.lar-chat-launch:hover { transform: translateY(-2px) scale(1.04); }
.lar-chat-launch svg { width: 27px; height: 27px; }

.lar-chat-panel {
  position: fixed; right: 22px; bottom: 22px;
  width: 374px; max-width: calc(100vw - 32px);
  height: 564px; max-height: calc(100vh - 44px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 9999; font-family: var(--font-b);
  opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.lar-chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.lar-chat-head {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; padding: 15px 18px; display: flex; align-items: center; gap: 12px;
}
.lar-chat-head .lar-ava {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-weight: 700; font-size: 1.05rem;
}
.lar-chat-head h4 { font-family: var(--font-d); font-size: 1rem; font-weight: 600; line-height: 1.2; }
.lar-chat-head p { font-size: .74rem; opacity: .9; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.lar-chat-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #6EE7B7; box-shadow: 0 0 0 0 rgba(110,231,183,.6); animation: lar-pulse 2s infinite; }
@keyframes lar-pulse { 0%{box-shadow:0 0 0 0 rgba(110,231,183,.6);} 70%{box-shadow:0 0 0 6px rgba(110,231,183,0);} 100%{box-shadow:0 0 0 0 rgba(110,231,183,0);} }
.lar-chat-close {
  margin-left: auto; background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 9px; font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.lar-chat-close:hover { background: rgba(255,255,255,.28); }

.lar-chat-body {
  flex: 1; overflow-y: auto; padding: 16px; background: var(--paper);
  display: flex; flex-direction: column; gap: 10px;
}
.lar-msg {
  max-width: 84%; padding: 10px 13px; border-radius: 15px; font-size: .9rem;
  line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.lar-msg.bot { background: var(--surface); border: 1px solid var(--line); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 5px; }
.lar-msg.user { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }

.lar-typing { display: flex; gap: 4px; align-items: center; }
.lar-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; animation: lar-bounce 1.2s infinite; }
.lar-typing span:nth-child(2){ animation-delay:.18s; } .lar-typing span:nth-child(3){ animation-delay:.36s; }
@keyframes lar-bounce { 0%,60%,100%{transform:translateY(0);opacity:.4;} 30%{transform:translateY(-4px);opacity:.9;} }

.lar-chat-foot { padding: 10px 10px 8px; border-top: 1px solid var(--line); background: var(--surface); }
.lar-chat-inputrow { display: flex; gap: 8px; align-items: flex-end; }
.lar-chat-input {
  flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; font-family: var(--font-b); font-size: 16px; color: var(--ink);
  background: var(--paper); max-height: 120px; outline: none; line-height: 1.4;
}
.lar-chat-input:focus { border-color: var(--accent); }
.lar-chat-send {
  width: 42px; height: 42px; border-radius: 12px; border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: transform .15s, opacity .15s;
}
.lar-chat-send svg { width: 20px; height: 20px; }
.lar-chat-send:hover:not(:disabled) { transform: translateY(-1px); }
.lar-chat-send:disabled { opacity: .45; cursor: default; }
.lar-chat-note { text-align: center; font-size: .68rem; color: var(--muted); padding-top: 7px; }

@media (max-width: 480px) {
  .lar-chat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: none; }
  .lar-chat-launch { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .lar-chat-panel, .lar-chat-launch, .lar-chat-send { transition: none; }
  .lar-typing span, .lar-chat-status-dot { animation: none; }
}
