
/* Minimal widget styling inspired by the ElevenLabs Agents widget layout */
:root{
  --elw-radius: 18px;
  --elw-shadow: 0 12px 30px rgba(0,0,0,.12);
  --elw-bg: #fff;
  --elw-text: #111;
  --elw-muted: #6b7280;
  --elw-btn-bg: #0b0b0b;
  --elw-btn-text: #fff;
  --elw-border: rgba(0,0,0,.06);
}

#elw-root { position: fixed; z-index: 999999; }

#elw-root.elw-pos-br { right: 20px; bottom: 20px; }
#elw-root.elw-pos-bl { left: 20px; bottom: 20px; }
#elw-root.elw-pos-tr { right: 20px; top: 20px; }
#elw-root.elw-pos-tl { left: 20px; top: 20px; }

.elw-card {
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--elw-bg);
  border: 1px solid var(--elw-border);
  border-radius: var(--elw-radius);
  box-shadow: var(--elw-shadow);
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.elw-header {
  display:flex; align-items:center; gap:10px;
  padding: 14px 14px 10px 14px;
}

.elw-orb {
  width: 34px; height: 34px; border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #9CE6E6, #2792DC 55%, #0b2b55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.elw-title {
  font-weight: 700; font-size: 16px; color: var(--elw-text);
  line-height: 1.2;
}

.elw-body { padding: 0 14px 14px 14px; }

.elw-btn {
  width: 100%;
  display:flex; align-items:center; justify-content:center; gap:10px;
  border: none;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--elw-btn-bg);
  color: var(--elw-btn-text);
  font-weight: 700;
  cursor: pointer;
}

.elw-btn:disabled { opacity: .55; cursor: not-allowed; }

.elw-row {
  display:flex; gap:10px; margin-top:10px;
}
.elw-secondary {
  flex:1;
  border: 1px solid var(--elw-border);
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 600;
}

.elw-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--elw-muted);
  min-height: 16px;
}

/* Mode choice title */
.elw-mode-title{
  margin-top: 2px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--elw-muted);
  font-weight: 600;
}

/* Action shortcuts suggested by the agent (e.g., “Open CAP métallerie page”) */
.elw-actions-mount{
  margin-top: 12px;
}
.elw-actions-title{
  font-size: 12px;
  font-weight: 700;
  color: var(--elw-muted);
  margin-bottom: 8px;
}
.elw-actions{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.elw-action-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border: 1px solid var(--elw-border);
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--elw-text);
  cursor:pointer;
  user-select:none;
}
.elw-action-btn:active{ transform: translateY(1px); }

.elw-mini {
  display:flex; align-items:center; justify-content:space-between;
  gap: 8px;
  padding: 8px 12px;
  width: 280px;
  max-width: calc(100vw - 32px);
  border-radius: 999px;
  background: var(--elw-bg);
  border: 1px solid var(--elw-border);
  box-shadow: var(--elw-shadow);
  cursor:pointer;
}

.elw-mini-text{
  font-weight: 700;
  font-size: 16px;
  color: var(--elw-text);
  line-height: 1.2;
  padding-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.elw-mini .elw-orb { width: 36px; height: 36px; }

.elw-hidden { display:none !important; }


.elw-avatar-img{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  display:block;
}
.elw-mini .elw-avatar-img{ width: 54px; height: 54px; }




@media (max-width: 480px){
  .elw-mini{
    width: auto;
    max-width: 260px;
    padding: 4px 8px;
    gap: 4px;
  }
  .elw-mini-text{
    font-size: 14px;
    padding-left: 2px;
  }
  .elw-mini .elw-avatar-img{ width: 26px; height: 26px; }
  .elw-mini .elw-orb{ width: 26px; height: 26px; }
}


/* Chat (texte) */
.elw-chat-mount{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--elw-border);
}
.elw-chat-title{
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.elw-chat-log{
  max-height: 160px;
  overflow: auto;
  padding: 8px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--elw-border);
}
.elw-chat-msg{
  font-size: 13px;
  line-height: 1.35;
  padding: 6px 8px;
  border-radius: 10px;
  margin: 6px 0;
  white-space: pre-wrap;
}
.elw-chat-user{
  background: #e5e7eb;
  margin-left: 18%;
}
.elw-chat-assistant{
  background: #111827;
  color: #fff;
  margin-right: 18%;
}
.elw-chat-row{
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.elw-chat-input{
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--elw-border);
  background: #fff;
  color: var(--elw-text);
  outline: none;
}
.elw-chat-input::placeholder{ color: rgba(0,0,0,0.45); }
.elw-chat-input:disabled{ opacity: 0.5; cursor: not-allowed; }
.elw-chat-send{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--elw-border);
  background: #f3f4f6;
  color: var(--elw-text);
  cursor: pointer;
  white-space: nowrap;
}
.elw-chat-send:disabled{ opacity: 0.5; cursor: not-allowed; }


/* Mode selector (Vocal / Chat écrit) */
.elw-mode{
  display:flex;
  gap:8px;
  margin-top:10px;
  margin-bottom:10px;
}
.elw-mode-btn{
  flex:1;
  border:1px solid var(--elw-border);
  background:#fff;
  color:var(--elw-text);
  padding:8px 10px;
  border-radius: 12px;
  font-size: 13px;
  cursor:pointer;
}
.elw-mode-btn.is-active{
  background: #0b0b0b;
  color: #fff;
  border-color: rgba(0,0,0,.25);
}
