/* Shared floating Qwen assistant — all LFE product simulators */
.lfe-qwen-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.lfe-qwen-panel {
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 60vh);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.lfe-qwen-panel.open {
  display: flex;
}

.lfe-qwen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #0f3b5c, #1a4f7a);
  color: #fff;
}

.lfe-qwen-head strong {
  font-size: 13px;
}

.lfe-qwen-head span {
  font-size: 10px;
  opacity: 0.85;
}

.lfe-qwen-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.lfe-qwen-status.live {
  background: rgba(16, 185, 129, 0.25);
}

.lfe-qwen-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  min-height: 140px;
}

.lfe-qwen-msg {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.lfe-qwen-msg.user {
  align-self: flex-end;
  background: #0f3b5c;
  color: #fff;
}

.lfe-qwen-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.lfe-qwen-msg.system {
  align-self: center;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 11px;
}

.lfe-qwen-compose {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.lfe-qwen-compose input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 16px;
  outline: none;
}

.lfe-qwen-compose input:focus {
  border-color: #0f3b5c;
}

.lfe-qwen-compose button {
  border: none;
  background: #0f3b5c;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lfe-qwen-compose button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lfe-qwen-toggle {
  border: none;
  background: #0f3b5c;
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 48px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 59, 92, 0.35);
}

.lfe-qwen-toggle:hover {
  background: #1a4f7a;
}

.lfe-qwen-toggle:focus-visible,
.lfe-qwen-compose input:focus-visible,
.lfe-qwen-compose button:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .lfe-qwen-fab {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .lfe-qwen-panel {
    width: min(100vw - 24px, 400px);
    max-height: min(72vh, 560px);
  }
  .lfe-qwen-msgs {
    min-height: 180px;
  }
}
