/* Floating PLAI voice bubble. Positioned fixed — does not shift .wrap. */

.plai-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 4000;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #fff;
  pointer-events: none;
}

.plai-bubble * { box-sizing: border-box; }

.plai-bubble-shell {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.plai-bubble-panel {
  width: min(320px, calc(100vw - 48px));
  background: #0C0C12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 16px 16px 14px;
}

.plai-bubble-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.plai-bubble-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.plai-bubble-hint {
  margin: 1px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #9A9AA8;
}

.plai-bubble-status {
  font-size: 13px;
  line-height: 1.45;
  color: #9A9AA8;
  margin-bottom: 10px;
}

.plai-bubble-status strong {
  display: block;
  color: #fff;
  font-weight: 600;
  margin-bottom: 2px;
}

.plai-bubble-log {
  max-height: 132px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.plai-bubble-empty {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #9A9AA8;
}

.plai-bubble-msg {
  max-width: 92%;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
  word-wrap: break-word;
}

.plai-bubble-msg.is-user {
  align-self: flex-end;
  background: #7D3CFF;
  color: #fff;
}

.plai-bubble-msg.is-plai {
  align-self: flex-start;
  background: #16161C;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.plai-bubble-msg.is-streaming { opacity: 0.92; }

.plai-bubble-composer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plai-bubble-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #111111;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 0 12px;
}

.plai-bubble-input::placeholder { color: #9A9AA8; }

.plai-bubble-input:focus {
  outline: none;
  border-color: #7D3CFF;
}

.plai-bubble-input:disabled,
.plai-bubble-send:disabled {
  opacity: 0.55;
  cursor: default;
}

.plai-bubble-send {
  flex: 0 0 auto;
  height: 36px;
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  background: #7D3CFF;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}

.plai-bubble-send:hover:not(:disabled) { background: #8A4DFF; }

.plai-bubble-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.plai-bubble-pill,
.plai-bubble-end,
.plai-bubble-x,
.plai-bubble-send,
.plai-bubble-input {
  font-family: inherit;
}

.plai-bubble-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: #7D3CFF;
  box-shadow: 0 8px 24px rgba(125, 60, 255, 0.35);
}

.plai-bubble-pill.is-text {
  background: #1A1A22;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.plai-bubble-pill.is-on {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.plai-bubble-pill:hover { background: #8A4DFF; }

.plai-bubble-pill.is-text:hover { background: #22222C; }

.plai-bubble-pill:disabled,
.plai-bubble[data-state="not-configured"] .plai-bubble-pill {
  background: #1A1A22;
  color: #C8C8D0;
  box-shadow: none;
  cursor: pointer;
}

.plai-bubble[data-state="not-configured"] .plai-bubble-pill:disabled {
  cursor: default;
  opacity: 0.85;
}

.plai-bubble-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.plai-bubble[data-state="listening"] .plai-bubble-dot,
.plai-bubble[data-state="talking"] .plai-bubble-dot,
.plai-bubble[data-state="text"] .plai-bubble-dot {
  background: #3FE07A;
}

.plai-bubble[data-state="reconnecting"] .plai-bubble-dot {
  background: #F5C542;
}

.plai-bubble[data-state="error"] .plai-bubble-dot { background: #FF3C8E; }

.plai-bubble[data-state="talking"] .plai-bubble-dot {
  box-shadow: 0 0 0 4px rgba(63, 224, 122, 0.18);
}

.plai-bubble-end {
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.plai-bubble-end:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.plai-bubble-x {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #9A9AA8;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.plai-bubble-x:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.plai-bubble-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.plai-bubble.is-closed .plai-bubble-panel,
.plai-bubble.is-dismissed {
  display: none;
}

.plai-bubble[hidden] { display: none !important; }

@media (max-width: 640px) {
  .plai-bubble {
    right: 12px;
    bottom: 12px;
  }
  .plai-bubble-pill {
    padding: 10px 12px;
    font-size: 13px;
  }
}
