/* AVAM Headless UI */
/* Root + theming */
.avam-convai { position: fixed; right: 24px; bottom: 24px; z-index: 9999; font: inherit; color: #0f172a; }
.avam-convai, .avam-convai * { box-sizing: border-box; }
.avam-convai { --avam-primary: #6b4cff; --avam-secondary: #00c2ff; --avam-bg: #0b1220; --avam-fg: #e5e7eb; --avam-muted:#94a3b8; }

/* Bubble */
.avam-convai-bubble { display:flex; align-items:center; gap:10px; cursor:pointer; }
.avam-convai-bubble .avatar { width:56px; height:56px; border-radius:999px; box-shadow:0 10px 20px rgba(0,0,0,.25); overflow:hidden; border:2px solid rgba(255,255,255,.8); background:#fff; }
.avam-convai-bubble .avatar .avatar-img { width:100%; height:100%; object-fit:cover; display:block; }
.avam-convai-bubble .cta { background: linear-gradient(135deg, var(--avam-primary), var(--avam-secondary));
  color:#fff; padding:10px 14px; border-radius:999px; font-weight:600; font-size:14px; box-shadow:0 8px 18px rgba(0,0,0,.25); white-space:nowrap; }

/* Panel */
.avam-convai-panel { position: fixed; right: 24px; bottom: 96px; width: 380px; max-width: calc(100vw - 28px);
  background: var(--avam-bg); color: var(--avam-fg); border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.45);
  opacity:0; transform: translateY(12px) scale(.98); pointer-events:none; transition: all .18s ease; }
.avam-convai-panel.open { opacity:1; transform: translateY(0) scale(1); pointer-events:auto; }

.avam-convai-header { display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, rgba(107,76,255,.25), rgba(0,194,255,.15)); border-top-left-radius:16px; border-top-right-radius:16px; }
.avam-convai-header .title { font-weight:700; font-size:14px; letter-spacing:.2px; color:#fff; }
.avam-convai-header .close { background:transparent; color:#fff; border:0; width:28px; height:28px; border-radius:8px; cursor:pointer; }
.avam-convai-header .close:hover { background:rgba(255,255,255,.08); }

.avam-convai-body { display:grid; grid-template-columns: 120px 1fr; gap:14px; padding:14px; }
.avam-convai-body.compact { grid-template-columns: 1fr; }

.avam-convai .left { display:flex; flex-direction:column; align-items:center; gap:10px; }
.avam-convai .avatar-lg { width:96px; height:96px; border-radius:999px; overflow:hidden; border:2px solid rgba(255,255,255,.2); box-shadow:0 8px 24px rgba(0,0,0,.35); background:#fff; }
.avam-convai .avatar-lg .avatar-img { width:100%; height:100%; object-fit:cover; display:block; }

.avam-convai .btn { width:100%; border:0; border-radius:999px; padding:10px 12px; font-weight:700; color:#0b1220; cursor:pointer; box-shadow:0 10px 20px rgba(0,0,0,.25); }
.avam-convai .btn.start { background: linear-gradient(135deg, var(--avam-primary), var(--avam-secondary)); color:#0b1220; }
.avam-convai .btn.start:hover { filter: brightness(1.05); }
.avam-convai .btn.stop { background: linear-gradient(135deg, #ff6b6b, #ff3b3b); color:#fff; }
.avam-convai .btn.stop:disabled { opacity: .6; cursor: not-allowed; }

.avam-convai .avam-status { font-size:12px; color: var(--avam-muted); }

.avam-convai .right { display:flex; flex-direction:column; gap:10px; }
.avam-convai #transcript { background:#0f172a; color:#cbd5e1; border:1px solid rgba(255,255,255,.08); padding:10px; border-radius:12px; height:220px; overflow:auto; }
#transcript .t { padding:6px 8px; border-radius:8px; margin:2px 0; font-size:13px; }
#transcript .t.user { background: rgba(107,76,255,.25); color:#eae7ff; }
#transcript .t.assistant { background: rgba(148,163,184,.15); color:#e5e7eb; }

/* Mobile */
@media (max-width: 640px) {
  .avam-convai { right: 16px; bottom: 16px; }
  .avam-convai-panel { right: 16px; bottom: 86px; width: calc(100vw - 32px); }
  .avam-convai-body { grid-template-columns: 1fr; }
}